Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package o1
- import constants._
- class Game {
- val bug = new Bug(new Pos(100,40))
- val obstacles = Vector[Obstacle](new Obstacle(70),new Obstacle(30),new Obstacle(20))
- def timePasses() {
- this.bug.fall()
- obstacles.foreach(_.approach)
- }
- def activateBug() {
- this.bug.flap(15)
- }
- def isLost: Boolean = {
- var kolizja = false
- // for( i <- 0 to 2)
- // {
- // if(obstacles(i).touches(bug)) kolizja = true
- // }
- kolizja = obstacles.exists(_.touches(bug)==true)
- !( bug.isInBounds == true && kolizja==false)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement