LittleStain's Recent Forum Activity

  • If you change the animation in the creation event (so before the event is called to destroy when overlapping/colliding) there shouldn't be an issue..

    But I might still not understand?

  • I don't understand..

    You want the black ball to spawn little black balls, where did the white one come from?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You've probably already noticed the admob plugin?

  • Simply attach an action to the event where you create the object:

    event with conditions

    create object ball

    ball set animation

  • Seems like you are drawing with black every tick and only create 1 point at mouse.x,mouse.y while clicking the green sprite..

    If you could remove the green sprite during the program, you'd see the green point you drew below it..

    I guess you'd want a global variable (text) set it to the colour-name you want on clicked sprite and draw with the colour Variable every tick instead of black..

    Both "every tick" conditions in event 1 and event 2 are useless by the way..

    Event 1 is a triggered event so it will only run once when true..

    Event 2 will run every tick its conditions are true, regardless of the every tick condition you added..

  • Have you tried searching the forum?

    I'm sure I've heard this question before..

    You can probably even find it in the FAQ-thread..

  • I guess what I would do is have the sprite spawn another (similar looking) one on touch..

    The second one would have collisions with sprite1 enabled..

    That way you could always leave the sprite1 collisions with sprite1 disabled..

    It would also help getting around the picking nth instance stuff..

  • Dunno if you'll see this LittleStain but here's a tool I found invaluable for testing these values

    quirktools.com/screenfly

    Thanks, I'll have a look..

    When you put in front of the name, in my case LittleStain the user gets a notification..

  • Well, I figured out the issue with it not working past 4, instead of up to 8 you need to go 0-4 then -1 through -4. However, can you still explain to me the most efficient way at layer these events? Be is per tick, or... How?

    Thank you by the way guys for the help so far

    Sorry for that, I wasn't aware the angle(x1,y1,x2,y2) gave negative values..

    If you have more than 1 enemy, I guess this would do:

    for each enemy

    distance(enemy.x,enemy.y,player.x,player.y) < 100

    -- instance variable = 0

    set animation ...

    --instance variable = 1

    set animation ...

    where -- are subevents..

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

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

LittleStain's avatar

LittleStain

Member since 26 Apr, 2011

Twitter
LittleStain has 4 followers

Trophy Case

  • 13-Year Club
  • Email Verified

Progress

14/44
How to earn trophies