Last active
December 16, 2015 10:09
-
-
Save Omnipresent/5417888 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@body = @world.new_body position: [225, 35] do | |
polygon_fixure box: [26, 26], | |
friction: 0.3, | |
density: 1.0 | |
end | |
@player = PhysicsSprite.new file_name: 'player.png', body: @body, type: KKinematicBodyType | |
on_touches_ended do |touches, event| | |
end_touch = touches.any_object | |
end_touch_location = end_touch.location | |
puts @hero_gorilla.body.methods.grep /linear/ # no methods found for changing velocity | |
#how to move a KKinematicBodyType? | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@player is of type KKinematicBodyType because I wanted something that is not affected by gravity but still can be moved.
The player would stay at the bottom of the screen and move horizontally relative to user interaction