Advertisement
Guest User

Untitled

a guest
Mar 28th, 2020
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 0.78 KB | None | 0 0
  1. interface Movable {
  2.     fun move(dx : Int, dy : Int)
  3.  
  4. }
  5. abstract class GameObject (var x: Int, var y: Int)  {
  6.     abstract val image : String
  7.     fun isIntersect (anotherObject: GameObject) : Boolean {
  8.         // realisation
  9.     }
  10.  
  11. }
  12.  
  13.        
  14. class Player (x: Int, y: Int) : GameObject (x, y), Movable  {
  15.     override val image: String = "man.jpg"
  16.  
  17. }
  18. class Box (x: Int, y: Int) : GameObject (x, y), Movable  {
  19.     override val image: String = "box.jpg"
  20.  
  21. }
  22. class Wall (x: Int, y: Int) : GameObject (x, y)  {
  23.     override val image: String = "bricks.jpg"
  24. }
  25. class BoxFinalPlace (x: Int, y: Int) : GameObject (x, y)  {
  26.     override val image: String = "circleonflor.jpg"
  27. }
  28. class EmptyPlace (x: Int, y: Int) : GameObject (x, y)  {
  29.     override val image: String = "flor.jpg"
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement