line of sight and paralax layer sync

0 favourites
  • 5 posts
From the Asset Store
solution for games like "fruit ninja" and drawing applications
  • 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

    capx:

    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

  • 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?

  • 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.

  • 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

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • It works perfectly thank you guys!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)