Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- interface Movable {
- fun move(dx : Int, dy : Int)
- }
- abstract class GameObject (var x: Int, var y: Int) {
- abstract val image : String
- fun isIntersect (anotherObject: GameObject) : Boolean {
- // realisation
- }
- }
- class Player (x: Int, y: Int) : GameObject (x, y), Movable {
- override val image: String = "man.jpg"
- }
- class Box (x: Int, y: Int) : GameObject (x, y), Movable {
- override val image: String = "box.jpg"
- }
- class Wall (x: Int, y: Int) : GameObject (x, y) {
- override val image: String = "bricks.jpg"
- }
- class BoxFinalPlace (x: Int, y: Int) : GameObject (x, y) {
- override val image: String = "circleonflor.jpg"
- }
- class EmptyPlace (x: Int, y: Int) : GameObject (x, y) {
- override val image: String = "flor.jpg"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement