line of sight and paralax layer sync

Get help using Construct 2

Post » Wed Jun 29, 2016 11:51 am

Message: Skvor can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Hello, I'm having last shot at this
The game looks nice and is almost completed except this:

Image

I have a moving monster in background that should be able to detect the player. It has line of sight behaviour. Problem is it moves in paralax scrolling layer (set to 65). But the actual line of sight acts like if the layer had 0 scrolling effect ( like if it was set to 100). This causes de-synchronisation.

Here is what i tried so far:
the line of sight is behaviour of the player and the player detects the monster. No change
tried the bullet movement and custom movement. no difference

Here is capx so you can see what's wrong if you're interested in helping me
Red ball is in layer that has paralax scrolling set to 100 and represents the actual position of line of sight
Image

capx:
http://www
.dropbox.com/s/le9nrk2a74wiizt/a%20problem.capx?dl=0

edit:
also I would like to add that any help would be most welcome... or suggestion how to make the game work even without paralax layers. I'm rather hopeless. Thanx
B
4
Posts: 9
Reputation: 218

Post » Thu Jun 30, 2016 5:44 pm

Can you create a "lineOfSight" invisible sprite on the player level and assign it the same relative position on the player layer as the background monster?
You would probably have to use a CanvasToLayerX/Y kind of thing. Then measure the line of sight from this invisible sprite?
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,414
Reputation: 4,822

Post » Fri Jul 01, 2016 12:14 am

Thank you,
I will try this... somehow

but I fear the invisible sprite might again follow the wrong desynchronised position. Or perhaps not, will see.
B
4
Posts: 9
Reputation: 218

Post » Fri Jul 01, 2016 2:07 am

I had the same problem in my game with my "moon" and the "light" object having to be on different layers...

Try THIS TUTORIAL

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
80
S
34
G
40
Posts: 3,029
Reputation: 30,393

Post » Fri Jul 01, 2016 6:48 pm

It works perfectly thank you guys!
B
4
Posts: 9
Reputation: 218


Return to How do I....?

Who is online

Users browsing this forum: leandrogenske, R0J0hound and 13 guests