Untitled

mail@pastecode.io avatar
unknown
scala
a year ago
329 B
1
Indexable
Never
package o1.flappy

import o1.*

class Game:

  val bug = Bug(Pos(100.0, 40.0))
  val obstacle = Obstacle(70, Pos(1000.0, 100.0))
  def timePasses() =
    this.bug.fall()
    this.obstacle.approach()
  def activateBug() =
    this.bug.flap(15)
  def isLost = this.obstacle.touches(this.bug) || this.bug.isInBounds()