• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Need help in game bomberman clone

 
Greenhorn
Posts: 6
Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.


 
Greenhorn
Posts: 17
2
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 285
14
Eclipse IDE C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
them good ole boys were drinking whiskey and rye singin' this'll be the day that I die. Drink tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic