jake hyatt 2d game workflow

19
First I created this simple sprite payer for the 2D game that I am creating because I am personally not good at designing characters on this software (game maker). I also only did a simple character because it would be easier to learn how to do code with a more simplistic shape and design. I chose a circle shape because when the character rotates it will be easy to see that it actually rotating instead of just being static and dull. The colours that I chose are very bright and vibrant which is what I wanted from his character as I wanted my game to appeal to a wide range of people while looking friendly and inviting. However the colours could be seen as too feminine as those colours are usually associated with women, so if I was going to make this game again I would chose colours that are more unisex and appeal to both genders. I would also make the character have more detail and defining features so that it is more relatable to the user instead of it looking like random shapes put together. The canvas size I have is 32 x 32 pixels as I didn’t want my character to look too large on the screen or too overpowering compared to everything else that I have yet to create.

Upload: jakeyhyatt123

Post on 28-Jul-2015

56 views

Category:

Career


0 download

TRANSCRIPT

First I created this simple sprite payer for the 2D game that I am creating because I am personally not good at designing characters on this software (game maker). I also only did a simple character because it would be easier to learn how to do code with a more simplistic shape and design. I chose a circle shape because when the character rotates it will be easy to see that it actually rotating instead of just being static and dull. The colours that I chose are very bright and vibrant which is what I wanted from his character as I wanted my game to appeal to a wide range of people while looking friendly and inviting. However the colours could be seen as too feminine as those colours are usually associated with women, so if I was going to make this game again I would chose colours that are more unisex and appeal to both genders. I would also make the character have more detail and defining features so that it is more relatable to the user instead of it looking like random shapes put together. The canvas size I have is 32 x 32 pixels as I didn’t want my character to look too large on the screen or too overpowering compared to everything else that I have yet to create.

After creating the character I have then put a collision mask on my player so that my player can be hit by other objects and not be invincible forever. I chose to put the ellipse shape/mask around my player as it is best suited for the shape of my player as they are basically the same. This allows my character to be perfectly inside this collision mask meaning every part of my player can be hit. If I was to make this game again then I would chose the same collision mask unless I changed my player because then I would chose the mask that best fits around that player.

Next I turned my sprite into an object which allowed me to add a step event which is the standard event you want to use if you want your player to so a certain thing when you press a key or move your mouse. I then added a code for each direction that I want my player to move, they are all coded similarly but with some differences regarding the X and Y and the key which is pressed.

Next I created my jet sprite which would be coded as a particle effect that would be behind my player when he was moving through the game. I chose to do a rainbow style jet because it is bright, colourful and attractive to the audience, however this could also be seen as being more suited to females compared to males which could be a problem in the long run. If I was to do this project again I would do a similar style jet but add feature that would also appeal to men as well as women.

I then created a Jet object but I didn’t give it my jet sprite as it would be a particle effect and if I gave it a sprite then it could cause errors for my game when it is played.

After I created the object I then a step event as I would want this jet to do something when a certain event happens. In this case I want the jet particle effect to start when my player object was created. Line 7 of the code says that I want to create the particle sprite as soon as my player has been spawned onto the screen. The first false means that I don’t want my sprite to be animated when it has spawned, the second false means that I don’t want the sprite to be stretch from its original size and the last false means that I don’t want my sprite to be random (do whatever it wants). Line 8 of the code is setting the size of the sprite for when it loads, “0.5” means that the minimum size of the sprite will be half its size, “1” means that the maximum size of my sprite will be double its original size, “-0.1” means that the sprite will slightly change its size during every scene to give it a animated effect and the “0” means that my sprite won’t have wiggle when it has been created. Line 9 of the code is just the life span of the sprite so I have set it to a very high number so that my sprite will continuously be on the screen throughout the game. Line 10 of the code says that the gravity effect on my sprite will be random between the ranges of 0.5 and 2 and the 180 just means that the direction of the gravity will be moving backward meaning the jet would move in the correct direction. Line 15 of the code says that the jet particle effect will spawn exactly on the same Y coordinates as the player but will spawn slightly behind the player as I have set the X coordinates to “X-18”.

After creating the particle system I then coded this to my player so that when my player spawned then it would create this particle system at the correct X and Y coordinates.

I next created a background for my player so that he wouldn’t be flying around in nothingness. I decided on a space themed backround as I felt that this would be most suitable for my player as he is flying around and I also had an idea fo rwhat I want my enemys to look like and with this background that was possible to do. I chose the planet Saturn as I think this is the best looking planet as it has the rings around it making me good to look at. I also included Mars because besides the planet Earth this is the second most famous planet and is known by everyone as the red planet which makes it regognisable. I added twinkling stars so that all the stars didn’t look the same as that would have been dull and boring to look at, I added the satilite because that’s something that I think of when I think about what is in space, I put the letters JH on my satilite because they are my initiles.

I then created a room and set the lowest background and give it the background that I had just created and I simply made it into a scrolling background by changing the horizontal speed to -6 so that the backround would scroll backwards creating a sense of movement for my character. I aslo then added my player into the room by selecting objects, secleted my player_1 sprite and then cliked on the room with then created my charcter on the screen.

Next I simply and quickly created this standard aiming sprite as I wanted my player to be able to fire wherever they want instead of just firing forward to give them abit more freedom and this also makes the game more difficult as you will have to kill the enimies whilst also doging incoming fire from them.

I then made my aim sprite into an object and added a simple step event so that the aimer would move towards the mouse at all times at a speed of 20.

Knowing the direction I wanted my game to go I added a simple create event to my player so that the player would rotate to look at wherever the mouse was on the screen.

After the room I created a laser sprite which would vbe what my player would fire and use this to kill as many enimes as possible before dying. I chose to create a pink laser as I thought that red is more of an enemy colour compared to the colour of the heros laser. I feel that this was a good choice and if I was to do this again then I wouldn’t change my mind, I would create the same laser sprite again. I then modified the colision mask of the laser manually as it is such a small object and only wanted the head of the laser to be the part that can destroy the enimes.

To make is so that my player would fire the laser that I created I chose to have a Global Left Pressed and added this simple line of code so that when the the left mouse button is clicked then the laser will be created wherever the player is on the sceen at that time.

After testing this my player would fire using the left click but would only go forwards which was a problem for me so I had to do research on how to fix this, I entered a new create code which makes the laser fire towards the mouse (the aiming sprite). I also had to enter another piece of code so that the laser sprite would rotate depending on which direction the player was facing so that when it was fired NE then the laser would have a diagonal look to it instead of it just being a striaght line moving in an odd way.

I then entered a step event to the laser so that when the laser left the room it would be destroyed and because my player can shoot in evey direction I had to incude both the X and the Y axis. This helps my game because it will reduce the lag of the game because all your previous shots would be destroyed instead of continuoulsy flying through the level.

I then created my base enemy charcter (top image), I chose to have it as a UFO because I had a space theme and aliens is what you instanly think of when you think about space. I wanted the enemy character to be animated so I set an animation with 5 frames and slighly moved each one into the positon that I wanted them and I set the speed of the animation to 7 as I feel that was a suitable choice as it isnt too fast or too slow so that you can see them move pixel by pixel.

I had to set a collion mask for the enemy character as the players laser would be able to kill them, I chose to have a Eclipse mask because this was the best suited one for the enemy that I created and it covers the whole enemy so no matter where to laser hits it it will collide.

To the laser properties I added a simple code so that if the lasers collion mask comes into direct contact with the enimies collion mask then the laser will be destroyed so that it doesn’t fly straight through the enemy and keep going.

I then set up the enemies spawning system so that there would be more than one emeny on the screen at a single time but that it wold be the same enemy sprite with ther same code. I also set it be be random so that everytime this alarm restarts then you wouldn’t know the enemy spawn pattern.

I then set up the enemy characters movement so that they would move from right to left across the screen at a speed of 10 (the – is to make it go from right to left)

I added a similar code to the lasers code for being destoyed when leaving the room on my enemy character for the same reason. However I didn’t need to include the Y axis as the enemy playes only move horizonatly.

Next I created the explosion srpite for the emeny character. This was also animated so I created 3 frames with each one changed to create an explosion effect and the speed was set to 7 as I felt that this was the most suitbale for this sprite.

I then used this sprite as a base for my explosion_1 object but I didn’t attach the sprite to the object for the same reason that I didn’t woth the jet. The code for the particle system is more or less the same with a few minor changes such as “part2” because if I used part1 then the game would get confused causing an error, also the coordinates are set to x, y, so that it will create this explolison anywhere I want it to.

Next I went back to the enemy so that I could put the particle system I just created to use. I entered this piece of code so that if the laser came into contact with the enemy then the enemy would disapear and the explosion_1 particle system would take its place for a couple of seconds.

After this I made an aminated sprite for the enemy projectile which was simple but I feel that it was all around a good sprite for the enemy. The colours that I chose were nuteral so that it suits both males and females.

Then I went back to my enemy object and created an alarm so that if player one exisits (is in the room) then the enemy projectile will be created at the point of the enemy on the screen.

Next I went back to the enemy projectile and put in a acreate event so that if player 1 exsists in the room the the enemy projectile will go towards the player wherever it is on the screen.

Next I created a sprite for my players health with has 6 possible stages. I started with the lowest possible stage which would be no health, all the way up to full health.

I then created a health object and entered 2 simple codes. The top one is a simple create code which just creates a global variable to set the health as 5 (as there are 5 hearts on the sprite). The bottom one draws the health sprite in the top left corner of the screen based off the X and Y coordinates that I entered in the code.

Next I created an animated death explosion for when my players health gets to 0. I went for the rainbow colours because this is the house colour that I have been consistant with throoughout the game.

I then created an explosion 2 particle system for my player which is basically the same for my enemy explosion scene. I also added a create event so that the particle sytem knows how long to last for.

I then coded so that when the enemy projectile comes into contact with the player then his global health would decrease by one (loose a heart everytime the player gets shot). The alarm means that the player will have a brief time when they can’t be hit by enemy projectiles.

To finish off the coding on my player 1 I added an alarm that meant the hurt on the player was 0 (taking no damage). I then added onto the step event that I created for my player, I added limits which means that the player would have to stay within those limits so that you couldn’t just fly off the screen on either the top, bottom, left or right. Finally I added the health system so that if the hurt was equal to 1 (the player had been shot) then one heart would disapear. If the global health was less than one (no hearts) then the player would change into the exploson that I created for my player, it will also destroy the jet becase if it didn’t then the jet would get get confused as there would be no player to spawn from causing the game to crash.

I added font1 and selected a suitable font for this. This is the font that the numbers will be but I will change the colour and size if needed in coding.

These are the last pieces of code that I needed to add to my points so that it would work. The top one just means that when the game starts the player will always have 0 points to begin with. The second one tells game maker where to draw/put the font1 on the screen, it also tells the colour and I chose purple as I felt that it was a suitable colour. The last code is put in on the cossion code for the player laser and the enemy so that when the laser destroys an enemy then he points will go up by one.

Next I created a title screen for my game and added an event so that when the enter key was pressed it would go to the next room which would be the main level.

Next I set up this alarm so that when the players explosion was finished then the game would automatically go to the next room in the sequence.

Finally I made a game over screen for when the player dies and set it up so that when you press space bar, it would return you to the title screen so that you could try again.