Hello, I'm having last shot at this
The game looks nice and is almost completed except this:
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
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
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?
I will try this... somehow
but I fear the invisible sprite might again follow the wrong desynchronised position. Or perhaps not, will see.
I had the same problem in my game with my "moon" and the "light" object having to be on different layers...
Try THIS TUTORIAL
Develop games in your browser. Powerful, performant & highly capable.
It works perfectly thank you guys!