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,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
|
||||
}
|
||||
Reference in New Issue
Block a user