Search code examples
game-maker

Top down car game (game-maker)


I'm new to programming on game-maker and programming in general. This is probably very easy but i'm unsure of how to go about things.

I am programming a simple top-down car game in which the car drives (forward) by it's self and is steered with the left and right mouse buttons. I attempted to get the car to drive on it's own with:

speed = 3

This, although making the car go forward, stopped the steering from working somehow and now the car rotates instead of actually turning around the corner.

How can i get the car to drive on it's own and still be able to turn the car?


Solution

  • You should not change image_angle, but direction instead. Image_angle is juste what you see, direction is the real physics direction.

    Replace the code in your link by :

    direction = direction + 2;
    image_angle = direction;
    

    Like this, you turn the car, and then align the image on the car orientation.