Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / [BASIC] Stuck on physics

Author
Message
basicFanatic
7
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 18th Jun 2017 00:08
I managed to get some ASDW movement working! However, I can't adjust the speed, and I have the feeling that SetSpritePhysicsVelocity is simply the wrong way to do it. But I have no clue how to use SetSpritePhysicsForce. Can anyone give me some pointers? I really want some solid physics as the foundation, but I'm totally clueless as to how I should go on about it.

My code so far:

blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 18th Jun 2017 00:29
basicFanatic
7
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 18th Jun 2017 01:01
That one works pretty good! However, it't based on SetSpritePhysicsVelocity, which makes sense when creating an instant shooting effect. But I'm more trying to apply a movement force when holding down the ASDW movement keys.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 18th Jun 2017 01:04
Try setphysicsscale(0.1)
basicFanatic
7
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 18th Jun 2017 01:52
Thanks, that 0.1 did wonders! I even got SetSpritePhysicsForce to work:


Login to post a reply

Server time is: 2024-11-22 07:16:12
Your offset time is: 2024-11-22 07:16:12