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.

AppGameKit Classic Chat / Moving platforms and characters

Author
Message
tomgt
9
Years of Service
User Offline
Joined: 2nd Sep 2015
Location:
Posted: 2nd Sep 2015 04:34
Hi guys, first post and I'm hoping to get some help here. I want to make a horizontal running + jumping game with platforms. I thought I could adapt the space shooter demo from AGK's examples but I can't figure out how to space them properly, or move the sprite when on them (with a platform) I want the platforms to be wavy like space shooters.

I know the way I tried to move the player with the platform can't be used because when the platform is going up and down because there is a gap , so no collision.

So my question is, can I adapt it or should I take a whole new approach ? If a whole new approach (which I think I need to do ) Any suggestions for generating and moving them the platforms and the player with them?

My butchered attempt is below. Thanks

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 2nd Sep 2015 13:54 Edited at: 2nd Sep 2015 13:55
if u using physics for player and platform the player should
move with because friction.

without physics i would make a sensor above the platform,
test this area with GetSpriteInBox( iSprite, x1, y1, x2, y2 )
and move it same distance what the platform moves.

this SetSpritePosition ( g_platforms [ i ].iSprite, fShipX#, fShipY# )
skip the physic engine, u can get side effects at collisions.

can not test your example yet.

AGK (Steam) V2 Beta .. : Windows 10 Pro, 8.1 Pro 64 Bit : AMD (15.7.1) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 2nd Sep 2015 16:21
Quote: "without physics i would make a sensor above the platform,"

Actually, I'd just check for collisions, then move the player when the platform moves.

Login to post a reply

Server time is: 2024-11-16 20:38:34
Your offset time is: 2024-11-16 20:38:34