Question for platform behavior expert

Discussion and feedback on Construct 2

Post » Wed Jan 04, 2017 10:25 pm

Hi, I can not get the ceiling to be detected using this calculation, what am I doing wrong ?.
The tilemap should not be altered, the tilemap is smaller than the layout, it should be.
What I want is to detect the ceiling above the sprite but the calculations are not being correct, I do not understand why.

Someone knows?.

Image

https://dl.dropboxusercontent.com/u/60803633/testDetectarTile.capx
B
30
S
13
G
21
Posts: 838
Reputation: 14,656

Post » Wed Jan 04, 2017 10:39 pm

Need to translate position to index. Besides that i think you need to check both corners.

https://www.dropbox.com/s/tb3se1184awet ... .capx?dl=0
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Wed Jan 04, 2017 10:50 pm

99Instances2Go wrote:Need to translate position to index. Besides that i think you need to check both corners.

https://www.dropbox.com/s/tb3se1184awet ... .capx?dl=0


Thanks! This is what I was looking for but ... why does not my formula work ?.
In other engines I have used it and it worked.

I'm checking the two corners but this was just a test to show the question.
B
30
S
13
G
21
Posts: 838
Reputation: 14,656

Post » Wed Jan 04, 2017 11:07 pm

I'm pretty sure that's what I did in one of my games in the past. I made it 2x2 pixels or something and then just had it always follow above the player to detect overlaps.
B
61
S
20
G
56
Posts: 1,077
Reputation: 35,991

Post » Thu Jan 05, 2017 5:08 pm

(sprite.y / 8 ) has no offset. ((sprite.y / 8 ) - 1) could work.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: muftyk and 8 guests