99Instances2Go's Forum Posts

  • "If player X is equal to Spike X ...

    That is virtual impossible (with the exception of exact grid movements).

    Positions have mostly a (in context to evaluating kinda randomly) fractional part.

    So, 'is equal' has no chance.

  • You cant set the mouse to a position in events.

  • Because the shortest path will always contain only 3 nodes, there is always only 1 shortest path between 2 points ....

    Here a different approach.

    This solution finds a path that contains as much nodes as possible between start and end, with a perception of the shortest path.

    https://www.dropbox.com/s/degglr7bv9w03 ... .capx?dl=0

    Its lighting fast. But can probably still be optimised more.

  • Mirlas, this is not a solution, just an illustration. The loop simulates a very very slow device. 7 fps on my machine.

    Dont do this, okay ? It might help you to see the link between things.

    https://www.dropbox.com/s/y3atcsbxfyvzu ... .capx?dl=0

  • If the rest is perfectly fine, then this is not gonna help at all.

    https://www.dropbox.com/s/an3nxygcorchd ... .capx?dl=0

  • You evaluate turn = 1 ? If so, you set turn to 2, making the next condition, evaluating if turn = 2 ? true.

    Use 'else'.

    if 1 ?

    else

    if 2 ?

    else

    if 3 ?

    and so on.

    Besides this obvious little error, i have no idea what the gamelogic is supposed to do. Sorry.

    (link to the game: https://www.scirra.com/arcade/other-gam ... test-12492)

  • Make 'something' fps independent by using dt is exactly what behaviors (bullet,platform,timers ...) and also 'wait' & and every X seconds do already.

    Same system means same problems when crossing the limits.

    (is 10 fps not a bit to low ?)

    If you want to accurately measure time, use the system expression 'wallclocktime'.

    But even then, you are, well, a little bit screwed. Say it runs at 10 fps. Then 1 tick will be one tenth of a second.

    Or, comparing recent wallclocktime to previous wallclocktime happens every 1/10 of a second. So the error is a average not accumulating dt.

    Still better then an accumulating error each tick, when going lower then 30 fps.

    Sorry if sound confusing.

    But, in the end. It might be better to optimise the game. So it dont run lower then 25 fps. That is the best solution.

    And do you really want to support devices that are not even anymore supported by there manufactures ?

  • If I use "wait 1 second" but the game runs very slow on a slow device, the wait time will not be adapted to game time. Then it will wait 1 second even if the game runs slow.

    Yes, and No. Wait is fps independent until the game reaches the minimum fps. Standard the minimum fps = 30 fps.

    You can lower the minimum fps with the system action: system > Set minimum framerate.

    But, if you do so, most position based conditions (is overlapping/on collision) will fail. As explained in the manual:

    Set minimum framerate

    Set the maximum delta-time (dt) value based on a framerate. The default minimum framerate is 30 FPS, meaning the maximum dt is 1 / 30 (= 33ms). If the framerate drops below 30 FPS, dt will still not exceed 1/30. This has the effect of the game going in to slow motion as it drops below the minimum framerate, rather than objects stepping further every frame to keep up the same real-world speed. This helps avoid skipped collisions due to stepping a very large distance every frame.

    In general, everywhere you need the fill in a value in seconds or something/second, this is fps independent by nature. Timer behavior needs input in seconds, so it is fps independent, to the explained limits.

  • Uh no, instance variables are always personal for that instance.

    Are the towers turrets and do you use 'on shoot' ?

  • You want to hoover with the game in pause ?

    Set the game in pause ....

    When mouse over an object set the timescale for that object to 1 ?

  • Why so difficult ?

    Upgrade the towers. Including an instance variable for damage done by a bullet. Bullet has instance variable damage.

    Right after spawning the bullet set its instance variable to the (up-gradable one) from the tower.

    Compare on impact.

  • You dont want to change the animation for every member of the group every tick, mouse over it or not.

    That logic is flawed and a bit slow.

    Rather do this:

    https://www.dropbox.com/s/v6n920bg2sos1 ... .capx?dl=0

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I suppose the bullet gets destroyed on collision.

    Then just ...

    'Bullet' On collision with 'Sprite'

    'Sprite' pick top

    ...... 'Sprite' destroy

    ...... 'Bullet' destroy