newt's Forum Posts

  • tunepunk

    Don't use a function for new objects.

    It used to work that way, but it was changed at some point.

  • I'm not seeing the delay.

  • Functions are called before the event even finishes, so new objects don't exist yet officially.

  • You have to break picking in the creation event.

    A function should suffice.

    on function, sprite, do fo0

    No pick all.

    Edit:

    Never mind the function, use a global.

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

  • Why, does that have some way of providing a position for my enemy to move to that I've been missing so far?

    That's what it does.

    The problem with the pathfinding behavior is that it makes the object turn to the angle of motion before it moves.

    So basically you would have to split up a circle, and find a path to each point of the circumference.

    That's not hard, but it's incredibly wasteful.

  • Take a look at the line of sight behavior.

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

    Can you find the correct z before the creation and place it then?

  • Omg!

    Thanks

  • Well they are in the middle of making a new editor.

    Let's just hope the lessons learned from the previous ones guide them as well.

    Of course you have to take that with a grain of salt, as that means things like libraries, and etc which may have made things go quicker in development, may be off the table.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Sorry had it reversed.

    lerp(scrollx,player.X+cos(Player.8Direction.MovingAngle)*Player.8Direction.Speed,2*dt)

    lerp(scrolly,player.Y+sin(Player.8Direction.MovingAngle)*Player.8Direction.Speed,2*dt)

  • The trig would be

    lerp(scrollx,player.x+sin(player.angle)*speed,2*dt)

    And

    lerp(scrolly,player.y+cos(player.angle)*speed,2*dt)

  • lerp(scroll.x,Player.x+player.speed,2*dt)

  • The "high speed" part would be the most questionable.

  • int(random()), int(multiplayer.peercount) is googles.

    I would imagine it's already set to only deal with whole numbers.

    No such thing as a fraction of a peer, still, it's better to be safe than sorry.