# How to Make Connect 4

Goals: Make a Connect 4 Game that you can actually drop on each column, There’s no way to take 2 turns in a row, and every combination of four in a row gets you a win. (Warning:This will eat up a ton of your memory. In the screenshots I will be at 100% or close, but that’s after building the entire thing and with several other memory-taking builds in my map.)

Step 1: Looks

Make a 6x7 grid of tiles, each with one tile in between them, 6 on the side, 7 on the top, like the actual game connect 4. This can be any material. I suggest picking something blue because it will make your map look more like the original game.

Now for the barriers. This will take a while.
Make a barrier about the size of one tile, keeping the yellow color the same. Make it not active on game start and deactivate on Reset4. Make it have no collision and no border as well, and transparency 1.00. You can make it circle if you want it more like the real game, but I made mine rectangles.
Now overlay one of these on each square.
Now the boring part. Go into each square and make it activate when receiving on Sq#r#-1. The first # is what Square number it is. The top square is square 1, and the bottom is square 6. The second # is for the “row” number. (Yes, I know that they are actually columns.) So the 4th Square down in the fourth row would be Sq4r4. The -1 after it is for which team drops on the row. -1 is team 1, and -2, which will be on the red barriers, is team 2.

After you have made each square activate on Sq#r#-1, make Copies of each row and change their color to red R:255, G:0, B:0, and change their channel to activate on to a -2, not -1. everything else stays the same.
Now, put the red barriers over their corresponding yellow barriers, and make both of those on top of your grid of terrain. You should now have 2 barriers, 1 red and 1 yellow over each spot on the grid.

Once that is done, it’s time for the mechanics.
Step 2: Game Mechanics

So now we have to make the buttons where you can drop on the row.
Make this:

All the buttons should say drop on this row and broadcast on turn when clicked. It needs to be the same message for each one. Then change all the buttons to the smallest size “hitbox”. Wire each of them to a tigger. (You can use channels if you want to decrease memory.)
The buttons should all be not active on game start except for one of them. The button that is active on game start should deactivate on Sq6r#.
(You will be making one of these for each row. Replace any #'s with the row you are doing. I am doing 7 in the pictures.)
Then put the green button at the top of the row and all the orange ones (not active on game start)
below it. Then make the button below the green one activate on Sq6r#. Make it deactivate on Sq5r#. Then follow this logic down the row. For example, the next button should activate on Sq5r# and deactivate on Sq4r#.
Once you get to the last button, make it activate on Sq2r# and deactivate on Sq1r#.
Now for the triggers. Make this in the last button. (Make all the r7s in r#s, # being whichever number row you’re doing.)

All the triggers should have the same code, just substituting the Sq1r7 for whichever channel the trigger’s respective button deactivates on. So if the button deactivates on Sq4r5, in the blocks both of the text blocks should say Sq4r5.
Do the above until you have a button and trigger for every single square in the grid. Make sure to keep them organized by row.
Now condense the rows of buttons and triggers using grid snap, so they look like this:

Make the each section above their respective rows.
(If any of this is unclear of too hard, please remember to comment!)
Now make a turn taker using this tutorial.

Make one of the spots you teleport to inside the board, and one in a room outside the board, and make the two pieces of text wired to two triggers that trigger on turn. (No collision, invisible.)

Step 3: Winning

I made my system so that when a player wins the game, it ends. It is possible to make it so you can play multiple games but I did not have very much memory left, and it requires lots of inventory managers to do.

Way 1: Game Ends on Win

Make a repeater that’s wired to a lifecycle, (no change) that repeats every .5 seconds and when task runs broadcast on check. Then make 14 checkers that check when receiving on check, with 5 checks, and any check may pass. When check passes, transmit on Reset4.

Now for the checks. You will need a separate check for every single item besides consumables (shield cans and med packs) and shooters (P.M.L.s, Zappers, Evil Eyes, etc.). This should require 14 checkers with 5 checks each and one checker (Same settings) with just one check. The last item should be yellow seed.
Now, place an end game device and make it end on Reset4. Make a property called score that the game scoring tracks.(change it in map settings to a property.) Make this property team scoped and number value.

Now, make a trigger, no collision, not visible in game as all the triggers should be, and make it trigger on Reset4. Connect this to the property so that when it triggers, the property updates.

Way 2: Game Resets on Win

Make a repeater that’s wired to a lifecycle, (no change) that repeats every .5 seconds and when task runs broadcast on check. Then make 14 checkers that check when receiving on check, with 5 checks, and any check may pass. When check passes, transmit on Reset4.

Now for the checks. You will need a separate check for every single item besides consumables (shield cans and med packs) and shooters (P.M.L.s, Zappers, Evil Eyes, etc.). This should require 14 checkers with 5 checks each and one checker (Same settings) with just one check. The last item should be yellow seed.
Make a property called score that the game scoring tracks.(change it in map settings to a property.) Make this property team scoped and number value.

Now, make a trigger, no collision, not visible in game as all the triggers should be, and make it trigger on Reset4. Connect this to the property so that when it triggers, the property updates.

Now make an inventory item manager for every item, consumables and shooters exempted. Make them clear on Reset4.

Step 4: Item Granters. This game runs on the idea that every combination of 4 in a row has an item assigned to this. (Thanks @ClicClac for this concept. See his tutorial on Tic-Tac-Toe.)
However, there are actually not enough items for every combination. So, you need to make three of these:

The top 4 should transmit on count1 when triggered, be invisble and not trigger on player collision, and have the following settings:
Trigger 1- trigger on Sq4r4
Trigger 2-trigger on Sq3r5
Trigger 3-trigger on Sq2r6
Trigger 4-trigger on Sq1r7
The counter should be invisible in game, increment on count1, and have a target of 4. The wire should be when target reached, trigger, and the trigger wired to the counter should broadcast on Reset4 when triggered.
Do this 2 more times but with count2 and count3.
The top 4 triggers for each are below.
Count2:
Trigger 1- trigger on Sq4r2
Trigger 2-trigger on Sq3r3
Trigger 3-trigger on Sq2r4
Trigger 4-trigger on Sq1r5
Count3:
Trigger 1- trigger on Sq4r3
Trigger 2-trigger on Sq3r4
Trigger 3-trigger on Sq2r5
Trigger 4-trigger on Sq1r6

Now the only thing missing is the item granters. I will be making a seprate tutorial on this to be linked below as soon as I finish it, but I can’t make 2 drafts at once for some reason.
Link will be here once I make it.
(Item Granter System (For connect 4.))

14 Likes

This is a really great guide thank you so much for making it.

Wow this was Good!

10/10

I would have liked a few more pictures though.

1 Like

yeah sorry its hard to get pictures when youve already built it and memory’s at 99% lol

Also does anyone know how to make a difficulty poll?

its ok I understand.

Click on the gear icon then click on build poll.

1 Like

What difficulty should it be? Poll:

• Difficulty: 0/10🟦
• Difficulty: 1/10🟦
• Difficulty: 2/10🟩
• Difficulty: 3/10🟩
• Difficulty: 4/10🟨
• Difficulty: 5/10🟨
• Difficulty: 6/10🟧
• Difficulty: 7/10🟧
• Difficulty: 8/10🟥
• Difficulty: 9/10
• Difficulty: 10/10
• Difficulty: 11+/10
0 voters

Nice! Looks like someone’s finally going to do it!

You mean @Blackhole927 and @Demon?

1 Like

Yeah, I couldn’t think of the other one’s name.

Yep! A shame it was lost to the deletion of Demon’s school account though.

1 Like

Oh, ok then.

I love the idea of connect 4!

Great guide! Only thing I don’t like is giving an item for each combo (I’m more of a concept than brute force person)… We should try and find a mathematical solution to checking if a player has won.

1 Like

I gave you your 10th like!

1 Like

can one of the regulars edit it to include the link now? I can’t edit it again.