anyone know how to create game like doodle jump, i try the pre and post collision but still doesn’t work. or i do it wrong.
anyone have sample for that kind of function in Lua?
Thank you [import]uid: 7427 topic_id: 10549 reply_id: 310549[/import]
anyone know how to create game like doodle jump, i try the pre and post collision but still doesn’t work. or i do it wrong.
anyone have sample for that kind of function in Lua?
Thank you [import]uid: 7427 topic_id: 10549 reply_id: 310549[/import]
I’m trying to make a game similar to doodle jump but I can’t get the platform collision to work either.
I guess you’re after the same as I want, be able to jump through the platform on the way up and bounce off them on the way down?
How did you solve the automatic jumping?
I’m trying to apply LinearImpulse when the player hit the platform but I can’t get it right and the collision fires off multiple times and the player jumps like crazy.
David [import]uid: 34126 topic_id: 10549 reply_id: 38399[/import]
well i use bounce = 1 in the platform and set the linearDamping = 0.1 in the character.
anyone? maybe johnbeebe can help [import]uid: 7427 topic_id: 10549 reply_id: 38400[/import]
I’ll try that, I got my project in this thread.
How did you make the background scrolling, I’m trying to make the background scroll with the same amount of pixels the player jumps. Trying to crack that nut too but it seems to be more difficult than I expected.
Please post your solutions in that thread too and I’ll share min too.
David. [import]uid: 34126 topic_id: 10549 reply_id: 38401[/import]
for the background, i’m not in that phase yet. I think you can see the example files from the EggBreaker. [import]uid: 7427 topic_id: 10549 reply_id: 38451[/import]
I created a game that has a similar type of gameplay to Doodle Jump, where your goal is to “jump” as high as you can, from the bottom to the top and go through the platforms.
Getting the player to jump THROUGH the platform and land back on top of it was BY FAR the hardest part, and took forever to figure it out.
The code is a little too much to post here, because it spans out across a lot of lines, and there’s a lot of irrelevant things in-between (that have to do with my game), so it would likely be confusing to dissect anyway, so I’ll give you the logic behind how I accomplished this.
First, you must ensure your physics bodies are mapped to your platforms AND your character as closely as possible. If you use software such as PhysicsEditor, it’ll make that part very easy.
Then, what you’ll need to do is make your character a dynamic physics body.
You will then make all of your platforms a sensor object (so the player can pass through it).
Make ONE platform (if they all look the same) a regular physics body, and move it offscreen somewhere (so you can’t see it, and so the player won’t run into it).
Both the sensor platforms and the ONE dynamic platform must have the same physics body coordinates, and also use the same resource image.
What you have to do is, using the sensor platform, detect when the player collides with it (since it is a sensor, it won’t interrupt the player’s movement).
Then, once you’ve detected that the player has gone PAST the platform, you simply move the other platform to the same x/y coordinates as the sensor platform that the player last passed through.
Visually, you should see no difference (since the sensor platform will look exactly the same as the physical platform), but the player will then appear to pass through the bottom of the platform and land on the top.
Is this the best way to do it? I don’t know, but it worked for me (see Dungeon Tap: http://bit.ly/beebedungeontap)
I couldn’t figure out how to do it with just preCollision events, and that solution came after many many hours of attempting to think outside the box (lol).
Hope that helps!
[import]uid: 7559 topic_id: 10549 reply_id: 38851[/import]
By the way, can we just set the sensor attr to be false when the character if higher than the platformer? [import]uid: 7427 topic_id: 10549 reply_id: 38861[/import]