Open StewartWallace1115 opened 6 years ago
@StewartWallace1115
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.
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.
I have submitted pull request for the same since you didnt submit one 😛
Sorry about that :(. I got really busy IRL.
No worries. You can contribute whenever you find time.
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.
@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.
@ashish2199 well exploding bomb functionality is not implemented yet, I will work on it.
What class and method should I add the drop bomb command to? Also, how do I use the bomb sprite?