LittleStain's Forum Posts

  • > There are many ways to go about it but... for the most basic way:

    >

    > What I would do is get the angle from the npc to the player.

    >

    > You can then set the npc frame to round(angle/45). Set frame 0 to be facing east, frame 1 to be facing south east and so on.

    >

    > Does this make any sense?

    >

    Quick code insight, range is a circle sprite pinned to my player object. I use it to detect range as line of sight is useless ^_^

    Here is what I have done http://i.imgur.com/q9AVqRr.png and honestly it is the only way I can think of to actually get this to work. I'm useless when it comes to angles honestly. It works until I added in the part about playing animations, it will not play the animations in the section I highlighted in red... Also if I add in another enemy object only one of them will update. I will need it to update with multiple...

    Can anyone offer insight please? Or perhaps tell me what I am doing wrong.. Any help is greatly appreciated.

    Thanks in advance!

    Ruskul gave you a great answer..

    set a variable on your enemy to round(angle(enemy.x,enemy.y,player.x,player.y)/45)

    if this variable is 0 or 8 set animation to east

    1 = southeast

    2 = south

    and so on..

    instead of your detection sprite you could check the distance between your enemy and player with distance(enemy.x,enemy.y,player.x,player.y)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Construct2 reads events topmto bottom..

    After this event has done it's action

    -> BLOCK variable "state" = "deactive" -> BLOCK MoveTo move to (self.X, self.Y + 64) | Set state to "active"

    this event is automatically true and its actions will execute

    -> BLOCK variable "state" = "active" -> BLOCK MoveTo move to (self.X, self.Y - 64) | Set state to "deactive"

    In this case using an "else" event would solve this..

  • Search for terraria on the forum:

  • Another way would be to clone the player instead of copy it..

    That would mean you'd have to either duplicate player1's code for Player2 or put them both in a family and reference that in the events..

    Events pertaining to either player1 or player2 could always be done by referencing just the correct one..

  • Every object has a UID where the U stands for unique..

  • I'm guessing your client delivered the graphics, so at least that won't be an issue..

    I mean, offcourse you could get them from the export also, but originals are always better..

  • You probably know this already, but for reference:

    When a WebSocket connection is closed without a "close frame", the pusher-js library emits an error with code 1006. Usually this is caused by WebSocket-incompatible proxies, which can't close the connection in the correct way.

    See: https://developer.mozilla.org/en-US/doc ... _reference

  • Changing one of the things that define when your objects are created and where, should solve your issue..

    Try to understand the events and actions..

    What is happening when and why?

  • I use this in objet that need fade opacity : Self.Opacity-(100*dt) and after un wait system 0.3 and destroy object. Is cool when player kill enemy and work very prerry.

    And the reason for bumping a 3 year old thread with that remark is??

  • As you can see, the next platform is created when the variable Nextplatform is bigger than the y-postion of the viewporttop and the players y-position is less than The Minscroll variable..

  • Looks perfect!

    How often are you creating these platforms?

  • I know what AI is, thanks..

    Any answer on why they are leaving the layout?

    Other information that could be usefull:

    What kind of behaviour do they have?

    What kind of events are attached?

    How big is the layout?

    Why shouldn't they leave?

    Would creating a new one outside the viewport be enough if they leave the layout?

    If not, why not?

    Etcetera..

    I mean, you could have them not leaving the layout if you prevent them from moving, but I guess that's not the answer you are looking for..

  • Since the distances are not too big in the original, you must have made changes..

    One of these changes caused the distances to become too big..

    Is there anything you changed that you didn't understand what it was for?

    That might be the place you should look..

  • LittleStain

    1.) Thanks I' ll try it

    2.) On touch conditions is Else disabled.

    Your first post had me believing you were using "is touching", else would have worked fo that..

  • You could add another condition to the "any touch end" event, like "touch is touching object"...

    Right click - add else, for the else event..