Tuesday, November 15, 2011

flash as a IDE



Flash is a good integrated development environment.
The program can be use independently to create a whole product for example you could create a game with only using flash.

There are many useful functions in flash that help achieve its independence.

The first useful function is the tools such as brush,shape,fill ect. These tools help the user to create graphics for their desired end product, within the program. They are simple to use. All images created with these tools are automaticly turned into vector images. This is a good function as it stops any worry about your graphics being destroyed because of resizing.

The ability to import bitmaps is also a very good function. As much as the drawing tools are helpful,You may not be able to get the desired style of graphics you want. This is easily overcome by being able to import bitmaps. This function is extremely helpful for those that prefer creating bitmap images rather then vector images.

Action script is the biggest and main function of flash. This function helps do allot of things. For example it could help you create an objects that would mover across the stage when you press a key. Of you could make it follow your mouse. There are many things that can be created with action script. The greatest part is that even if you are not fully educated in scripting. It doesn't mean there is no hope. As there are allot of pre-made scripting for items such as scroll bars and buttons. So even if you have no talent with scripting then you are still able to create things.

Flash also has tools and filters to help you adjust images. For example you can add drop shadows to images to make them look as if they are above something as sometimes when adding in graphics to the stage they may look flat. These tools can also help add opacity to an object. This is useful for many things. Some of which are, making the graphics disappear once they've been hit. Of making them transparent so you can see what's behind it.

The animation feature is a highly useful toll as well. If you want something to explode on impact then you can do this easily inside flash without having to go through the hassle of making the animation in say Photoshop and importing it in. you can animate something by quickly jumping inside of the graphics and making an animation on the time frames. This feature adds diversity to flash as it can be used for purposes other then to create say a game.

Flash is compatible with computer hardware such as microphones and drawing tablets. This adds to its ability as with the addition of a tablet you will be able to create better quality graphics. even though flash has pre-set sounds you can use to add interest into your end project, They may not have the particular sound you want thankfully, you can use a microphone to record your own sounds.

With the feature ‘library’ items like buttons or players are able to be stored away. This decreases the size of the memory that is being used up and in return will make the game, website or whatever is being made less likely to chug. it also makes it easier to keep track of everything you have on your stage

There are many ways you could create items. For example you could make a website by using different frames for each page and inserting go to an stop commands. But you are also able to use only one frame and do the rest by coading. This is a good feature to have as it helps each person to be able to make a website in their own way. Having this feature reduces the number of people who may go and use a different program as flash is to ‘hard’

With all of these features and tools inside of one program it helps make it independent as everything can be made in this one program. With the sound features and the ability to create graphics in flash, there is no need for any other program. Flash is a grate integrated development environment as everything you may nead from another program, is all inside flash


Thursday, November 10, 2011

aray


import flash.events.Event;

var speed=3


speed is 3

var blockArray:Array=new Array();

add a new array

var Ship:MovieClip = new ship();
addChild(Ship);


add a ship to the stage

Ship.startDrag(true);

 makes ship follow mouse

Mouse.hide();

hides mouse


for (var i:int = 0; i < 15; i++) {

for loop. will run 15 times

var cube:MovieClip = new box();


 go to library look for box

cube.x=Math.random()*550

random position


cube.y=Math.random()*400

random position


cube.scaleX=Math.random () *1.5+.1;
cube.scaleY=Math.random () *1.5+.1;
cube.rotation=Math.random()*360;

rotated randomly

addChild(cube);

add onto stage

blockArray[i]=cube

 fills list with 15 cubes

}


stage.addEventListener(Event.ENTER_FRAME,checkHit);

listen to the stage and run a function called check

function checkHit(myevent:Event):void {
for (var i:int=0;i<15; i++) {

create a for loop 15 times

if(blockArray[i].hitTestPoint(mouseX,mouseY, true)) {

if  any cubes get hit by the registration point of the mouse in x direction or y direction

blockArray[i].alpha=.3;

if the obgect is hit then it must reduce the alpha by 3

Ship.play();


this tells the ship to play if it is hit


}
blockArray[i].y+=speed
if (blockArray[i].y>450){
blockArray[i].y=-50
blockArray[i].x=Math.random()*550


 makes the boxes randomly move allong the x axis instaid of being the same all the time
speed+=0.1;
}
}
}

makes the boxes speed up by 0.1 every time they loop round

attach library


var ship:MovieClip=new Ship();

ship.x=275
ship.y=200

addChild(ship);

grab the movie clip called ship and place it on the stage were told


collision detection






stage.addEventListener(Event.ENTER_FRAME,checkHit);
listen for something is getting hit

function checkHit(myevent:Event):void {
cube1.x+=3
cube2.x-=3

if(cube2.hitTestPoint(cube1.x,cube1.y, true)) {
cube1.alpha=.3;

if cube 2 hits cube 1 then change its alpha by 3
}

}


smooth keyboard movement





var moveRight:Boolean = false
move right false
var moveLeft:Boolean = false
move left false
var moveUp:Boolean = false
move up false
var moveDown:Boolean = false
move down false






import flash.events.Event;
import flash.events.KeyboardEvent;
insert an event called keyboard


stage.addEventListener(Event.ENTER_FRAME,moveShip);
listen for if the ship is moved


function moveShip(event:Event) {
if (moveRight==true)  {
ship.x+=3;
if right is true (pushed down) then move ship by 3
}
if (moveLeft==true)  {
ship.x-=3;
if left is true (pushed down) then move ship by 3
}
if (moveUp==true)  {
ship.y-=3;
if right is up (pushed down) then move ship by 3
}
if (moveDown==true)  {
ship.y+=3;
if right is down (pushed down) then move ship by 3
}

}



stage.addEventListener(KeyboardEvent.KEY_DOWN,pressKey);
stage.addEventListener(KeyboardEvent.KEY_UP,stopship);
listen to keyboard being pressed


function stopship(myevent:KeyboardEvent):void{
moveLeft=false;
moveRight=false;
moveUp=false
moveDown=false
if not pressed set move ship to false
}



function pressKey(myevent:KeyboardEvent):void{
if(myevent.keyCode==Keyboard.RIGHT){
moveRight=true;
}
if(myevent.keyCode==Keyboard.LEFT){
moveLeft=true;
}


    if(myevent.keyCode==Keyboard.UP){
moveUp=true;
}


if(myevent.keyCode==Keyboard.DOWN){
moveDown=true;
}

if pressed set move ship to true.
}

key board controll




stage.addEventListener(KeyboardEvent.KEY_DOWN, moveship);
 this line is telling flash to lisen for any key being presed on the keyboard
function moveship(myevent:KeyboardEvent):void {
this gives the name of the function

if (myevent.keyCode==Keyboard.RIGHT){
ship.x+=5; 
 ship.rotation=90
if right key is hit, then rotate the ship 90%

} if (myevent.keyCode==Keyboard.LEFT){
ship.x-=5; 
 
ship.rotation=270
if the left key is hit then rotated 170%
}
if (myevent.keyCode==Keyboard.UP){
ship.y-=5; 

ship.rotation=0
if up key is hit then rotate nothing

} if (myevent.keyCode==Keyboard.DOWN){
ship.y+=5; 
 
ship.rotation=180
}
if the down key is hit then rotate 180%

}
 stage.addEventListener(Event.ENTER_FRAME, bounds);
 listen to the stage then ad event called enter frame. function is called bounds

 function bounds (event:Event) {
if (ship.x>=500) {
ship.x=0;
}
if (ship.x<0) {
ship.x=500;
}
if (ship.y>=400) {
ship.y=0;
}
if (ship.y<0) {
ship.y=500;
}
 }


if the ship is near the bound then it makes the ship go back to the other side

Wednesday, October 19, 2011

flash i need

random movement for enemies
score
deduction from score when you hit into a type of enemy
deduction of  life when you hit into a different enemy
character always in center of screen ( screen moves in staid of character)
character selection (if possible)

Tuesday, October 11, 2011

character design

for my game i have to design a range of characters. i will have to design the player that you play as. and i will also have to design the opponents. in this case the opponents are the bats and ghosts

The top one was my first design but i didnt like it much. as i am aiming this game at young children. mainly young girls. so i tried to make the bat look more "cute"
the second design i like allot. though this is not a vector image. so i will have to re do it again but in a vector style 


in the end after vectorising them i ended up with these graphics 








Thursday, October 6, 2011

designing

our aim is to create our own version of an asteroid game. but when creating out game we must try to find a way to make it different.
in order to think of my game i have to first think of a setting and goal. this will help me decide as to what you will have to do in the game.

i struggled to think of a theme or setting to base my game on, at first i thought about basing my game inside of a forest and it was like a maze, but after asking someone about it i was told that making a maze would be to hard as it involved to much coding for an armature. so in the end i turned to look at the time of year it is now. Halloween is coming so i had taken inspiration from this holiday. i want my game to be more aimed at young children. so i decided that there will in staid of having to kill things you gave to collect things.
in the end my games idea is that you are a witch or wizard and you have to collect pumpkins for your pumpkin soup. if you get hit by a ghost it will subtract from your pumpkin counter but if you get hit by a bat then it will take away a life.

for the graphics i want it to look a bit like the graphics from Pokemon. for example the way how your character is always in the centre of the screen. also i would like to have it have the same kind of artwork but unfortunately i think i have to keep to vector images to keep the program from slowing down    

research



the game asteroid is one of the oldest games that contain flash elements. it may not have been made with the program flash but it is now easily recreated in flash.
the game was a vector game so everything was made up of lines in staid of complex drawings.

the game asteroids have influenced many games in the future. not so much the more famous games but because of how easy it is to recreate this style of game there are many amateur / fan made versions of this for example if you type in asteroids into Google the first 2 links are links to a newer fan made version
http://www.play.vg/games/4-Asteroids.html
http://www.learn4good.com/games/action/asteroids_online.htm

most of the recreations of this game are all similar with the same ship and smash rocks theme but some people have done different things with their games and almost changed it into a different game.
by using the same codding but adding some extra things into it you can create a totally different game. for example if you take away the ability to go up and down you can create a game like space invaders

space invaders was also another game that had used flash elements in the past. the invention of this game had influenced the idea of having to kill things or shoot things in games. as it was the most popular game of 1982.