1 year ago

#374486

test-img

Jeff

How to implment walls in Maze game in Java GUI

I have an image with walls in it for my little maze game but currently, my player can move around freely meaning on top of the walls. If I want to restrict this free movement with walls, do I have to paint multiple rectangles one by one and align them properly so that they match the walls in my image, and if my player is hitting a certain wall, I would have to make a collision detection check? Or would I need to make a Wall class and create wall objects with methods which can check if they are in contact with the player, can restrict the movement? How would I go on about achieving this?

java

swing

maze

drawrectangle

0 Answers

Your Answer

Accepted video resources