New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GH-414] add bush mechanic #417
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionality looked good by following the steps you gave! Leaving a small code comment
apps/arena/lib/arena/game_updater.ex
Outdated
|
||
if candidate_player.id != player_id and | ||
(Enum.empty?(candidate_bush_collisions) or (players_in_same_bush? and players_close_enough?)) do | ||
acc ++ [candicandidate_player_id] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's no reason not to use [candidate_player_id | acc]
here, right?
It's the better option out of the two, as per ++ docs, and I don't think we care about what order these players are on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope, not reason at all. Changed!
Also i noticed we're doing extra checks since we're running the checks for the same player, i moved the ifs a little bit so we dont do extra calculations
Also please add the steps for testing the PR that you sent me via slack in the description! |
yes! sorry i forgot about that, added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Although I want to know why instead of implementing something like "Hey I'm on this bush, is there someone else here with me? we implemented something like “Hey, who am I seeing?”
Closes #414
Now we'll have a new entity type called "Bush" that will work as a non collisionable entity to hide players from other players
The bushes will hide players under the following conditions:
To tests this pr:
bushes
array in the config.json filemiddle bush
game_launcher.ex
change this: @clients_needed 2game_updater.ex
handle_info(:update_game, %{game_state: game_state} = state) do
before the last line add:Now start a match in the game client goin to this link and you should see the visible players in the game terminal, when the bot steps on the bush while chasing you, you should disappear from the bot visible players list, something like:
You can also test this opening two game client windows and play around the bush