How do I evaluate the 4 directions (with walls)

Get help using Construct 2

Post » Mon Apr 27, 2015 10:47 pm

would like that when the robot touches the yellow cube, evaluate the 4 directions: Up, Right, Left, Down, and chose one of the possible free directions.

PLEASE HELP ME !! :cry:

Feel free to change all the programming code. :geek:

Here is a video that I want to do:
https://www.youtube.com/watch?v=UaqbN480Wog

image:
https://drive.google.com/file/d/0B9uHUU ... sp=sharing

file .capx
https://drive.google.com/file/d/0B9uHUU ... sp=sharing
B
48
S
9
G
10
Posts: 200
Reputation: 8,258

Post » Mon Apr 27, 2015 10:59 pm

For this I would add to the yellow cube 4 booleans (UP, RIGHT, DOWN, LEFT) and leave them on false as default. I don't know what the blue paths are called, but I'll just call them 'Blue' in this example.

-At Start of layout
-For Each 'cube'
--'YellowCube' overlap 'Blue' at offset Y= -2
---'YellowCube.UP' = True
--'YellowCube' overlap 'Blue' at offset Y= 2
---'YellowCube.DOWN' = True
--'YellowCube' overlap 'Blue' at offset x= -2
---'YellowCube.LEFT' = True
--'YellowCube' overlap 'Blue' at offset Y= 2
---'YellowCube.RIGHT' = True

Then whenever you make it to a yellow cube you just check its booleans. Hope it makes sense.

**Edit** You might need to adjust the offset numbers.
B
5
Posts: 19
Reputation: 263

Post » Mon Apr 27, 2015 11:04 pm

This information is incomplete ...
how i evaluate the 4 directions?????????
I upload .capx
Last edited by luisgmolina on Mon Apr 27, 2015 11:58 pm, edited 2 times in total.
B
48
S
9
G
10
Posts: 200
Reputation: 8,258

Post » Mon Apr 27, 2015 11:55 pm

How i check this boolean???
B
48
S
9
G
10
Posts: 200
Reputation: 8,258


Return to How do I....?

Who is online

Users browsing this forum: eochranek, fearfulelephants and 20 guests