Monthly Archive for May, 2009

[Prototype] RGB ~ Paint the Bullets ~

This was my entry for Shmup Dev Rapid Prototype Development session 1. The rule was to create a shmup game where player cannot fire their own projectiles.

The game is like Ookami + Touhou Shoot the Bullet. Well, the reference in the name should be obvious! Pretty much you use your mouse to draw an area cover enemy bullets. Enemy bullets in the closed area will be ‘painted’ by the color you are using and are manipulated depending on the color. Well, here’s a manual for you!

Download Here ( Mediafire )

CONTROL
Mouse movement     -     Move you character
Left Click                -     Draw
Right Click               -     Change Color
Spacebar/Shift        -      Hold to enter MIX mode/ Release to enter PAINT mode.

How To Paint
- Once any of your color meter is filled (It’ll says 100% on the HUD on the right), you can paint with that color. Right click to cycle between three colors. You can tell which color you’re using from the color of your [Home Circle]

- Press and hold left mouse button to start drawing. You have to move your mouse cursor out of [Home Circle], come back to [Home Circle], and release left button while the cursor is inside [Home Circle]. While you’re painting, the color meter will be drained. If the meter runs out, you will fail to paint that time.

- Once you move your mouse around during painting, you’ll see the markers.  The ratio between the area of your painting and the number of these markers matter. Large area with too few markers will result in failure.

- A successful painting will result in any bullets inside the painting area painted. Painted bullets act differently depending on the color effect, which are the following :
Red    :  Reflect the bullets back
Green :  Turn bullets into Power Star
Blue   :   Slow down the bullets

- If you’re in MIX mode, you can paint the painted bullets with different color to mix color and create new color effect. This will cost 50 powers x Effect Level

Effect Level  1 (Cost : 50)
Red + Green -> Yellow  : Napalm Ball
Green + Blue -> Aqua   : Hyper Power Star
Red + Blue    -> Purple  : Flying Turret

Effect Level 2 (Cost : 100)
Red + Green + Blue ->  White  :  Alpha Blaster

- If you’re in PAINT mode, painting the painted bullets will replace the current effect with a new one.

Power
- Power points affect the following stats
- Your painted bullets deal more damage.
- Your color meter decrease slower while painting.

ETC
-   Defeat the boss with Effect Level 1 and above will turn all the bullets on the screen into Bonus Star.
-   If you paint successfully, you’ll become invincible for about 5 frames

I might turn this game into a full game someday. I still like the idea. Probably change to arena shmup instead of vertical though. Dunno yet :)

Ninja Kame – Main Playable Characters

Finally all three main playable character designs are finished! Here are the character descriptions from left to right. Click on the thumbnail for full version :)

Kamekichi - A bodyguard ninja. Kamekichi doesn’t talk much. He is always cool and calm, observing the situation quietly.  His playstyle is very defensive, having homing attack and wide shots. However, the damage is not so powerful, since they are all spreaded out. His turtle’s shell is as strong as a diamond and he can use it to nullify or reflect enemy attacks.

Kameleo – An assasin ninja. Since he’s a chameleon, he can hide himself with the surroudning and kill the target before they even know it. He can also attack from far away with his tounge, which , beside from being sticky, is very fast and powerful. One powerul thrust can penetrate the victim’s body. Kameleo focus on offense and speed heavily. Hence he can kill enemies very quickly. The downside is that his attack area is pretty narrow. The player needs to align themselves with the enemies while dodging the bullets in order to deal damage to them.

Kamera – A spy kunoichi. She’s an expertise in spying and photo shooting. She integrated herown custom made camera into her gloves, allowing her to take a picture at any angle in any moment. Her arm-cameras can also burst high intensity of light that act as a flashbomb to blind enemies. Kamera uses four magical orbs to aid in her battle. They can help her attack enemies from the blindspot, while she is safe, taking pictures. Her playstyle is pretty tricky since her magical orbs formation will change according to the elmental you choose.

How to make a bullet hell shmup in Game Maker” Chapter 1: Getting Start and the main game GUI

“How to make a bullet hell shmup in Game Maker”

Chapter 1: Getting Start and the main game GUI.

>> Download the project used in this tutorial here <<

Introduction

Though this tutorial is mainly for beginner, you are expected to have some basic knowledge of Game Maker. I’d recommend you to read Derek Yu’s Game Maker tutorial for beginner first. Follow his great tutorial up to chapter 2 or 3 should get you ready.

Making your first room

First of all, start Game Maker. I will be using Game Maker 7.0 professional in this tutorial. However, I believe it can be applied to any versions, registered or unregistered.

On the left panel you will see a tree structure. We need to first create a room for our game. This is where our game is going to take place. A room is like a stage or a scene where our game objects will interact with each other and create the actual game.

To create a room, simply right click on ‘Rooms’ and choose ‘Create Room’

Right click on the new room you just created and choose rename because any name is better than room0. Let’s name it ‘init_room’. This will be the very first room that the game enters. Hence its main task is to initialize anything before the game title screen start.

Now click on the setting tab. In here, we can set the room properties. Choose the size to be 640 x 480 and set the room speed to be 60. This is basically your frame per second, and 30 is too low in my opinion.

Save your game and click on run the game in debug mode. You should see a blank window with gray background. On the debug window, your fps should say 60 fps.

Folder Structure

If there’s no problem let’s go to where you save your source file. In order to make this tutorial easier to follow, I’d suggest you to name the folder the same as I did for now. After you got all the concepts you can, and I highly encourage you to, remake the game again with your own naming convention.

Create a new folder called ‘dat’. This will be your main resource folder. So any game resources should be in here

Then inside that folder, create the following folders.

- img

- bgm

Once you’re done. Find yourself a saudio.dll. Or you can just download it here. No matter how you got the dll, place it in the same level your source file is.

So basically your game folder structure should look like this

- Your game folder

- your source file

- saudio.dll

- dat

- img

- bgm

Let’s get back to Game Maker interface. Create another room and call it ‘shmup_room’. This will be the room for our main game. Don’t forget to set the room speed to be 60. Also, you might want to change the background color of this room and the init_room as well. Let’s choose black since it’s pretty common to start a game with a black screen before some swooshy title screen show up. You can change the background by clicking on the background tab, and choose the color to be black. Pretty easy, eh?

Making the main game’s GUI

Things will get pretty complicate from now, but nothing you can’t handle. We will be making a game interface. Something likes this.

First of all, create a new folder call ‘gui’ inside our ‘img’ folder. This will be where we store our gui graphic. To make this tutorial easier follow, you can use the graphics that come with the sample project I have for you at the top. (Those images were taken from Danmakufu, by the way)

Now, all four files, which are frame00 – 03 should be inside the gui folder. Then let’s get back to the GM interface.

It’s time for us to write some script. What we are going to do is to load the images externally. This will greatly enhance your game loading speed. Believe me, it is not fun having to wait 5-10 minutes everytime you debug your game! Don’t worry about your resource files being exposed for now; we can deal with that later :)

In order to do this, we have to do it through scripting. So, let’s start with right clicking on ‘script’ in the left panel and choose create script. Name it ‘load_graphics’ so that we know what script we’re dealing with.

Double click on the script that we just created will open up a script editor. This will be where you write your script. I won’t go into details about syntax and all that jazz. You can read them up in GM help file.

Since the gui frame are separated into 4 parts, but they form just one gui when they’re put together. I think an array variable would make it easier to remember. You can create an array variable by simply type

array_name[array_index] = something

Also, since the graphic can be used by basically any objects. Hence, it’s logical to make it globally known. To do this, we put a keyword ‘global’ in front of the variable name.

All in all, to declare a global array would be something like this.

global.gui_frame[0] = 0

The above code means we assign 0 to the first element in the global array named gui_frame. (Array first element start with 0.)

Now, let’s move on to loading resource externally. Since all our four images won’t be using any transparency, we will use sprite_add instead of sprite_add_alpha.

sprite_add(filename, how many subimages(frames), precise collision?, tranparent?,

smooth?,preload?, xorigin, yorigin)

The words inside the parenthesis, separated by commas, are called ‘arguments’. A function will use these arguments to give us an appropriate result. In this case, to load a graphic and add it as a sprite, we need to know the filename, how many frames the sprite has, what kind of collision checking, will it be transparent, will it be smooth, should it be preload, and the anchor point of the image.

So in the end, our code of loading images externally would be:

//Load Pictures externally. Make game load MUCH faster.

//The arguments are like this

//sprite_add(filename, how many subimages(frames), precise collision?, tranparent?, smooth?,preload?, xorigin, yorigin)

//or

//sprite_add_alpha(filename, how many subimages(frames), precise collision?, preload?, xorigin, yorigin)

//LOAD GUI

global.gui_frame[0] = sprite_add(“dat/img/gui/frame00.png”,1,false,false,false,false,0,0)

global.gui_frame[1] = sprite_add(“dat/img/gui/frame01.PNG”,1,false,false,false,false,0,0)

global.gui_frame[2] = sprite_add(“dat/img/gui/frame02.PNG”,1,false,false,false,false,0,0)

global.gui_frame[3] = sprite_add(“dat/img/gui/frame03.png”,1,false,false,false,false,0,0)

According to the above code, we have created a global array called gui_frame. The array contains four elements, running from 0 – 3, and the elements are the graphic that we externally loaded.

However, script will be no used if nobody is using it. Therefore, we need to create an object that is responsible for calling this script. Right click on the object folder in the left panel and choose Create Object. Name it ‘initGame’ to let us know what this object does.

Now, double click on initGame object to open the object properties window. Click on Add Event and choose Create Event. This is because we want to load graphic at the very beginning.

Move your mouse to the right panel and click on the tab that says control. Under the code section, drag the first paper icon and drop it on the action box. This action is called ‘Execute a piece of code’ and will allow that object to perform whatever you tell it to do. In this case, we will tell initGame to call load_graphics so that we can actually make use of what we have written before.

Next, double click on the paper icon in the Actions box. This will open up another script editor with a window called Execute Code like the following picture

To execute the script you already wrote is really easy. Just type the script name, follows by () and viola! It will go look for your script and execute whatever you have written before.

load_graphics()

Now, after we finish loading the graphic, we don’t want the player to stay here any longer. Hence we have to change the room to shmup_room, where our main game will take place. The function that is used for changing room is called room_goto(roomIndex). In this case, the roomIndex is shmup_room. Hence, our code will be

load_graphics()

room_goto(shmup_room)

Click ok to save changes. And we’re done with the object initGame for now.

We have an object that takes care of the graphic loading; however, we still need an object that is taking care of drawing them. There won’t be anything shown on the screen if no one is drawing them, right? Create a new object, name it oGUIFrame. Open up the object properties window but this time add Draw event instead of Create.

Add an action Execute a piece of code to the Draw event, just like what you did to the Create event of initGame. Now, a simple function used to draw a sprite is.

draw_sprite(image, subimage, x, y)

The function is pretty self-explanatory. I’ll give you the code here and you can play around with the number and figure how things work out yourself :D

draw_sprite(global.gui_frame[0],0,0,0);

draw_sprite(global.gui_frame[1],0,32,0);

draw_sprite(global.gui_frame[2],0,32,465);

draw_sprite(global.gui_frame[3],0,417,0);

Now, we have everything ready. The only thing we need to do now is to place all these objects to their appropriate room. Go to init_room and place initGame in that room. This can be done by clicking on the Objects tab and choose initGame from the bottom left box. You can place it anywhere in the room but I prefer to put it at the first square at the top left ( position 0,0 ) If you see something like this then you’re doing it right.

Then, goto shmup_room and place oGUIFrame in that room, like what you did previously. And then run the game. You should see something like this.

And congratulations! You’re another step closer to complete your touhou game! :D

>> Download the project used in this tutorial here <<