Showing posts with label Flash game design. Show all posts
Showing posts with label Flash game design. Show all posts

Sunday, 30 January 2011

Final product

Due to not knowing how to fix the problem I have been having with replayability, and liking the game at its current state, I have decided to call it done, and class it as a finished 'version 1' of the game.

If I were to have known more about flash then i'm sure that I could have gotten this far without the use of online help and tutorials (as referenced along the progress), and could have possibly overcome the problems which I am left with, mainly the replayability which has become a problem which I couldn't fix.

However, I am pleased with the final product and will want to improve upon it in the future when I learn more about using flash for games. I have overcome many problems and learnt a great deal from creating this flash game, it has been both stressful and enjoyable. Unfortunately I was obviously restricted due to it being my first flash game, but I used a handful of tutorials as referenced, to help me learn some extra bits of code to do what I did not know how to. These I then understood what they did before using them as part of my code. If I were to do it again I would hope that by then I will have had more experience in this area and will be able to improve upon it, although I am very happy with how this game has turned out!

Here's a short list of assets that were created and used throughout the creation of the game. Apart from those below, I also created text which is displayed on the game over/win frames, and the beginning, but also an explosion used for the lose frame.


So here it is, I introduce to you, the Battleship Invasion!

Problem

I now have only one problem, and that's replayability. If I enable the beginCode function to play automatically upon starting the game, then it is possible to play the game again after losing/winning. If the beginCode function does not start automatically, then I have a fully functional game except you can't replay it without refreshing the web page.

Why does it have to be so confusing! aha

Saturday, 29 January 2011

Design for game over frame

I decided to create something related to the theme of battleships and attacking an enemy base, so I have created a big explosion and changed the background colour to be monochromatic, so that the focus is on the fatc that the base has been blown up thanks to the player! Here's what it looks like;


As you can see, the "you scored:" part does not show any values. This is due to a reason I am unaware of ,so it will more than likely be removed so that I can remove as many faults that are still remaining. I am still having trouble getting it to replay the game properly. Removing the function to create extra levels made it possible to now return to the beginning frame, however it does not re-call the functions like it should, but instead switches between frame 1 (start) and frame 25 (end) by mouse click.

Adding some outside influence

I remembered the lecture from last week where we were shown how to get the computers' time and/or date, which would be very useful to include within my game, to change something depending on the time. I decided then to use this idea to change the background to a day/night themed image depending on the time that the computer playign the game is set to.

My initial code was formatted with variables to collect the current time, and then a function with an if function for each hour, to then set the background to day or night (again variables for both backgrounds) which it would change to through the addchild function, to place an image onto the stage through code. This however didn't work, and I doubt it would have worked as I wanted it to. Luckily another iDat student offered some help with a piece of code which would work how I wanted to, so thankfully I was able to use it within my code and it worked great. A big thanks to Joe WljgrsMott!

Here's a quick comparison screenshot to show the time and that it has changed the background image;

Friday, 28 January 2011

Almost there..

I decided to go through the tutorial that I had linked in the previous post, so that I could gain an understanding of several bits of code which I would have obviously been unfamiliar with due to not making a flash game before. I guess the fortunate thing is that the codes I did use from the tutorial did not make it fully functional. This meant that I then had to look through the code more carefully, and to try and fix the problems myself, or to research for solutions elsewhere.

The problems included;
  1. Creating extra levels didn't work as I had intended (I'm considering to remove the extra levels idea so that it is functional)
  2. Lives and score do not automatically update, nor do they work as I wanted them to
  3. The problem above means that my game over page also does not work as intended
  4. Crate hitboxes not working
  5. Ball gets stuck
Here's how I overcome them;
  1. The levels I will remove, as I do not know how to create them properly, nor how to fix the code from the tutorial for it. This will hopefully mean that I will have less errors with my game and can progress further
  2. The lives and score counters were fixed by including two dynamic text boxes on the stage to display the running totals, so that I could then see that the code was working correctly. I included two functions to update/check the score and lives totals, and to go to the game over frame when the lives count is equal to 0. 
Here is what they look like;
function updateScore():void{
    points += 10;
    txtScore.text = "Score: " + points.toString();
}

function updateLives():void{
    lives --;
    txtLives.text = "Lives: " + lives.toString();
}

These functions are placed within the stage as event listeners, so that they will be running throughout the game.

3.  This was fixed at the same time as ammending problem number two. I had an if function within the check level function, to check whether the lives count was at 0, which would then stop the game and move to the game over frame.
4.  The hitboxes weren't working due to having named some part of the code wrong, so I played around with naming the parts different, and also checking whether it was the name of the box object itself, but eventually I managed to fix it. I think it was a conflict with the name being used for several different parts of the code, that it then created an error.
5.  The ball was becoming stuck underneath the ship/bar, but this was due to there being a gap underneath. This was simple to resolve, I just needed to lower the ship so that it was touching the floor of the stage. The problem was still with the shape of the ship, but I didn't want to create a square block as I wanted my game to be somewhat unique in comparison to generic brick breaker style games, so I kept the shape of the ship despite how it would create a problem with the angle that the ball would bounce off from it.


Using the tutorial did however teach me several things, including;
  • Adding labels to frames, so that you can call a frame by a label rather than a number
  • A detailed reminder about using trace as a digital feedback whilst improving the coding, as it will create a response in the output box inside flash when that function is used.
  • Adjusting an objects' speed, and to make it bounce off when it collides with another/wall
  • Variables can be used to store numeric/text data
  • You can create a function with all of the data you want loaded at the startup, and then use a simple line of code such as 'beginCode();' to call it.
  • Using additional Actionscript files allows certain code to be used in other flash games too, rather than having to include the same length of code in another game, it can be used as an external file to load, similar to javascript or CSS files with web design

Wednesday, 26 January 2011

Useful tutorial

Due to my ball not hitting the sides properly when it randomly moves around the stage, I decided to find a tutorial to help me; Brick Breaker Tutorial

This will also help me further down the line when I come across any other problems or go out of my depth, so that I can understand how things work and include them into my game.

Progress!

As I wasn't sure how to make the ship move left and right, I found a quick tutorial for how to do so.
Movement with keys

Using this tutorial taught me that before you can use a variable, you need to create it, then set it to false so that it isn't used without a key being assigned for it to be used. You then have to create two statements for when it is pressed and is not, so that you know what the event will be if you do either.

So where am I currently? Well here's my rough list of what needs to be done;

  • Bar movement
  • Bar stays on stage
  • Ball movement
  • Ball stays on stage
  • Boxes
  • Boxes dissapear on hit, add score
Extras/final bits: Levels, Lives, Game over messages, Start page
I've got a while to go!

Monday, 24 January 2011

File sizes

Upon inserting the originally created objects in photoshop, I decided to put them into Flash and then re-size them. This didn't work out well, as it seemed to pixelate them by making them smaller, rather than keeping the quality, so I had to re-size them in photoshop and put them back in, which seemed to fix this better.

Here's a comparison shot;
I have now created specific object resolution sizes (in pixels) to ensure that I don't get this problem again;
  • bar - 150x25
  • background - 550x440
  • box - 50x30
  • ball - 25x25

Atleast this way I will know the size of the objects and already have them the size that I am wanting.

Re-dux of original plan

I realised that my design looked too simplistic so I decided to give it a re-dux to make it look nicer and be more appealing to play. I took the theme of battleships and decided to base upon it, but wit ha twist. Instead of attacking other ships, you are attacking a base, destroying their crates containing weapons and supplies!

Here's the new draft design;

Sunday, 23 January 2011

Draft of idea

I've been able to create some graphics within photoshop and a quick animation to show how I would intend the game to work, here's a preview of what it should look like when I start coding;



Let's hope the coding turns out the same as the design!

Game idea

While looking around the internet at flash games I found one that someone had made which looked relatively simple to make;

a simple Brick Breaker game

You move with the directional keys, and have to avoid the falling rocks. As you get past a certain point score the rocks' speed increases, thus making it more difficult to survive. This reminded me of the classic ragdoll game where you have to avoid the spikes to survive, and achieve as high a score as you can.

Ragdoll Avalanche 2

Friday, 21 January 2011

Initial plans/schedule

Creating a flash game will be new to me, as I have no outside experience of creating one. This will be a big learning curve for me, but after making a website, i'm sure that the coding aspect will be familiar.

In terms of a plan for the steps to make it, this is what I initially think will need to be done;
Create graphics for planned game (objects, backgrounds, text)
Frame 1 = start/welcome screen
Frame 2 = the game itself
Frame 3 = game over screen/restart


If I add more than one level I would presume that each frame would display a new level, therefore there would be many frames being used to store each level's graphics and code. This theory could all be incorrect, but I will figure that out along the way as I create it.

Wednesday, 19 January 2011

Ideas for my own game

So what game do I want to make? The problem is that I don't know too much with how to actually code a flash game, therefore I would want to make it simple. But a simple game can always be difficult to create, or to play.

For example;
Tealy & Orangey
This game involves moving two balls across different levels by using the direction keys (left, right, up, down), but it gets difficult because there are hit marks on the spikes, so if you hit one of them, then you have to restart from the beginning with both balls. This is very fustrating as it is hard to focus on the position of both of the balls as the maps are different, it's easy to get confused.

For my game I think I want to either create a similar game to copter, or a racing game, given that I can figure out the code and find the right tips online. A game that I have always been keen of playing however is the brick breaker style games, where you have to shoot a ball to destroy bricks, and you gain powerups to help you such as multiball and rockets.

Here's an example of this;

Smashing
It looks like it might be one that I can possibly make, so here's a list of what I presume I will need to incorporate into the game;

  • Boxes placed together in a shape/formation
  • Board/shape which can be moved left & right by pressing keys
  • Ball which will move around the stage, and when it hits; edges, board or boxes it will bounce back the other way
  • Boxes will dissapear when hit, and a score will be added to the running total
  • A set of lives, which when they dissapear it will be game over
Optional: Powerups, explosions, extra levels, restart button, level selector

Personally I think that this will be quite difficult for myself to create, but i'm interested in making it so this will be what I will create.The main reason for interest is due to playing 'brick breaker 3D' alot on my ipod touch. It's a very addictive game due to the graphics and the large number of levels that it has.

Brick Breaker 3D

Monday, 17 January 2011

Examples of games

I have played alot of these flash games over the years aswell as the mainstream games, due to boredom when at home and using them to help pass time by. In all honesty, I know that most of the flash games  that I have played will be impossible for me to create at this stage, due to lacking enough experience in making any flash games and knowing what i'm capeable of.

Flash games which I have enjoyed are the ones where you shoot/hit a target and have to then gain as large a distance travelled as possible.

Here's a few examples of those games;
Groundhog D-day
Toss the turtle

The nice things about these are that the graphics are really well made, you gain achievements, and you gain money from each time you shoot the creature, so that you can purchase items to enhance the game for you, and to make you travel further. This then allows you to want to play for longer so that you can gain the rewards and also the achievements, as having them there makes you want to get them before you stop playing.

Pingu throw (Bloody)
This one is much older, however just as fun as you get to hit a penguin with a club and see it get blown up when it lands on mines.

Games that seem relatively more simple include;
Copter
Curveball
Although even then I would still not fully know how to recreate them because they do have some features which seem difficult to create. For example, copter has a randomly generated map that you have to navigate through, and curveball has a set of levels which have increased speed as you progress through them.

Sunday, 16 January 2011

Where to gain access to flash games

Flash games are easily accessible, as they are advertised on many websites, and are redistributed by lots of people. By doing a google search for 'games' you will find millions of pages containing free flash games that can be played. The popularity with these games are that you don't have to be skilled at playing games to do well in them, and they dont cost much (if anything) to purchase/play them in comparion to mainstream games which are released at £30 for the PC, and higher for console games.

Some well-known websites for accessing these games include;
Miniclip
Kongregate
MoFunZone
AlbinoBlackSheep
NewGrounds

Typically these websites will also contain news/blogs about games or events, they won't just contain flash games, with the exception of a few. This then allows users to communicate with eachother too, as they do also include forums and achievements which can be gained by creating an account, to try and compete with some of the mainstream games and features that are out there, such as Xbox live, Playstation network, and Steam for computer games.

Online gaming

Online gaming is something that has become very popular lately, as it allows peopel to communicate with eachother, and to pass times of boredom, as playing computer games can be enjoyable. Everyone enjoys different genres however, such as first person shooters(FPS), real time strategy(RTS), Roleplaying games(RPG), racing, action, family/indie, and more. Each genre has specific characteristics that make a game fit into that genre, for example; first person shooters will involve playing from a first person view, and the gameplay will contain guns in possibly a deathmatch vs other players. To make a game specific to a genre you need to first understand the characteristics within that genre which you need to implement.

The nice thing about online mini-games/flash games is that the genre is less specific, as the games themselves are all part of a niche genre, as they are not mainsteam games but are published on websites, as apps in the iTunes store, games on your mobile phone, games on facebook. The games on these locations are what would be classed as online mini games, as you won't end up playing them as competitively or for as long as games such as Call of Duty, Team fortress 2 or Trackmania. The intention is that these games will be a short burst of fun, rather than playing several hundred hours on them, simply because you aren't able to socialise with friends so much on them, and there isn't as much to do in comparison to mainstream games.