-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4f8e2f5
commit 9dadf7c
Showing
91 changed files
with
4,289 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package GameObjects; | ||
|
||
public class Collectable extends GameObject { | ||
public boolean isCollected = false; | ||
private static int sensitivity = 0; | ||
private static int difficulty = 10; | ||
public boolean doesCollect(Packman packman) { | ||
if (isCollected) {return false;} | ||
if ((packman.x >= this.x - size + difficulty && packman.x <= this.x + size - difficulty) && | ||
(packman.y >= this.y - size + difficulty && packman.y <= this.y + size - difficulty)) { | ||
if (!isCollected) { | ||
action(); | ||
} | ||
isCollected = true; | ||
this.initializeImage("none"); | ||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
public void action() { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package GameObjects; | ||
|
||
import javafx.scene.control.Label; | ||
|
||
public class Energy extends Collectable { | ||
Packman packman; | ||
Label label; | ||
|
||
public void setLabel(Label label) { | ||
this.label = label; | ||
} | ||
|
||
public Energy(Packman packman) { | ||
this.packman = packman; | ||
initializeImage("book"); | ||
} | ||
|
||
public void setPackman(Packman packman) { | ||
this.packman = packman; | ||
} | ||
|
||
public void action () { | ||
packman.setSecured(); | ||
initializeImage("none"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package GameObjects; | ||
|
||
public class Food extends Collectable { | ||
|
||
public Food() { | ||
initializeImage("food"); | ||
} | ||
} |
Oops, something went wrong.