Tuesday, 29 November 2011

Flash As An IDE

(More to add)
Flash is a great integrated development environment
Flash is a multimedia programme that is used to create animations, video, flash games and interactive web pages.
Flash is also frequently used to create advertisements which can be found on websites with banner advertisements.

There are many advantages of using Flash programme, especially for animation or flash game development.
One advantage of using Flash with the Adobe Creative Suite is that any creations made in programmes like Photoshop or Illustrator can easily be transferred into Flash. For example graphics made in Illustrator can be easily transferred into Flash for a game you're creating. However Flash itself has tools to create simple objects and image manipulation tools to edit them, some examples could be shape tools, text and free transform tool which I feel is quite an important tool as you can reshape an image for example to the size you desire.
Vector images which is what Illustrator is used to create, 

Games developed in Flash have been very popular and this is often a choice for people who want to create games and be possible game developers as flash is a good start for new beginners and a great way to understand how to utilise their games and how game play works. Flash games work heavily on scripting with coding with ActionScript, the most recent version of this is As3 which is more efficient than it's predecessors.

Sound can also be incorporated into flash which can be used to add music or sound effects to a game. Sound effects can also be coded to only play at certain points or triggered by a certain event, for example a gun shot sound effect will only play when the fire key is pressed in a game.

Objects like images for a character or enemies can be stored in the flash library which allows the image to be reused again, this makes for efficient use of memory.

Like other Adobe software like Illustrator and Photoshop, Flash can also use layers which can allow more depth to be put into work, and keep things organized to a certain layer making it easier to organize and maintain

Coding can be used on just a single frame, so an large portion or possible an entire animation, game or other flash production could be done entirely on a single frame.

Through the use of scripting, MovieClips and Flash library, certain events can be triggered in an animation or game and then be brought from the Flash library onto the stage, for example a bullet from a gun, once the button is pressed to fire the gun, the bullet image can be brought on stage from the library and then the animation plays with the bullet moving across the stage and finally disappearing off stage once finished. This will then be repeated everytime the fire button is pressed. This is a great way to organise an animation or event into one area in the library which will then only be brought into action when called upon by scripting.   

Wednesday, 23 November 2011

Flash Game Development

The development of my game has so far been productive but quite difficult at times. But so far I feel I am on track to making the game to how I planned. I have been experimenting and learning new coding for my script that hasn't been taught throughout our class demo's. This has made a few problems while trying to piece coding together which has slowed down development a little, but overall it hasn't completely stalled and therefore the development is still going successfully.


Here is an example of how I managed to create coding so the zombies will spawn outside of the stage and then proceed to follow the Survivor(blue dot in the image).

Here is a screen grab of my experimentation of my attempt to make a gun for the survivor which became attached to the Survivor and therefore would stay on the Survivor when it would move. The coding in the script menu is an example of making the guns rotation, this is an example of how complex and complicated some of the coding can be. This allows the black gun to rotate to face where ever the mouse cursor is.

Thursday, 17 November 2011

Flash timer

var time:int=300

var myTimer:Timer = new Timer(1000, 300); //This is making the clock countdown one second from the clock, the 1000 represents 1 second and the 300 is for how many times it will countdown a second.
myTimer.addEventListener(TimerEvent.TIMER, runOnce);
myTimer.start();

function runOnce(event:TimerEvent):void {
time--
clock.text=String(time);
}

Thursday, 3 November 2011

Scripting

var blockArray:Array=new Array();

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

Ship.startDrag(true)
Mouse.hide();


for(var i:int = 0; i < 15; i++) {
//Will duplicate the cube 15 times
var cube:MovieClip = new Box();
//This is looking for a new box in the libary
cube.x=Math.random()*550
//This is loading new cubes randomly on the x axis
cube.y=Math.random()*400
//This is loading new cubes randomly on the y axis, this works alongside the x axis too
addChild(cube);
//This is bringing a duplicate of the cube from the libary onto the stage

blockArray[i]=cube;

}

stage.addEventListener(Event.ENTER_FRAME, checkhit);
//Listen to the stage on every frame
function checkhit(myevent:Event):void {
for (var i:int = 0; i < 15; i++) {
//Creates a loop to create blocks 15 times.
if (blockArray[i].hitTestPoint(mouseX,mouseY,true)){
//If any of the cubes get hit by the mouse in it's x or y direction, true means the i from blockarray is following the cubes, so the cube that is hit by the mouse will cause the transparency(alpha) down.
blockArray[i].alpha=.3;

}

blockArray[i].y+=3;

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

}
}

}