JohnSundell / ImagineEngine

A project to create a blazingly fast Swift game engine that is a joy to use πŸš€

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Strange behaviour when repeating RotateAction with a delta

mattiashagstrand opened this issue Β· comments

If you try to repeat a RotateAction with a delta the rotation is reset to the original value each time the rotation action repeats. I expected the rotation to continue at a constant rate until cancelled.

Example code:

actor.repeat(RotateAction(delta: 3.14, duration: 1))

I think all that is needed is to add this function to MetricAction:

public override func start(for object: Object) {
    startMetric = nil
}

This is consistent with how MoveAction is implemented.

Hi @mattiashagstrand πŸ‘‹

That's definitely a bug! Do you want to submit the fix you suggested as a PR? πŸ™‚

Absolutely, I will create a PR!

Awesome πŸŽ‰

Hmm, looks like I don't have permissions to create a new branch from master. How can I fix that?

@mattiashagstrand Fork the repo, make a new branch on your fork, then submit it as a PR πŸ‘

Fixed by @mattiashagstrand in #84 πŸŽ‰