mirror of
https://github.com/stevenhowes/GoRetro.git
synced 2026-05-26 15:53:31 +01:00
Move all engine stuff to GoRetro. Still many interactions between game and engine code that there should not be.
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user