*[Solved]* How do I check a position 32 pixels away

Get help using Construct 2

Post » Tue May 20, 2014 9:27 pm

I'm having a bit of trouble on how to add the following to my event sheet:

> When the right arrow key is pressed
>> check if the area 32 pixels to the right of the player is empty and doesn't have a 32x32 sprite from the 'NoGo' family
>>> if that area is clear then move the player (32x32 sprite) 32 pixels to the right.

basically everything is top-down 32x32 px and the player 'jump-moves' in 32 px increments from square to square but i don't want him moving to a square that has something there. I did something similar in GameMaker (https://www.youtube.com/watch?v=N6epaUBInIk&list=PL9F821B4D60D20D09) and I'm trying to do the same thing here.

Any help would be appreciated. :)
Last edited by Nickydude on Tue May 20, 2014 11:01 pm, edited 1 time in total.
B
72
S
25
G
10
Posts: 383
Reputation: 11,171

Post » Tue May 20, 2014 9:43 pm

Is overlapping another object
Is overlapping at offset
True if any instance is overlapping any instance of another object. The collision polygons are taken in to account if set, as well as the object's size and rotation. The 'offset' variant will test for an overlap at an offset from the first object. For example, testing for an overlap at an offset of (100, 0) will temporarily move the object to the right 100 pixels, test for the overlap, then move it back again.
What I know would fill a Book , what I don't know would fill a Library
B
37
S
12
G
29
Posts: 331
Reputation: 16,499

Post » Tue May 20, 2014 9:51 pm

Thanks granpa.

How to I check an offset of an imagepoint?
B
72
S
25
G
10
Posts: 383
Reputation: 11,171

Post » Tue May 20, 2014 10:58 pm

Nickydude wrote:Thanks granpa.

How to I check an offset of an imagepoint?


What exactly are your trying to do , is this related to last question or a different check ?
What I know would fill a Book , what I don't know would fill a Library
B
37
S
12
G
29
Posts: 331
Reputation: 16,499

Post » Tue May 20, 2014 11:01 pm

It was related to the last question but it's OK. I created a 'location' sprite that moves ahead of the character to check if there's anything there and now it works fine. Thanks for your help though.
B
72
S
25
G
10
Posts: 383
Reputation: 11,171

Post » Tue May 20, 2014 11:39 pm

No problem , think of overlap offset as similar to place_free or place_empty in gamemaker .
What I know would fill a Book , what I don't know would fill a Library
B
37
S
12
G
29
Posts: 331
Reputation: 16,499

Post » Tue May 20, 2014 11:47 pm

Yeah, that's what I was looking for but I was having trouble with the offset so I created a locator sprite which did the job. :)
B
72
S
25
G
10
Posts: 383
Reputation: 11,171


Return to How do I....?

Who is online

Users browsing this forum: BiffanyPFH, dop2000, Klarner and 27 guests