Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: johannes-missbach/cloucelona
base: 46d82c1ef9
...
head fork: johannes-missbach/cloucelona
compare: e6d2b7479f
Checking mergeability… Don't worry, you can still create the pull request.
  • 1 commit
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 19 additions and 1 deletion.
  1. +19 −1 lib/pedestrian.rb
View
20 lib/pedestrian.rb
@@ -8,4 +8,22 @@ def current_state
:normal
end
-end
+ def update_movement(dt)
+ # Invert direction if outside of field and put inside field
+ if @pos.x > 776
+ @pos.x = 776
+ @vel.x = - @vel.x
+ elsif @pos.x < 24
+ @pos.x = 24
+ @vel.x = - @vel.x
+ end
+ if @pos.y > 576
+ @pos.y = 576
+ @vel.y = - @vel.y
+ elsif @pos.y < 24
+ @pos.y = 24
+ @vel.y = - @vel.y
+ end
+ end
+
+end

No commit comments for this range

Something went wrong with that request. Please try again.