mirror of
https://github.com/stevenhowes/GoRetro.git
synced 2026-05-26 15:53:31 +01:00
34 lines
619 B
Go
34 lines
619 B
Go
package GoRetro
|
|
|
|
/*
|
|
* --------------------
|
|
* moverRotator
|
|
* --------------------
|
|
* A simple mover that rotates the container a fixed
|
|
* amount each tick
|
|
*/
|
|
|
|
type moverRotator struct {
|
|
container *Element
|
|
speed float64
|
|
}
|
|
|
|
func newMoverRotator(container *Element, speed float64) *moverRotator {
|
|
return &moverRotator{container: container, speed: speed}
|
|
}
|
|
|
|
func (mover *moverRotator) onDraw() error {
|
|
return nil
|
|
}
|
|
|
|
func (mover *moverRotator) onUpdate() error {
|
|
c := mover.container
|
|
c.Rotation += mover.speed * Delta
|
|
|
|
return nil
|
|
}
|
|
|
|
func (mover *moverRotator) onCollision(other *Element) error {
|
|
return nil
|
|
}
|