Skip to content

Commit

Permalink
chore: renaming in check_power_up
Browse files Browse the repository at this point in the history
  • Loading branch information
siddarthsingh1 committed Jan 8, 2024
1 parent f8755b9 commit abba40b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions jumanji/environments/routing/pacman/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,14 +439,14 @@ def check_power_up(
power_up_locations = jnp.array(state.power_up_locations)

player_space = state.player_locations
ps_x = player_space.x
ps_y = player_space.y
ps = jnp.array([ps_y, ps_x])
player_loc_x = player_space.x
player_loc_y = player_space.y
player_loc = jnp.array([player_loc_y, player_loc_x])

# Check if player and power_up position are shared
on_powerup = (ps == power_up_locations).all(axis=-1).any()
on_powerup = (player_loc == power_up_locations).all(axis=-1).any()
eat = on_powerup.astype(int)
mask = (ps == power_up_locations).all(axis=-1)
mask = (player_loc == power_up_locations).all(axis=-1)
invert_mask = mask != ~mask
invert_mask = invert_mask.reshape(4, 1)

Expand Down

0 comments on commit abba40b

Please sign in to comment.