Movement between 3 lanes?

Get help using Construct 2

Post » Fri Aug 11, 2017 6:08 pm

Hiya,

So I'm trying to make a car move between 3 lanes. One of the things I don't understand is why there is no 'move object to position' command, or is there?

See, I want the car to maintain its angle (say 0 degrees). Then when pressed up, move to the lane 1. Move down, move to lane 2. If in lane 3, the player can go up or hit the dirt and crashes (movement stops when hitting a barrier, set frame to 1). When in lane 1, go up and crash or move down to lane 2.

Now initially I wanted some retro effect that moves the object in 5 pixels steps, 90 pixels distance between each lane. So if you press up, the car would could go up in steps of 5 pixels, travelling 90 pixels to the top lane.

Now I came across a bunch of things while doing this myself. I'm still a bit of a n00b. I searched the forums but couldn't find any answers.

I fiddled with it myself but I guess I still need to learn a lot I guess as I got a lot of unexpected results. For example, with this code (which is probbaly crappy and improvised) if I pressed up or down it would always move down.

Image

Thanks for any replies.

- R
B
14
S
7
G
4
Posts: 145
Reputation: 3,610

Post » Fri Aug 11, 2017 7:04 pm

Good afternoon.
I believe you need to set the position of the object, you can do it in the lines of code ...
Huemerson
B
27
S
18
G
22
Posts: 116
Reputation: 19,888

Post » Fri Aug 11, 2017 7:25 pm

Hello,

Well I'm trying to make the car move to the lane, rather than just teleport to it. Preferably in 5 px 'steps' as described in my original post.

Thanks.
B
14
S
7
G
4
Posts: 145
Reputation: 3,610

Post » Mon Aug 14, 2017 11:40 am

Have you tried (by pressing the key (specify a key), the car object move to position (car.x + (n ipxels))).
Huemerson
B
27
S
18
G
22
Posts: 116
Reputation: 19,888


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot], stellko and 6 guests