Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

HBGames

I was trying to create a car system with accelleration (there are couple of scripts out there but they don't work with the custom ones I use), in which for instance you accelerate and move forward by pressing up, break by pressing x, move backward by pressing down, turn 45 degrees left while pressing left and turn 45 right by pressing right.

The problem is that it's not possible to turn 45 degrees left or right, so I tried with a gimmick, when everytime button left (or right) is pressed it adds 1 to variable 1 so you can gradually turns and when up is pressed it moves to the direction memorized by the variable.

Example (assuming the character is facing left):
if Variable 1=0
if button left is pressed

wait 4 frames
set mouve route: change graphic (sprite facing lower left)
variable 1=1
wait for movement completion
end
end

if Variable 1=1
if button left is pressed

wait 4 frames
set mouve route: change graphic (sprite facing down)
turn down
variable 1=2
wait for movement completion
end
end
and so on...

Then...

if Variable 1=1
if button up is pressed
set mouve route:
move down

and so on...


The problem is that the character turns just fine, but only moves when left is not pressed anymore. If I try to move by pressing up and left together (attempting to turn and move at the same time).

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top