Tag Archives: gamemaker tutorial

Brick Breaker 1GAM Icon

[Tutorial] Game Boy Style Breakout

Goal

I’m cloning Breakout, at a Game Boy resolution, with a Game Boy color palette for two reasons.

  1. To have something to submit to GBJam 3
  2. To fulfill the “Resolution” monthly challenge at 1GAM.

Graphics will be made in Aseprite, coding will be done in GameMaker Studio. Sounds will be pulled from OpenGameArt, because I don’t have time to make them.

History

Breakout was created by Atari in 1976 by Nolan Bushnell, Steve Wozniak, and Steve Bristow. Breakout was created around the concept of trying to make Pong into a single player game. Breakout has been ported to just about every language and system you can imagine, including an actual Game Boy port called Alleyway.

Details

Alleyway Title

Alleyway Title

Brick Breaker Title

Brick Breaker Title

I duplicated the layout of the Alleyway for my GBJam entry. I titled it Brick Breaker. Like my last project, it’s written in GML. No drag and drop methods are used. Some of the code is a little ugly, because I wrote it in great haste. I made a mistake with the timing of GBJam and though it began a week later than it actually did. Because of that, I did not have time to polish the game, or track any sounds in Famitracker.

Alleyway

Alleyway

Brick Breaker Game Play

Brick Breaker Game Play

All the graphics were made by me, in Aseprite, using the Game Boy palette that ships with the software. I obeyed the original Game Boy restrictions on sprite sizes and sprites per line. My graphics are based on, but not a clone of, the graphics from Alleyway.

You can grab the source here, and see a live demo here.

The source is messy, but pretty well commented. Following the comments, it should be pretty obvious how everything works. I may clean this example up one day, but for now, if you have questions, contact me and I’ll answer them ASAP.

 

Share Button
pong

[Tutorial] 30 Minute Pong

Pong is one of the oldest arcade games there is. Pong was released in 1972 by Atari Games. It’s almost old enough to be my dad. I first played Pong when I was about 8 years old. At that point I was very familiar with NES and SNES games, so I was not very impressed with Pong. I had no historical context and didn’t realize that had it not been for Pong, more or less launching the videogame industry, that my precious NES and SNES might not even exist!

Pong was written by one man named Allan Alcorn, as a training exercise to learn how to make games. I’ve recreated it in GameMaker Studio as a lesson in simple GML programming. I use no drag and drop techniques at all in the recreation. Pong is so simple, that this tutorial can easily be followed in 30 minutes.

You can get the source here, and play a live demo here.

All of the scripting is well commented and should be pretty easy to follow. You’ll notice that each room only has one object. I make an invisible master object and have it initialize everything else where I want it. I do that, because it’s more precise than trying to drag objects around in the room GUI (though that GUI is pretty great if you’re trying to make a platform game).

This is the most complicated piece of code in the entire project. It’s located in the ballControlScript script.

//if the ball hits a paddle, have it bounce off.
//Determine the angle by where the ball hit the paddle.

if(place_meeting(x,y,playerPaddleObject))
{
direction = radtodeg(arctan2(playerPaddleObject.y – playerPaddleObject.y, playerPaddleObject.x – (playerPaddleObject.x – 50)) – arctan2(y – playerPaddleObject.y, x – (playerPaddleObject.x – 50)));
speed++;
audio_play_sound(beep, 10, false);

} else if(place_meeting(x,y,enemyPaddleObject))
{
direction = radtodeg(arctan2(enemyPaddleObject.y – enemyPaddleObject.y, enemyPaddleObject.x – (enemyPaddleObject.x + 50)) – arctan2(y – enemyPaddleObject.y, x – (enemyPaddleObject.x + 50))) + 180;
speed++;
audio_play_sound(beep, 10, false);
}

In the original Pong, the paddle was broken up into 8 sections. Which section the ball hit on the paddle determined what angle it would bounce off at. I was capable of a smoother system. The script above uses some trigonometry tricks to make a triangle between three points. The ball. the center of the paddle and a point 50 units horizontally behind the paddle. I calculated the angle based on that. You can adjust how sharply you can return the ball by making that 50 a smaller number.

Share Button