Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop bombs #47

Open
StewartWallace1115 opened this issue Dec 19, 2017 · 8 comments
Open

Drop bombs #47

StewartWallace1115 opened this issue Dec 19, 2017 · 8 comments

Comments

@StewartWallace1115
Copy link
Contributor

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

@ashish2199
Copy link
Owner

ashish2199 commented Dec 25, 2017

@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
Copy link
Contributor Author

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
Copy link
Owner

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

@StewartWallace1115
Copy link
Contributor Author

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

@ashish2199
Copy link
Owner

No worries. You can contribute whenever you find time.

@khan101101
Copy link

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
Copy link
Owner

@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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants