ashish2199 / Aidos

A beginner friendly project with aim of creating our own version of Bomberman.
GNU General Public License v3.0
41 stars 27 forks source link

Drop bombs #47

Open StewartWallace1115 opened 6 years ago

StewartWallace1115 commented 6 years ago

What class and method should I add the drop bomb command to? Also, how do I use the bomb sprite?

ashish2199 commented 6 years ago

@StewartWallace1115 image The current sprite sheet that we are using has these 3 images for the bombs. You can use these to make a animation for the bombs. If you any other better images, you can add those two as long as they look good with current graphics.

At present there is no class suitable for creating sprites for bombs. I would recommend you to create a new class called BombAnimations in bomberman.animations package.

You can make a sprite for them similar to how I have created sprite for dying animation of the player. Just replace the coordinates of the rectangles with X,Y, height and width of the images of the bombs.

List specs=new ArrayList<>(); specs.add(new Rectangle(149, 0,20,21)); specs.add(new Rectangle(179, 1,19,20)); specs.add(new Rectangle(118, 30,21,21)); specs.add(new Rectangle(149, 30,20,21)); specs.add(new Rectangle(179, 30,19,21)); specs.add(new Rectangle(118, 60,21,21)); specs.add(new Rectangle(147, 60,23,22)); die = new Sprite(e,30,playSpeed,img, specs,GlobalConstants.PLAYER_WIDTH+2, GlobalConstants.PLAYER_HEIGHT+2, 2, false);

I feel droping of bombs would require adding code in more than one class and hence I would like to know how you are trying to implement droping of bomb. Then only I would be able to suggest how we can go about it.

In case you need more clarifications do let me know.

StewartWallace1115 commented 6 years ago

Thank you for the information. My plan was to create another if statement in the InputManger class that if the player hits space bar then the player will drop a bomb. The dropBomb() method is in the player class. From there I planned on calling the dropbombanimation. By looking at the information you gave me I need another class. At some point I was planning on adding a timer so after a certain amount of seconds the bomb will explode. I don't know where I should put the timer though. I thought about the dropbomb method in the player class, but I'm not sure to be honest. Let me know what you think and thank again.

ashish2199 commented 6 years ago

I have submitted pull request for the same since you didnt submit one 😛

StewartWallace1115 commented 6 years ago

Sorry about that :(. I got really busy IRL.

ashish2199 commented 6 years ago

No worries. You can contribute whenever you find time.

khan101101 commented 5 years ago

Hello, has somebody implemented a function/class for exploding the bomb? Please let me know as I am also working on it. Thanks a lot.

ashish2199 commented 5 years ago

@khan101101 I have lost track of project, Sorry :( Its good to see that you want to contribute :) From what I remember, the functionality of exploding bomb has been implemented but its very basic and needs more improvement. You can work on it.

khan101101 commented 5 years ago

@ashish2199 well exploding bomb functionality is not implemented yet, I will work on it.