Player - this.myKey = myKey; } public boolean hasLamp(){...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
public class Player { p private int PlayerX = 0; private int PlayerY = 0; private Key myKey; private Lamp myLamp; boolean isDead = false; public void Move(int distanceX, int distanceY) { this.PlayerX =+ distanceX; this.PlayerY =+ distanceY; } public void getLamp(Lamp myLamp){ this.myLamp = myLamp; } public void getKey(Key myKey){
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: this.myKey = myKey; } public boolean hasLamp(){ return (this.myLamp!=null); } public boolean hasKey(){ return (this.myKey!=null); } public int getX(){ return this.PlayerX; } public int getY(){ return this.PlayerY; } public Key key(){ return this.myKey; } }...
View Full Document

Ask a homework question - tutors are online