Skip to content

Commit 8ce077b

Browse files
committed
Started work on Inventory and Items
1 parent 2580b96 commit 8ce077b

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

src/com/redomar/game/entities/Player.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import com.redomar.game.lib.Font;
1010
import com.redomar.game.lib.Name;
1111
import com.redomar.game.net.packets.Packet02Move;
12+
import com.redomar.game.objects.Inventory;
1213

1314
public class Player extends Mob {
1415

@@ -86,6 +87,8 @@ public void render(Screen screen) {
8687
int walkingSpeed = 4;
8788
int flipTop = (numSteps >> walkingSpeed) & 1;
8889
int flipBottom = (numSteps >> walkingSpeed) & 1;
90+
91+
Inventory.activate();
8992

9093
if (movingDir == 1) {
9194
xTile += 2;
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.redomar.game.objects;
2+
3+
import com.redomar.game.Game;
4+
5+
public class Inventory {
6+
7+
public static int x;
8+
public static int y;
9+
public static boolean open = false;
10+
11+
public static void activate() {
12+
x = Game.getPlayer().getX();
13+
y = Game.getPlayer().getY();
14+
15+
if(Game.getLevel().getTile(x >> 3, y >> 3).getId() == 8){
16+
if(!open){
17+
System.out.println("Open");
18+
open = true;
19+
}
20+
}
21+
}
22+
}

0 commit comments

Comments
 (0)