Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   Motor bike wheelie issue (http://www.alice.org/community/showthread.php?t=11927)

 InstigatedApprentice 03-08-2018 01:29 PM

Motor bike wheelie issue

Hi everyone :)

So I'm creating a game in which there is a motorbike that is controlled using the arrow keys. Pressing spacebar causes the motorbike to do a wheelie. I have managed the wheelie part by starting an event when the spacebar is pressed to call a turn function which causes the motobike to tilt backwards.
Unfortunately, it seems that when the motorbike is tilted backwards, pressing the forwards key causes it to zoom off in whichever way the motorbike is facing, which in this instance would be upwards at a 45 degree angle.

Does anyone have any idea on how to stop this from happening?

Many thanks,

 sometimes618 03-08-2018 06:40 PM

[QUOTE=InstigatedApprentice;57893]Hi everyone :)

So I'm creating a game in which there is a motorbike that is controlled using the arrow keys. Pressing spacebar causes the motorbike to do a wheelie. I have managed the wheelie part by starting an event when the spacebar is pressed to call a turn function which causes the motobike to tilt backwards.
Unfortunately, it seems that when the motorbike is tilted backwards, pressing the forwards key causes it to zoom off in whichever way the motorbike is facing, which in this instance would be upwards at a 45 degree angle.

Does anyone have any idea on how to stop this from happening?

Many thanks,

[SIZE="1"]In general, the "as seen by" method extension is usually helpful to me in a scenario like this.
I would make the "move" method (the method that makes the motorbike go forward) be "as seen by" an object that is always flat to the ground. If you want the motorbike to turn left or right, make the object flat to the ground turn.[/SIZE]
[SIZE="3"][COLOR="Red"]EDIT:[/COLOR] On second thought, there is an easier way.
Try making a dummy on the motorbike that has the "forward/turning" control instead of the motorbike, and set the motorbike's vehicle to the dummy. Keep it so that the motorbike, not the dummy, turns backwards for the wheelie, though.[/SIZE]

 InstigatedApprentice 03-09-2018 04:00 PM

[QUOTE=sometimes618;57895][SIZE="1"]In general, the "as seen by" method extension is usually helpful to me in a scenario like this.
I would make the "move" method (the method that makes the motorbike go forward) be "as seen by" an object that is always flat to the ground. If you want the motorbike to turn left or right, make the object flat to the ground turn.[/SIZE]
[SIZE="3"][COLOR="Red"]EDIT:[/COLOR] On second thought, there is an easier way.
Try making a dummy on the motorbike that has the "forward/turning" control instead of the motorbike, and set the motorbike's vehicle to the dummy. Keep it so that the motorbike, not the dummy, turns backwards for the wheelie, though.[/SIZE][/QUOTE]

Thanks for the help,I never even considered that! I'm going to give both options a go and see what happens! :D

 InstigatedApprentice 03-09-2018 04:16 PM

Well that was an absolutely brilliant fix. Cheers!

 All times are GMT -5. The time now is 04:12 AM.