How To Make A Game Like Bomberman

@blackdragonbe Hey could you help me with the limit of the Bombs that can be dropped.
I really can’t wrap my head around it :smiley:

The easiest way is to have an integer “BombsDropped” or something similar that gets incremented when a bomb gets dropped and gets decreased whenever a bomb explodes. Whenever the player tries to drop a bomb, check if that value of that variable is below a certain number (this is the maximum amount of bombs).

Cheers!

The problem is i don’t know how to decrement the amount when bomb explodes.

It’s been a while since I’ve taken a look at the code, but here are some tips to help you on your way:

In the bomb script, add a new public variable, name it owner and make it the Player type.

In the player script, add a new public variable, name it bombsActive and make it the int type.
Add some extra code to the bomb drop method to increment bombsActive and surround the drop code with an if-statement that checks if bombsActive is below a certain value. Also get the Bomb component of the bomb that was dropped and set the owner to be the player that dropped the bomb (bomb.GetComponent<Bomb>().owner = this).

Finally, back in the bomb script, add some extra code to the method that gets called when it gets destroyed: call the owner and decrement its bombsActive variable by one.

Hope this helps!
Cheers!

Hey thanks for the help. I just don’t understand the (bomb.GetComponent().owner = this) part. Where to put it?

That part should go inside the Player script in the same location that spawns a bomb. I’m not sure of the code as I can’t access it at the moment, but it should look something like this:

GameObject newBomb = Instantiate(bombPrefab, transform.position, Quaternion.identitiy) as GameObject;
newBomb.GetComponent<Bomb>().owner = this;

Cheers!

blackdragonbe awesome tutorial.
Could I ask if you could make a 2D Beat’Em Up game tutorial like Teenage Mutant Ninja Turtles or like Double Dragon. If you have some spare time. thanks

I made one in 48h (as quick personal training), taking your tutorial as a first reading :slight_smile:
Two players can share the same keyboard, and it supports up to 4 players if you have xbox controllers :slight_smile:
http://bidule2oo.free.fr/bomberman

That’s pretty cool! Nice job on the overall atmosphere, I like the music and the sound effects. That death animation is awesome!
You should add some sort of UI so the players know what powerups are active and a game over / summary / restart screen.

Be sure to play it with some friends, you’ll be amazed at how good it can feel when you see people playing something you’ve made.

Gamedev on and be sure to share your creations!

Cheers!

I’m a game designer so I don’t make the art myself … I totally ripped off the music and sfx from official bomberman games… so what you like is the genuine sound feel of hudson soft, which is awesome ^^
The textures are from Minecraft, though :stuck_out_tongue:

I agree with you, the powerups need some sort of indication of what they do!

The game lacks a victory screen and the sudden death making the arena smaller at the end of the countdown.

Otherwise, I’m pretty satisfied of the game as it is, considering it simply was a 48h challenge :slight_smile:

@matthogan
This isn’t the right place to advertise and has nothing to do with the tutorial.
I flagged your post.

Hi, really enjoyed putting this game together! I’ve learnt a lot of new things and I like the comments made on the code explaining what each part is doing, really helpful!

The only thing I would like to mention is that whilst this guide is great, if I was to try and piece a game like this without the guide now, I wouldn’t have the slightest idea where to start. This is due to the main game mechanics already being in place and essentially we are just building on them.
This has also made it difficult for beginner like myself to build further on the game on my own (this might just be me, since I am a newbie) so perhaps another tutorial/guide would be handy?

Hey there,

Thanks for checking out the tutorial!

I wouldn’t say the main game mechanics are provided, a simple level geometry with colliders is provided plus the player models and their simple movement script.
You can learn a lot just from taking a look at how it’s all set up and what the scripts are doing. Try replacing the models with simple cubes and play around with the variables and see what happens.

If you want to start with the absolute basics I’d recommend our starter tutorial:
https://www.raywenderlich.com/142603/unity-tutorial-part-1-getting-started

There’s also the Unity Learn site which covers a lot of topics:
https://unity3d.com/learn/tutorials

Have fun!

Thanks for reply!

Maybe i’m just more of a newbie than I presumed haha, I have read through all the scripts and how everything ties together which has helped me gain a better understanding. Ive also worked through all your C# tutorials over the past month (these were great as well btw!). Maybe its just a matter of me trying to learn too much at once haha.

Since my last comment, I have now added a Restart button, and limited the amount of bombs to 3 (though i reckon, i’ve used a long and incorrect method for this haha), I am now gonna attempt to create a power up, so you will be hearing from me soon again im sure hahaha

thanks!

Mark

1 Like

This tutorial is more than six months old so questions are no longer supported at the moment for it. We will update it as soon as possible. Thank you! :]