• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need help in game bomberman clone

 
tieu phung
Greenhorn
Posts: 4
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.


 
Svetlana Rosemond
Greenhorn
Posts: 17
2
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
S Fox
Greenhorn
Posts: 18
1
Eclipse IDE Firefox Browser Netscape
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!