# how to move character left and right on isometric game

Get help using Construct 2

### » Sat Sep 03, 2016 8:11 am

like subway surfer , the road has 3 paths , i want the character to move right when swipe right and left when swipe left.
B
4
Posts: 14
Reputation: 228

### » Sat Sep 03, 2016 11:00 am

One simple way to do this:

1. create a global variable to keep track of which lane is the player in. Let's call it "globalLane".

2. from player's swipe left/right, you increase/decrease globalLane by 1, but make sure they are only in the range of 0 to 2. You can do something like, for example: globalLane = max(0, min(2, globalLane) after you increase/decrease it.

3. create a new object and call it "signalObj". Every tick, do this:

if globalLane = 0, set signalObj.X = 100, signalObj.Y = 300.
if globalLane = 1, set signalObj.X = 200, signalObj.Y = 300.
if globalLane = 2, set signalObj.X = 300, signalObj.Y = 300.

4.Create a player object, and in the event sheet, do this every tick :

player move towards signalObj. You can use:

Move at angle
Move the object a number of pixels at a given angle in degrees.

So: player Move 100*dt pixels at angle [i]angle(player.X, player.Y, signalObj.X, signalObj.Y)

All these above should give you a basic idea to do what you want. Of course, this is just a basic simpler implementation idea, and not the best way to implement.
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,469

### » Sat Sep 03, 2016 11:14 am

After you understand the concept above, the next would be start throwing obstacles (probably woth Bullet behavior) that spawn at the top and come down in each lane.

Now, for the isometric part, this will depend on your aesthetic design and art, but it is not much different from non-isometric view. Maybe try add some art assets and try play around with it.
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,469

### » Sat Sep 03, 2016 7:13 pm

Check out this tutorial. It's not isometric, but it's about making the swiping and multi-touch work on the mobile environment.

https://www.scirra.com/tutorials/4973/m ... t-controls
B
11
S
6
G
15
Posts: 256
Reputation: 9,207