How to make Battleship! Berkian Style! 🚢 Difficulty: 3/10

Welcome back to another guide, today, we’ll be recreating the game Battleship! :ship: :exploding_head: Let’s get into the guide!


Making the Board

The first thing we need is the board, where you set up your ships! For this, if you’ve played the game before, you know it’s a letter to number grid, like A1, B7, 10J, stuff like that. For now, for your sake, we’ll make a 3 by 3 grid, A to C, and 1 to 3. Add the buttons accordingly.
image
Then, you’ll want to make a trigger below each button.
image
Then, make a barrier (grey, no collision, 1 transparency, not visible on start), then wire each trigger to the barrier

Triggered -> Activate Barrier

What this does is when you run over the trigger it activates the barrier, as if you’re setting down your ship.

Then make another barrier (red, no collision, 1 transparency, not visible on start). Now, this barrier appears on a channel. For example, on button A1, it’s barrier will appear on A1wasHit, B2 button, their barrier appears on B2wasHit and so on. For the button, have their display value be their position, meaning A1 buttons display will be A1. Wire each of the buttons to a different trigger.

Button clicked -> trigger

I’ll explain the block code sooner on, since there’re two options to choose from.
Then make a notification that appears when it’s respective button is pressed. For example, an A1 buttons, when clicked, while send a notification saying ‘A1 was chosen to be attacked’. Understand? Then make another barrier (white, no collision, 1 transparency, not visible on start), these are the miss barriers. You know how a battleship has two sides, one side is for your ships and the other is the sonar board, where you put your pieces? Yeah! Put the white barrier in that section. Like this!


Once again, the barriers appear on a broadcast, in this case, for your barriers, A1wasAMiss, and for the enemy, A1EnemywasAMiss. Keep the barrier that activates on A1wasAMiss on the enemies side and A1EnemywasAMiss on your side, we do this because your tracking the other player’s board, if that makes sense. Also, you have to copy the red barriers also onto the white barrier, and once again, the enemies barriers on your side, and your barriers on the enemies side, confusing?

Great! Now copy the entire thing, since battleship is a two layer game. So far, the only change you’ll have to make is that for the enemies barrier, have it appear on A1EnemywasHit. So far, that’s all you need to know about this section!


Calling Hits and Misses

Remember earlier how I said that I would explain the block code of a trigger later? I’m going to offer you two options on how to call hits and misses.

Manual

Oh! so you choose Manual! Looks like your against the robot revolution! Anyways for this, those triggers I talked about? First, make a property called locationOnBoard, make sure it’s text and don’t give it a default value. Also, remember those triggers that were wired with the button? Yes! Now, in the code, for each respective trigger, write this,

set property: locationOnBoard
set value: text 'A1'

I said respective because you’ll need to change the value for each trigger. For example, this block of code was for a trigger that connected with the A1 button, however, a trigger connecting to B5, they will update the property as ‘B5’. Now for the code! Since this is manual, we have to create something that the player needs to click for the system to work, we could make a chat system, or just buttons, triggers, whatever you wish. I don’t care. But for one of them, they needed to broadcast on ‘hit’ and the other on ‘miss’. Then make a pop-up that sends on ‘hit’, make a blockcode that triggers on ‘hit’ and add this code.
image
image
image
What this does is that it first of all, sends a notification saying it’s a hit. Now, for the if statement, I honestly got confused about this, because earlier I ran a debug on this and I got 3 for the number of occurrences of ‘Enemy’ in the property, even though I clicked the ‘Enemy’ button once. However, 3 was the number of buttons I had on ‘Enemy’ side, so it somehow identifies that, and the reason we WANT it to is that we want to broadcast on a channel respectively. I’ll explain in deeper concept later. Anyways, when it checks about the Enemy occurrence, if it’s greater than 0, then it identifies it as the ‘Enemy’ board, so it concatenates the first 2 letters of the property, for example, A1Enemy and then mushes it together with the ‘wasHit’ to get A1wasHit, huh? Just like our barrier from earlier! Also, if there was no occurrence, meaning that the attack was issued from the other side and not the ‘Enemy’ side, then they do the same thing, except mush it with EnemywasHit, also the same for their barrier! Now, just a warning, collecting the first 2 letters of the occurrence will mean that in original Battleship games, the number extends all the way to 10, but along with a letter, that would make 3 letters. A fix for this which I discovered much later was to have set the property as A01. With a 0 before the single digits, then change the sub string to 1 TO 3, then you can add the 10. Do the same thing except change the code to work on ‘miss’. And now you can manually make a hit and miss just by pressing a button!

Automatic

Oh! So you decided to go automatic eh? Great! For this, make sure you don’t have a locationOnBoard property, but instead, make individual properties for each of the buttons. For your side, name them like A1 Piece Of Ship, and for the enemies side, name them A1Enemy Piece Of Ship. Remember those triggers that displayed pieces of the ship? Well, in the code, have them update their property to their value, for example, the A1 Trigger will update the A1 Piece Of Ship to A1, and for the enemy it would be A1Enemy for their property. Now, you know the triggers that are triggered by the button? Well put this in the code!
image

What this does is that it checks the length of the property, and if it’s greater than 0, that means a ship was put down there and then broadcasts A1’s hit barrier, which shows it’s hit, but if it’s = to 0, meaning that a ship was never put down, it would boradcast on A1wasAMiss, making the white barrier appears, showing it was a miss.


Problems with this

The only thing is that it just might be a pain to personally change each of the properties in each of the triggers, but it still works! But I think that’s it, if there’s a bug or something I missed let me know! Logging off Friends Of Berk!


Also, I think I just beat ClicClac at making battlehship.
image

Should I make a Guide on Clue?
  • Yes
  • No
0 voters
14 Likes

Wow. You make really great guides. Anyways, I’ve seen that you typed en3my a bunch of times.

You know how to bypass the 20 char limit? With the <stuffButNotNumbers> thingamabobs? If you put those in the middle of the words, like this en<m>emy, this is the result: enemy

So I think that would improve readability. Once again great guide!

7 Likes

Oh wow! Thanks, I’ll try that! :smile:

It worked! Thanks so much!

6 Likes

Nice guide! Dude I wish I had my likes. Then I’d like this topic.

6 Likes

Woah! I forgot, vote on the difficulty!
(there’s another poll at the end of the guide, do check it out)

4 Likes

likes
ran out too mate

6 Likes

Magnificent guide! turning my favorite game into gimkit?? That’s the good stuff.

5 Likes

You talking about runnin’ out of likes?

Trust me. I’ve been there.
image
image

7 Likes

Really? Ah thanks!

2 Likes

After clue, make sorry pls.

2 Likes

I would but…

4 Likes

gtg bye! I have to study!

2 Likes

Hey! It’s free real estate if you put Improved in the title and combine it with ____Land!

3 Likes

Ooh nice guide

I’ve also been there lol
IMG_1439

7 Likes

Still need more voters for the poll!

2 Likes

Wait…
I turn around for 20 days and you now have lore…

LORE BUT MORE

Under the thick veil of night, a sleek, shadowy figure slices silently through the air. The night fury—cloaked in black scales that shimmer like liquid onyx—glides effortlessly above the Viking settlement below. Berk, it’s called, and has been called for seven generations. A hardened isle of fierce warriors who boast strength and valor, but none have ever faced a be@st like him. They cower in fe@r at the mere whisper of his approach, and the dragon revels in their weakness. His nostrils flare in silent amusement, smoke trailing as he descends, eyes locked on one of the towering flame torches that stand as Berk’s proud beacons.

Just as he narrows in, a sudden rush of air—too late—! He hears the low hiss of something cutting through the wind. Before the night fury can react, a heavy net rockets toward him from the right, slamming into his body. It tangles around his wings, tightening with each frantic movement. His roar of outrage and dread shatters the stillness, and with a thundering crash, he spirals to the ground, smashing through trees and rock, the earth shaking with his impact.

Consciousness fades. Darkness envelops him.

Minutes later, he awakens, every muscle tensed and burning with pain. A sharp sting radiates from his tail, but worse yet—he cannot see. Bound, blinded, and enraged, the night fury thrashes against the net, his powerful jaws snapping at the air. Panic starts to creep in when, without warning, the atmosphere shifts. Ahead of him, the fabric of reality seems to tear apart—a swirling white portal forms in the air, humming with strange energy. Through the portal steps a small boy, utterly out of place in this grim scene, his eyes gleaming with excitement.

“Perfect!” the boy exclaims, voice ringing with a strange authority. “Come with me. I have something cool to show you!”

Before the dragon can react or unleash his fury, an invisible force seizes him, lifting his bound form effortlessly into the air. His body, once an unstoppable force of nature, now floats helplessly behind the boy. The portal beckons once more, pulling them through with a blinding flash.

On the other side, everything is stark, surreal. A pristine white room, devoid of features save for a solitary computer resting on a desk. The screen glows an eerie purple, large white letters on display: Gimkit.

“Here’s your account!” the boy chirps, oblivious to the dragon’s confusion and fury. “Use it for the best of purposes!”

Before the night fury can piece together what is happening, the strange magic overwhelms him. His mind reels, body drained from the relentless struggle. His vision swims, and consciousness slips from his grasp. Darkness claims him once more.

When he awakens, it’s not to the sterile white room, but back in the rough, cold earth. He can feel the weight of the net still tangled around him, his tail throbbing. Above him stands a small, skinny Viking, trembling hands clutching a gleaming kn!fe, its sharp edge catching the faint moonlight. The Viking raises the blade, hesitating, wavering. His eyes betray fe@r, not just of the dragon, but of something deeper, something within.

In a sudden moment of fragile mercy, the Viking drops the kn!fe, stepping back. He shakily untangles the net, freeing the night fury. Confusion flickers in the dragon’s gaze, unsure whether this is an act of compassion or cowardice. Then, instinct takes over. The sight of the kn!fe, the scent of danger, the sheer vulnerability of his grounded state—it’s too much.

The night fury roars, a sound so fierce it shakes the trees and sends birds scattering into the night sky. His eyes burn with rage and terr0r as he bounds away, legs carrying him swiftly across the forest floor. But his wings—injured and bound by his broken tail—refuse to lift him into the air. For the first time, the skies elude him.

Looking back at this experience, from the safety of a crystalline cave, he recalled the sensation of the boy, in every way possible, and longed for better times. Sneeze or something, he couldn’t remember. He had never been so good with English. Draconic was his main language.

Millennia later, a helicopter passes over the ruins of a scorched Viking settlement and wonders what happened there. A passenger notices statues at its base. And a portal, shimmering ever so slightly oncemore.

BTW I voted. :grin:

2 Likes

Amazing lore!
(But a bit to long for my About Me section) :sweat_smile:

1 Like

My likes are back! Topic liked…

1 Like

I just saw the poll votings after like weeks,


:rofl:

Well, just so you know, it’s in development.

1 Like

:anchor:

Bump

1 Like