This site requires JavaScript, please enable it in your browser!
Greenfoot back
Kinq
Kinq wrote ...

2018/5/24

How to do a wheelie - make a ramp

Kinq Kinq

2018/5/24

#
Hey guys! For a school project, I'm trying to make a Motocross game. The Biker is riding down a way in 2D. Now my questions. 1. I know how to make that the bike is turning. But It has to stop in the air, so its not turning around anymore. And when I stop pressing the key, the bike should go back down. 2. And my second question is, how to make ramps, that the biker is jumping over it. The problem is, I've got a picture of a 5 x 5 block. With a loop i have to try to make a ramp, that the biker can jump over it. I hope you guys can help me! Kind Regards!
danpost danpost

2018/5/24

#
Kinq wrote...
1. I know how to make that the bike is turning. But It has to stop in the air, so its not turning around anymore. And when I stop pressing the key, the bike should go back down. 2. And my second question is, how to make ramps, that the biker is jumping over it. The problem is, I've got a picture of a 5 x 5 block. With a loop i have to try to make a ramp, that the biker can jump over it.
For everything that you are wanting, it sounds like you will probably need the standard jump/gravity set-up with some extra code to work with both wheels and the rotation of the bike between them. Cannot give more info at this time as I have other things to do today.
Kinq Kinq

2018/5/25

#
Alright, but thanks! You can try to help me, when you got enough time, if you want to!
danpost danpost

2018/5/25

#
Kinq wrote...
Alright, but thanks! You can try to help me, when you got enough time, if you want to!
Please describe what images you have for the Biker object. I guess what I am asking is whether you have one image that includes a bike with wheels and a rider on it or if you have multiple actors, and if so what all actors do you have. Knowing this will determine the extent of code needed.
Kinq Kinq

2018/5/29

#
Well ive got a Actor calles "Cross" Its an Image of a biker, with his bike in one.
danpost danpost

2018/5/29

#
Kinq wrote...
Well ive got a Actor calles "Cross" Its an Image of a biker, with his bike in one.
Then I guess you would need to collision check at the base of the wheels using the getOneObjectAtOffset(int, int, Class) method. Also, maybe track rotational speed and apply gravity at both points also (so that it can be made to move more realistically.
Kinq Kinq

2018/6/5

#
Thanks
You need to login to post a reply.