Thursday, 21 March 2013

Game Development 1 - Drag and Drop Game

ActionScript 3.0



{
import flash.events.MouseEvent;

var totalAmout:int = 0;

item1.desc = "Big Bang CD Album";
item1.price = 76;
item1.startX = -6.2;
item1.startY = 1.9;

item2.desc = "Bluetory CNBLUE CD Album";
item2.price = 68;
item2.startX = 86.8;
item2.startY = 61.8;

item3.desc = "City Hunter Pictures Book";
item3.price = 125;
item3.startX = 47.3;
item3.startY = 142.1;

item4.desc = "ThankU CNBLUE CD Album";
item4.price = 40;
item4.startX = -2.7;
item4.startY = 230.2;

item5.desc = "Ouran High School Host Club Poster";
item5.price = 35;
item5.startX = 86.8;
item5.startY = 279.7;

item1.buttonMode = true;
item2.buttonMode = true;
item3.buttonMode = true;
item4.buttonMode = true;
item5.buttonMode = true;

item1.addEventListener(MouseEvent.MOUSE_DOWN,onItemDown);
item1.addEventListener(MouseEvent.MOUSE_UP,onItemUp);
item2.addEventListener(MouseEvent.MOUSE_DOWN,onItemDown);
item2.addEventListener(MouseEvent.MOUSE_UP,onItemUp);
item3.addEventListener(MouseEvent.MOUSE_DOWN,onItemDown);
item3.addEventListener(MouseEvent.MOUSE_UP,onItemUp);
item4.addEventListener(MouseEvent.MOUSE_DOWN, onItemDown);
item4.addEventListener(MouseEvent.MOUSE_UP,onItemUp);
item5.addEventListener(MouseEvent.MOUSE_DOWN, onItemDown);
item5.addEventListener(MouseEvent.MOUSE_UP,onItemUp);

function onItemDown(event:MouseEvent):void
{
var item:MovieClip = MovieClip(event.target);
item.startDrag();
item.scaleX = item.scaleY = .95;
var topPosition:uint = this.numChildren - 1;
this.setChildIndex(item, topPosition);
total.itemName_txt.text = item.desc;
}

function onItemUp(event:MouseEvent):void
{
var item:MovieClip = MovieClip(event.target);
item.stopDrag();
if (bin.hitTestObject(item))
{
updatePurchasedPanel(item);
}
else
{
item.scaleX = item.scaleY = 1;
}
}

function updatePurchasedPanel(item:MovieClip):void {
totalAmout += item.price;
total.itemName_txt.text = "";
total.total_txt.text ="£" + String(totalAmout);
item.scaleX = item.scaleY = 1;
//item.x= item.startX;
//item.y = item.startY;
item.play();
}


This is another game used for this project. The above image is my workshop group homework. I found that the basic concept of drag and drop game structure can applied on my cooking game with some changes applied to suit the game's needs.


Game Development 1 - Collecting Game

ActionScript 3.0
/*
 ********************************
 * Shooting stars game
 * http://flashadvanced.com                              
 ********************************
*/

//importing tween classes
import fl.transitions.easing.*;
import fl.transitions.Tween;

//hiding the cursor 
Mouse.hide();

//creating a new Star instance
var star:Star = new Star();
//creating the timer
var timer:Timer = new Timer(1000);
//we create variables for random X and Y positions
var randomX:Number;
var randomY:Number;
//variable for the alpha tween effect
var tween:Tween;
//we check if a star instance is already added to the stage
var starAdded:Boolean = false;
//we count the points
var points:int = 0;

//adding event handler on mouse move
stage.addEventListener(MouseEvent.MOUSE_MOVE, cursorMoveHandler);
//adding event handler to the timer
timer.addEventListener(TimerEvent.TIMER, timerHandler);
//starting the timer
timer.start();

function cursorMoveHandler(e:Event):void{
//sight position matches the mouse position
sight.x = mouseX;
sight.y = mouseY;
}

function timerHandler(e:TimerEvent):void{
//first we need to remove the star from the stage if already added
if(starAdded){
removeChild(star);
}
//positioning the star on a random position 
randomX = Math.random()*500;
randomY = Math.random()*300;
star.x = randomX;
star.y = randomY;
//adding the star to the stage
addChild(star);
//changing our boolean value to true
starAdded = true;
//adding a mouse click handler to the star
star.addEventListener(MouseEvent.CLICK, clickHandler);
//animating the star's appearance
tween = new Tween(star, "alpha", Strong.easeOut, 0, 1, 3, true);
}

function clickHandler(e:Event):void{
//when we click/shoot a star we increment the points
points ++;
//showing the result in the text field
points_txt.text = points.toString();
}



The above script was used for my previous work, and I found that can be used again on one of game for my final project.


Below is shooting star flash game that I found online.


Figure 1. Flash, Flex and ActionScript tutorials - flashadvanced (2009-2011). Creating a small shooting game in AS3. [Image Online] Available from: http://flashadvanced.com/creating-small-shooting-game-as3/ [Accessed 21/03/2013]




Thursday, 7 March 2013

Art Direction and Mood Board

After collecting various samples as a guide to the colour chart for my final project, these sample images are the type of ideal art direction I planned on. It inspires me and help set my colour mood for the story to create a colourful and the imaginative world for kids.
  

Narrative Plot

This is new narrative plot based on the original story of “the Mouse , the Bird and the Sausage” from Grimms' Fairy Tales by The Brothers Grimm. Digital sketches are based on this narrative plot and each point is a description of every sketch done for a page of the story.

Thursday, 31 January 2013

Project Outcome

Project Aims



Serves as a handy bedtime story for children and break the rule of reading fairy tale story from fully text-based storybooks to expand the imagination world with all creative ideas.
Project Outcome(s)
1


An offline content-rich story eBook based on an interactive fairy tale with 3 mini games, background music and story narrator in Android platform for smart phones and tablets especially Kindle Fire.
2


10 pages of flash mobile application for story with a 1280px x 800px dimension which is scalable. The duration of eBook will be 5-7 minutes long.
3


3 mini games are drag and drop matching cooking game, memory matching card game and vertical drop and collect game. The duration of one mini puzzle game will take 2 minutes.
4


There have interactivity images in each pages of eBook with sound effect.
5


The original story of “the Mouse , the Bird and the Sausage” from Grimms' Fairy Tales by The Brothers
Grimm.

This is Project Outcome after presentation of Proposal Prospectus and what I am going to produce for my final project. Target audience has changed to five to six years old children and mini games had been reduced due to time management problem but I will try to work it out. 

Monday, 12 November 2012

54321 Poster

This is a 54321 poster which shows roughly what kind of project am I thinking about, my inspirations and things I am aware of. Do click on the picture link to view the larger image.

More idea plans coming up!