+1 vote

I'm trying to make a doodle jump kind-of clone with a ball that just goes up and up when you push it

I want to either:

1- Make it so that if it goes out of the lateral bounds it teleports to the other side (like Pac-Man), using code to do this seems very buggy, teleporting a rigidbody doesn't seem too appealing visually and it also doesn't cover the (literal) edge case where the ball stays in the bounds and you'd see half in each side

2- I could also live with the borders of the screen just deflecting the ball, I've thought of using static bodies as walls but when I move my viewport I have to move them and have no idea how to do so.

My intention is for the game to be infinite or very large, so putting a large static body isn't a good solution either

I'm sure both questions have simple answers but I can't find the answers in google

Thank you!

in Engine by (19 points)

1 Answer

0 votes

Doodle Jump does like most do, just teleport.

Is not easy to do, depends on the mechanics, if you want the split body to react to collisions on both sides, maybe you will have to create your own physics process (shape API may be enough for collisions).

If you want to deal with all the problems that using a rigid body will give with this mechanic (in any public engine), maybe you can use the custom integrator and 2 shapes for the body, when in transition, displace the other shape to the other side but not sure how well will work.

Forgot, for the walls, well, walls can follow the player but look this way, the screen may be never moving, just the obstacles (that is how most "infinite" scrollers work).

by (7,874 points)
edited by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.