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 / Physics (Velocity)

Author
Message
Khadin
9
Years of Service
User Offline
Joined: 13th Feb 2015
Location: Nottingham
Posted: 10th Apr 2015 20:49 Edited at: 10th Apr 2015 21:25
Hi again. First time messing with Physics, so here goes. My code:


my Function code:



Ok, now this works as expected. But if i setviewoffset(sW,0) and then set the plane's position to that off:

SetSpritePosition(BplaneSpr,sW+ sW/2,sH -GetSpriteHeight(BplaneSpr))

The plane just falls through the floor.... Why's that?

Thanks

EDIT: The bounce is stronger if i click the plane at the bottom of the screen, than if i'd click the plane at the top. Anyway this can be equal regardless of position clicked?

Khadin
IronManhood
9
Years of Service
User Offline
Joined: 6th Feb 2015
Location: US
Posted: 10th Apr 2015 23:16
If you change the view offset it will disable physics walls. You will have to use a static physics sprite as a wall if you need to change the view offset.
Khadin
9
Years of Service
User Offline
Joined: 13th Feb 2015
Location: Nottingham
Posted: 11th Apr 2015 01:50
You may have to explain in a little more detail?

Khadin
IronManhood
9
Years of Service
User Offline
Joined: 6th Feb 2015
Location: US
Posted: 11th Apr 2015 03:39 Edited at: 11th Apr 2015 04:12
http://www.appgamekit.com/documentation/Reference/Core/SetViewOffset.htm


http://www.appgamekit.com/documentation/Reference/Core/SetViewZoom.htm

What do you need explained, exactly?

Also, is there any advantage or point to having multiple do loops? It seems to me that the do loop in your physicsVelocity function is not necessary, but I could be wrong. Another thing, you only need to call sync once....again I could be wrong.
Khadin
9
Years of Service
User Offline
Joined: 13th Feb 2015
Location: Nottingham
Posted: 11th Apr 2015 17:41
Still lost. Don't worry about it, i'll figure it out.

Khadin

Login to post a reply

Server time is: 2024-04-19 03:18:24
Your offset time is: 2024-04-19 03:18:24