Lemmings style movement

Get help using Construct 2

Post » Mon Dec 30, 2013 8:11 pm

Need a little help getting this movement down. Right now I have my characters set to the Platform behavior and in the code it says if their direction is 0 then the simulate moving right.

The part I need help with is changing direction. I'm not really sure how to make them bump into a wall and go back. I tried to place invisible bumpers in the map that will change their direction variable which then has them simulate pressing left. There is probably a much easier way to do this that I'm over looking
B
4
S
1
G
3
Posts: 36
Reputation: 1,147

Post » Mon Dec 30, 2013 8:48 pm

This is an old test i made with an OLD version of Canvas by @R0j0hound

It works but is really slow (it used to run great now it has a real slowdown problem...)

Anyway the events should really be optimized so every tick is used only once and not all over the place but this does what you want...

https://dl.dropboxusercontent.com/u/45711709/Lemmings/Lemmings.capx
B
33
S
6
G
7
Posts: 339
Reputation: 7,426

Post » Mon Dec 30, 2013 8:58 pm

You can check for walls on the left/right using the platform behavior.

Example: https://dl.dropboxusercontent.com/u/2383513/linkedOUT/lemmings-likemovement.capx
B
123
S
43
G
41
Posts: 847
Reputation: 28,206

Post » Mon Dec 30, 2013 9:02 pm

Its a good example but it has its limitations for what I'm trying to do. I don't want the background to just be black. The movement works perfectly fine using the platform behavior and simulated controls, but for some reason it wont do anything if I have the same action applied with different variables.

For instance I tried to do it to where I would touch one of the guys on screen and he'd flip directions based on his direction variable. However, it would not work unless I deleted the other command.

Example being, if his direction var = 0 and he's touched, turn his variable to 1 (which should flip direction). This works, but it breaks if I do if direction var = 1 and he's touched. Almost like its just toggling on and off really fast. Same goes for the wall bumping that I implemented
B
4
S
1
G
3
Posts: 36
Reputation: 1,147

Post » Mon Dec 30, 2013 9:04 pm

[QUOTE=andreyin] You can check for walls on the left/right using the platform behavior.

Example: https://dl.dropboxusercontent.com/u/2383513/linkedOUT/lemmings-likemovement.capx[/QUOTE]

Wow I totally skipped over that. Its exactly what I am looking for. Thanks so much!
B
4
S
1
G
3
Posts: 36
Reputation: 1,147


Return to How do I....?

Who is online

Users browsing this forum: Lancifer, MPPlantOfficial, Sup with that? and 61 guests