tunepunk's Forum Posts

  • So that means 'on created' is not a top level event either? In my previous example function is called in a new top level event (on created).

    So can anyone explain this image then? 1st example rotates correct sprite as expected. 4th example picks exactly the same sprite but does nothing.

    2nd and 3rd example rotates everything but the created sprite.

    From example 1 it's clearly pickable.

  • If i have other sprites on the screen, this example only rotates the ones already on screen on click.

  • > yea, tunepunk is right- on create doesn't include the new objects in any picking.

    > in these events for example, nothing gets rotated:

    >

    >

    Might want to recheck that.

    As is, any instance in the layout already will be rotated.

    Pick all negates the on create pick, and picks everything else.

    Remove the pick all, and all instances get rotated when created.

    So it's a useless trigger if you want to, upon creation pick anything of the same kind, allready on screen and rotate them together with the new one? any workaround?

    Anyway, that does not explain why my function isn't picking the newly created one. The function is clean of any picking at start? and should pick everything right?

  • yea, tunepunk is right- on create doesn't include the new objects in any picking.

    in these events for example, nothing gets rotated:

    Can confirm. Did exactly the same test. Pick All doesn't pick any picked objects. Removing Pick all and they will rotate.

  • I have no idea what that means. It works this way ....

    Some conditon ...

    The create action .....

    New condition 'on created' ....

    Conditions + actions

    The 'on created' picks the newly created object, when it is ready to pick. And then you do with it what you like.

    The 'on created' is a trigger, it does not matter where in the events you put it, as long as it is a root event.

    If this gives you a picking problem (kinda impossible) then you have to be very specific on what you mean with "it still doesn't work". Show the events.

    It most certainly does not work. Everything is picked except the newly created one despite called by a top level event.

    Even if i set the opacity directly in the "on created" everything except the created sprite has the opacity set to 50.

    It seems like the newly created arrowInGround is not in the family upon creation.

  • I would like to suggest "Hoodies" or maybe "Hoodie" which is a combination of hood from Robin Hood and your character designs plus die which is something they will do Keep it up!

    Played around with your idea there, Maybe just hood would work?

  • Made a lot of performance improvements this weekend. Cut the Z ordering CPU usage by approx 70%. And instead of Arrows checking for collisions every tick while in flight I turned off collisions for arrows & changed to use some kind of quick raycast approach, that detects collisions before the shot is fired, and then the arrow just travels to there. Turned off collision detection for players as well. If an arrow is in flight it picks the nearest other player, and if the arrow get within 30px of the player count as a hit. I think I've done all I can performance wise, so now back to polishing up the level UI, and artwork.

  • The function is called b4 the merging.

    Just use the trigger 'On created'.

    If i put on created as a new top level event below it still doesn't work. Maybe if i put on created above? Does the merging happen at the end of the event sheet?

    On created >

    On collision with Sprite2 > Create Sprite

    Run through event sheet - back to top.

  • Nope.

    The only shortcut here is a good memory if it's used already or not.

    Honestly though, I wouldn't really worry about a few vars hanging around - unless you've literally got hundreds/thousands of unused vars, it won't make a grain of sands difference to performance or project size. If it's more of just a case of being tidy for the sake of sanity - then yeah, have fun cross checking everything :/

    ~Sol

    Yeah, it's basically just my OCD kicking in. Haha, I'm not worried about filesize or performance. But it just get a bit hard working after a while because i named them very similar in many cases. posX, Xpos, Xsort, Xvar, objectX, Xtest, testX and all other combinations you can think of. The biggest problem is remembering which was the actual one I was using. Lol.

    So a nice little C2 cleanup functionality would be great. Things like "Delete unused instance variables, delete unused sprires" and things like that.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I had a similar problem calling a function which sorts zOrder after an object was created. The function would sort everything except the created sprite, even though the function picked all. Function is top level event, bug or by design?

    On colission

    -> Create Sprite

    -> call function

    function picks all. sorts z-order.

    did not work. the newly created object is not sorted with the rest.

    On created (new top level event)

    -> call function

    function picks all. sorts z-order.

    did not work. the newly created object is not sorted with the rest.

    I can't get the created sprite to sort with the rest of the objects, even after calling a function.

    wait 0 works but creates ugly unsorted graphics glitch for a fraction of a secondbefore it's sorted correctly.

  • Is there any quick and easy way to clean up unused instance variables? As the project progressed I've created tons of varables for testing purposes. Some sprites and families has loads of them, but are never used. A bit tideous to remove them all one by one by searching the event sheet if it's used or not. Is there any fast cleanup feature i've missed?

  • Bbox is the x and y values of the outer edges of the sprite.

    Keep in mind though that if your sprite is rotated the Bbox will still be at the Outer edge surrounding the sprite.

    If you have a square and and rotate it 45 degrees to something like this shape.. <> then the Bbox will still be a standing square at the edges of the rotated sprite. like this. [<>] hope that helps.

  • every 0.5 seconds

    create sprite at

    x: random(bossSprite.BboxLeft,bossSprite.BboxRight)

    y: random(bossSprite.BboxTop,bossSprite.BboxBottom)

    something like that should work.

  • Good job. Looks nice. Keep it up.

  • I would like to suggest "Hoodies" or maybe "Hoodie" which is a combination of hood from Robin Hood and your character designs plus die which is something they will do Keep it up!

    Thanks a lot. Not a bad idea. I kind of like it. I'll definitely keep that one in Mind.