How do I make a car movement which the background moves not the car?

  • hi people, first, sorry for my poor english. I am trying to make an educational game which envolves driving a car in a city. I’m using the car behaviour, but I would like that the car kept always the same position while the background moved. the car would always be in the centre of the screen up oriented and when up arrow is pressed background scroll down, if left arrow is pressed, background scroll right, and so on. I would also like to keep the smoothness of a car movement. May someone help me?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • See Driving template:

    https://editor.construct.net/#open=template-driving

    If you want the car to always point in one direction and the whole screen to rotate instead, add this action:

    System set layout angle to (Car.Angle+90)
    
  • Thank you very much man!

  • Dop2000, one more question: I have a layer with informations that I want to be always in the same place. All the texts have the anchor behaviour. Of course, after I set the car.angle+90 for the layout those informations are also moving. I tried to set the same car.angle + 90 for that layer but didn´t work. Would you tell me how to deal with that?

  • You want an additional layer with a parallax 0,0 that contains the informations you do want to display.

    This is instructed in the Beginner's guide : construct.net/en/tutorials/beginners-guide-to-construct-3-1

    And set the angle for this layer to 0 to have it back to the "normal" orientation. You want to do this after the action where you set the layout angle.

    Or instead, if you have multiple layers, you only want the "game" layers to have the angle modification applied to them.

  • I tried. Setting the paralax to 0 only works if I do not set the layout angle to car.angle + 90...

  • Try rotating individual layers as Kyatric suggested, not the entire layout.

  • Kyatric, thank you for your attention. I´ll try these alternatives you mentioned. I have a lot of layers with different parallax, so I would prefer to change the layout angle, instead of the layers angle.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)