Skip to content

type error if timer delay is an integer #14

@ewot

Description

@ewot

The timer crashes with a type error when triggered if the given delay is an integer.

The property Timer._newTick should be a num or the calculated value should be converted to a double when updating it. Or the Timer.add() should take a double and not a num.

To reproduce:

timer = game.time.create();
TimerEvent te = timer.add(1000, () => print("timer called"));

This will crash after 1000ms with: type 'int' is not a subtype of type 'double' of 'value'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions