Move all engine stuff to GoRetro. Still many interactions between game and engine code that there should not be.

This commit is contained in:
stevenhowes
2022-01-03 22:13:34 +00:00
commit 4d1ab58ca4
19 changed files with 976 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
package GoRetro
/*
* --------------------
* BounderScreen
* --------------------
* A bounder which sets active = false on anything which
* has left the screen
*/
type bounderScreen struct {
container *Element
}
func NewBounderScreen(container *Element) *bounderScreen {
return &bounderScreen{container: container}
}
func (bounder *bounderScreen) onDraw() error {
return nil
}
func (bounder *bounderScreen) onUpdate() error {
b := bounder.container
// If the position is outside the screen bounds then set it as inactive
// and mark for deletion
if b.Position.X > ScreenWidth || b.Position.X < 0 ||
b.Position.Y > ScreenHeight || b.Position.Y < 0 {
b.Active = false
b.Delete = true
}
return nil
}
func (bounder *bounderScreen) onCollision(other *Element) error {
return nil
}