How do I FLIP LINE OF SIGHT

0 favourites
  • 8 posts
From the Asset Store
solution for games like "fruit ninja" and drawing applications
  • i have a rather simple question that has been bugging me from day one but i had postponed it until today.

    lets say we have a square that is moving right.

    LOS is starting from the origin point?

    if yes, does the cone of view always face to the right? (in 180 degrees)

    and if yes ,if i mirror the box will it face left?

    can i assign a specific imagepoint to los?

    from the manual:

    Cone of view

    The angle of the cone of view in which the object can have line-of-sight to other objects, relative to the current angle of the object. For example if this is 180, then the object can have line-of-sight to any objects anywhere in front of it, but never behind it. If 360, the object can have line-of-sight to objects at any angle.

    could someone please help (including me) to add more info to the manual that is severely lacking in small but important things that could help us speed up the process of creating games?

    Tom ashley

    could you implement a way for us users to add info to the manual (wikipedia style) ,and after you guys review it as correct information then publish it? this way the manual will expand at a rapid pace with useful little info and it will take the load off the forums .

  • if i remember correctly the LOS cone will change if you change the angle of the sprite... so if you mirror the sprite the cone of view will mirror too... another fix is to have 2 sprites... the actual sprite of the enemy... ans another one...a small one make it invisible and pin it to the enemy sprite... and have the LOS behaviour on the little sprite... so you can rotate the angle of the sprite and therefore the line of sight cone wihtout affecting the enemy sprite

  • Lunatrap

    thank you for you reply but i have a few questions still unanswered and maybe someone could join the conversation and help.

    since it changes angle (los) according to the objects angle it makes perfect sense for a top down shooter like the example in c2.

    but if you have platform behavior in your square where is the los pointing at (180) during first utilization ?

    up,down,left or right?

    your idea of 2 or even three squares rotating depending on where my other square is going (left or right) so i can have front and rear 180 detection will work (although i believe that there should be a better engine implementation) but if i do not know where it is pointing how can i know how many degrees to rotate for left and right my extra (lol) dummy squares?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Lunatrap

    thank you for you reply but i have a few questions still unanswered and maybe someone could join the conversation and help.

    since it changes angle (los) according to the objects angle it makes perfect sense for a top down shooter like the example in c2.

    but if you have platform behavior in your square where is the los pointing at (180) during first utilization ?

    up,down,left or right?

    your idea of 2 or even three squares rotating depending on where my other square is going (left or right) so i can have front and rear 180 detection will work (although i believe that there should be a better engine implementation) but if i do not know where it is pointing how can i know how many degrees to rotate for left and right my extra (lol) dummy squares?

    i used LOS on platform games... i only make parform games... so everything i tell you i have tested it in a platform eviorement

    the LOS angle will be the same as the sprite wich has it... let me make you a .capx ill be back

  • here!! see if that wworks for you!!!

    if none of the enemies are looking at you you will be red

    if any of them are looking at you you will be green...

    take oin considerection that the distance is 300px wich means that if you go to the righ side... none of the 2 will see you ebcuase you are more than 300px far so they dont see you... the cone of view is 90 for both... you can change it

    test it and tell me if you find anything worng

  • Lunatrap

    thank you!

    after dismantling your brain child (i hope you don't mind!) i figured out for future reference that by default it faces right (o degrees ) from the origin point.so if i want to have left and right detection i should add another square on top of the first one and make its angle 180.

    if you are a boy i owe you a beer if you are a girl a glass of wine and some flowers!

  • Lunatrap

    thank you!

    after dismantling your brain child (i hope you don't mind!) i figured out for future reference that by default it faces right (o degrees ) from the origin point.so if i want to have left and right detection i should add another square on top of the first one and make its angle 180.

    if you are a boy i owe you a beer if you are a girl a glass of wine and some flowers!

    im a girl, and thanks

    you dont have to put 2 squares... with one is enouhg... look ill be back

  • Lunatrap

    thank you!

    after dismantling your brain child (i hope you don't mind!) i figured out for future reference that by default it faces right (o degrees ) from the origin point.so if i want to have left and right detection i should add another square on top of the first one and make its angle 180.

    if you are a boy i owe you a beer if you are a girl a glass of wine and some flowers!

    here CHECK IT OUT n.n

    now the 2 enemies have 2 "cameras" or "eyes" if you will

    and you can change the angle in any direction and the LOS will change aswell (angle of the sprite = angle of the LOS cone of view) if you want the cone of view to be 180 just adjust it in the properties

    btw sorry if my english is not good im not from a country that speaks english

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