How do I Check if a tile is a lava tile

Get help using Construct 2

Post » Thu Jan 12, 2017 3:15 pm

Hi I am trying to check if the tile on the tilemap at the right of the player sprite is a lava tile
ofcourse i can make allot of conditions saying: compare tile at (player.X/playerSize)+1,player.Y/playerSize = NumberOfTheTile

but i want to check if the tile is a lava tile currently my lava tiles have number 2, 5, 8 and 11

I was thinking if there was a expression to make one conditions saying: compare tile at (player.X/playerSize)+1,player.Y/playersize = Expression(2,5,8,11)
but i cant find it anywhere :|
B
7
Posts: 9
Reputation: 271

Post » Thu Jan 12, 2017 4:15 pm

Image Sorry I didn't really read the beginning lol. So I'm sure this isn't what you were looking for. I do that sometimes.
B
24
S
3
G
1
Posts: 47
Reputation: 1,598

Post » Thu Jan 12, 2017 4:27 pm

I dont think I understand what you are trying to do.
I am trying to check if a tile is either 2,5,8 or 11.
but currently i have to do this: Image
B
7
Posts: 9
Reputation: 271

Post » Thu Jan 12, 2017 4:30 pm

basicly i want to be able to have only one block instead of 4
for example by using a expression: X Tile((sprite.X/32)+1, (sprite.Y/32)) = ???(2,5,8,11)
B
7
Posts: 9
Reputation: 271

Post » Thu Jan 12, 2017 4:39 pm

You can "write" your own expression using a function.
Image
And then, you use it like this :
Compare Two Values
1st value : Function.Call("IsValuePresent", searchedValue, value1, value2, ...)
Equals
2nd value : 1
B
67
S
28
G
24
Posts: 970
Reputation: 18,675

Post » Thu Jan 12, 2017 4:50 pm

thanks i will try that :)
B
7
Posts: 9
Reputation: 271


Return to How do I....?

Who is online

Users browsing this forum: Apollo14, ivanski1983, KTML5 and 4 guests