Wednesday, 10 September 2014

Using a 2D Game Engine

This task must include an understanding and playable 2D level to industry standards using the Game Maker engine. Evidence for this task should also be accompanied by an extensive 2D workflow that showcases the ability to adhere and develop to industry level standards.


You will need to produce a short desktop captured video to evidence your 2D game in play.

Video of initial game



Video of finalized game




Below is my workflow for my developed 2D game, in which I created a 2D game following turtorials before editing it to make it more unique and identifiable to myself.

Level Design Workflow/Production Log

My first step in my 2D project is to create a 2D game using simple methods and assets within Gamemaker. I will have the assistance of one of the colleges IT technicians tutorials to guide me on my way. Once I have created a basic game following tutorials I will then go on to alter some aspects to make it more unique and identifiable to myself.  

Initial idea and progress 
Below you will find my progress made by following tutorials and practicing Gamemakers features as well as my production of an initial 2D game. 
Game set in space with various different assets and appealing effects. The player controls a spaceship progressing through the game taking on different enemies while competing to survive. Made using gamemaker with 2d assets such as sprites.  
Planning and Execution 
By the end I my project I want to complete a fully working game by using videos on YouTube for reference in order to make sure my game runs smoothly without any problems or issues. I will review my work often and test it as often as possible to make sure there are no flaws or unintended outcomes within the creation and finalisation of the game production, so I can ensure that my final outcome is of a high, working standard.  
ImageImageImageImageI will use the following sprites and assets in my game, for aspects such as players and animations. 

 Sketch a rough visualisation of the idea, add in your own parts that might flesh out what you are trying to achieve, this will be the “Overview” map of your design, where will the player interact with the environment, etc. 
The first stage of my game is to make the insert the simple assets such as the player sprite and modify its properties to fit into the game. I did this by inserting my sprite game file into the game and opening up the properties to alter the origin and collision of the sprite in the game. 










Next I had to add keyboard controls to my game, so the player can interact with the player sprite. To do this I had to enter code relevant to the player sprite in order for the player to be able to interact with the game and move around within gameplay, to do this I entered commands relevant to the keyboard, linking actions to keys, for example: the key W will make the player move upwards and the S key allows the player to move downwards when pressed.  
The next stage in this process was to make a room asset for my game which is the main level. To do this I had to set the dimensions for the level, which I set to 1024 by 576 as it is the perfect dimensions for my game.  
Next I added the player object to the game so the player can control the game.  











I ran the game to test if the character moved when prompted by keyboard controls.  











The next step was to set the movement limits so the player does not leave to border of the game.  









I had to ensure that if the player held the up, down, left or right key, that when they reached the border of the game, they will not go out of the in game view.  










The next step was to create a scrolling background for my game, so the screen will follow the player character. I added two backgrounds, one in front of another in order to add depth; I did this by creating two backgrounds and saving them as PNG before importing them into the engine. 











In this next stage, as instructed I added animation to the main player sprite, in order to make it appear more attractive and interesting.  
Firstly I added a thrust to the back of the sprite using the engines particle system.  
I entered the first part of code to create the particle system for the jet object: 
///Jet particle system 
jet1 = part_system_create(); 
part1 = part_type_create(); 
part_type_sprite(part1, thrust_spr, false, false, false); 
part_type_size(part1, 0.5, 1, -0.1, 0); 
part_type_life(part1, 300, 300); 
part_type_gravity(part1, random_range(0.5, 2), 180); 
part_type_alpha1(part1, random_range(0.1, 0.75)); 
part_system_depth(jet1, 2); 
part_particles_create(jet1, player_1.x-18, player_1.y, part1, 10); 


I then entered the second smaller part of code to the player object to create attach the particle system to the player sprite: 
///create jet object 
instance_create(x, y, jet); 
I ended up with the thrust objects coming out of the player sprite as intended: 











I then added the laser object to the main player sprite, so the player can destroy enemies sprites.  
I then added the enemy sprite with animation; I did this by inserting 8 different png’s to create the animation for the enemy sprite and then entering the relevant code.  



















Once I had imported the enemy sprite and object into the game I had to create the lazer objects for the game so both the player object and enemy object could fire at each other deducting health from the player and destroying the  enemy sprites. I also enabled sound to play when the enemy lazer nd player lazer objects were fired from the player and enemy objects using the following code. 
///movement & sound 
hspeed = 20; 
audio_play_sound(zap1, 1, false); 
///move toward player 
if instance_exists(player_1) 
{ 
move_towards_point(player_1.x, player_1.y, 15); 
audio_play_sound(zap2, 1, false); 
} 
I then added the explosion sprite to both the player and enemy object so they would trigger when either object is destroyed. To do this I had to add a create event, alarm event and a step event to either object with the following code.  
Code for enemy: 
create: 
alarm[0]= 5; 
audio_play_sound(blast1, 1, false); 
alarm: 
instance_destroy() 
step: 
///explosion particle system 
explosion = part_system_create(); 
part2 = part_type_create(); 
part_type_sprite(part2, explosion_spr, true, true, true); 
part_type_size(part2, 0, 2, 0, 0); 
part_type_life(part2, 3, 8); 
part_type_gravity(part2, random_range(0.5, 7), 360); 
part_type_alpha1(part2, random_range(0.1, 0.75)); 
part_particles_create(explosion, x, y, part2, 20); 
Code for player: 
create:  
alarm[0] =60  
audio_play_sound(blast2, 1, false)  
alarm:  
instance_destroy()  
room_restart()  
step  
///explosion particle system  
explosion_2 = part_system_create();  
part3 = part_type_create();  
part_type_sprite(part3, explosion2_spr, true, true, true);  
part_type_size(part3, 0.5, 2, 0.3, 0);  
part_type_life(part3, 30, 60);  
part_type_gravity(part3, random_range(2, 7), 360);  
part_type_alpha1(part3, random_range(0.1, 0.75));  
part_particles_create(explosion_2, x, y, part3, 10); 

Lastly I had to add a health bar and a score to the game, I did this by using code to add 1 score every time the enemy object is destroyed.  
I did this by telling the engine to draw the shield and score on screen using the following code. 
///shield 
globalvar shield; 
shield = 100; 

///score variable 
globalvar points; 
points = 0; 

///draw shield 
draw_rectangle_color(32, 32, 32+global.shield, 40, c_red, c_red, c_red, c_red, false); 

///draw score 
draw_set_font(font1); 
draw_set_color(c_white); 
draw_set_halign(fa_center); 
draw_text(36, 40, global.points); 

This code lead to the score and health for the player being visible on screen: 
Final Testing 









After completing this initial game with help from tutorials, I then went on to test it, everything was perfectly in order and their were no visible issues. 
I am very happy with the initial game I have created, I have followed instructions carefully and have created a good standard of product, with some slight alterations to the background and sprites. 
Now that I am more familiar with Gamemakers tools I will continue to make the game more unique to myself and alter certain aspects. 



Final product workflow 
Using the game I have just finished making, I am now going to alter certain aspects to make it more unique and appealing, as well as making it identifiable to myself. Below is a list of alterations I am going to make. 
I am altering the: 
Sprites 
Background images 
Music 
By doing this I will make the game noticeably different to the one I have just created following tutorials.  
First I created new background images. I am using two separate images that will travel at different speeds to create depth and increase the overall appeal to the game. 
Below are the two images. The image with the planets will be set at the back going at a slower speed that the front image, which is the mountainous area which will have the black area amongst it erased.  

I have imported these images into my game as you can see below. 

Next I am adding a new sprite that the player will have to avoid hitting, as I have altered the setting to decrease a point from the players total score when this particular sprite is shot and destroyed. The sprite is split up into two individual images that form an animation replicating a flame fueled thruster to the rear of the bus sprite. 

As you can see below, the players score is at a minus, due to hitting this bus. This makes for a more challenging aspect of the game. 
Next I am altering the colours of the attacking enemy sprites and the player sprite along with its thruster, as to make them fit better with the colour scheme.  
Player sprite with alterations is below. 
Thruster sprite alterations are below: 
Enemy sprite alterations:  
Lastly I am adding a music track to my environment. I am doing so to add more of an entertainment value to my game.  
I did this simply by importing the track as a .wav file and completing the relevant code to allow the track to play continuously. 
The track have chosen to include is a free open source track I found online. 
Below you can see the implementation of the relevant script, that allowed me to enable the music track to play upon launch of the game.  
Here is the code in plain text as well. 
audio_play_sound(sound5, 1, false);  

I have now complete my 2D game, I am extremely happy with my progress and I have created a very appealing game. Below this workflow you will find the initial game I created using tutorials and the edited version.   





No comments:

Post a Comment