Forums Register Login
Need help in game bomberman clone
I'm making a clone of bomberman game...I have a problem when try to drop bomb
I use a file text to create Map

I create a map enum for this file:

I want to ask how I check this file text and replace N with B for place Bomb on Map when player click SPACE.

(1 like)
Let's break this down into stages and see what we come up with.

First Stage: Implement Key press.

Do you have a listener method for the space bar key press? Here is the Java documentation on that: https://docs.oracle.com/javase/tutorial/uiswing/events/keylistener.html
i suppose you would load the map into a 2d array and then track the position of the player as an index in the array. create a B at this index when needed. you need to create a whole new 2d array with the B in it because you cannot modify an existing array. use the existing array as input to some method that generates a new one.

This thread has been viewed 884 times.

All times above are in ranch (not your local) time.
The current ranch time is
Oct 22, 2018 06:16:21.