Wednesday, March 30, 2011

FYP 2 - Digital layout

Homepage for the flash application. As you can see there are 5 navigation to let user go through it's content to explore more about puppets. The buttons will be animated as it is floating in the air. As for the circle in the middle, so call "earth" will be animated too, it will be a slowly spinning animation. Other pages still in the progress.

FYP 2 - Action Script 2

Game 3



I found out a game that similar to my game 3 which I can use this scripting that block the user so it can't make any movement.

/*------------- www.taoshaw.com ---------------*/
//背景图的列数和行数,此处根据您先前所绘制的地图数据来确定...
var col = 16;
var row = 15;
//定义每个单元的长与宽
var block_width = 40;
var block_height = 40;
//初始化所有数组
var ditu_array = new Array();
var box_array = new Array();
var mubiao_array = new Array();
//
//地图数据
var ditu = new Array();
//定义地图的数据内容,此处数据有部分是故意多加的,大家要注意哦,可以自己写一下。呵呵。按照前面一章节的介绍写吧。
ditu[0] = new Array( 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 4, 2, 4, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 2, 4, 6, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
var tree:Number = 1;
var back_ground:Number = 2;
var kongbai:Number = 3;
var BOX:Number = 4;
var level_num:Number = 0;
var col_num:Number;
var row_num:Number;
//自定义一个复制地图的函数
function drawMap(level_num) {
for (var i = 0; i < row; i++) {
//初始化二维数组
ditu_array[i] = new Array();
box_array[i] = new Array();
//进行循环复制,这个前面的章节中有详细介绍,在此不再缀述
for (var j = 0; j < col; j++) {
var num = ditu[level_num][i * col + j];
//根据地图数据进行mc的复制及摆放
if (num == 0) {
//如果是空白位置,就直接跳过
continue;
} else {
//如果是非零位置,就先复制出背景,并根据行列号进行其他操作
//根据getNextHighestDepth()方法先定义一个短点的变量
var temp = getNextHighestDepth();
//复制库中的元件,并动态添加到新元件
attachMovie("source", "source" + temp, temp);
var mc = _root["source" + temp];
//设置复制元件的座标位置
mc._x = j * block_width + bgMap_mc._x;
mc._y = i * block_height + bgMap_mc._y;
//给mc增加一个 类别属性zhenghaoma
mc.zhenghaoma = num;
ditu_array[i][j] = mc;
switch (num) {
//根据num的值显示不同的内容.
case tree :
mc.gotoAndStop(tree);
break;
case back_ground :
mc.gotoAndStop(back_ground);
break;
case kongbai :
mc.gotoAndStop(kongbai);
mubiao_array.push([i, j]);
break;
case 4 :
mc.gotoAndStop(back_ground);
//
var temp = getNextHighestDepth();
attachMovie("box", "box" + temp, temp);
var box = _root["box" + temp];
box._x = j * block_width + bgMap_mc._x;
box._y = i * block_height + bgMap_mc._y;
box_array[i][j] = box;
break;
case 5 :
mc.gotoAndStop(kongbai);
mubiao_array.push([i, j]);
//
var temp = getNextHighestDepth();
attachMovie("box", "box" + temp, temp);
var box = _root["box" + temp];
box._x = j * block_width + bgMap_mc._x;
box._y = i * block_height + bgMap_mc._y;
box_array[i][j] = box;
break;
case 6 :
mc.gotoAndStop(back_ground);
//
my_person._x = j * block_width + bgMap_mc._x;
my_person._y = i * block_height + bgMap_mc._y;
row_num = i;
col_num = j;
break;
}
}
}
}
//让箱子永远在目标层的上面
for (i in _root) {
var s:String = _root[i]._name;
if (s.substring(0, 3) == "box") {
_root[i].swapDepths(getNextHighestDepth());
}
}
my_person.swapDepths(getNextHighestDepth());
}
//运行刚定义的函数
drawMap(level_num);
//建立键盘侦听,接收键盘消息
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
switch (Key.getCode()) {
case Key.UP :
dir = "上";
break;
case Key.DOWN :
dir = "下";
break;
case Key.LEFT :
dir = "左";
break;
case Key.RIGHT :
dir = "右";
break;
}
movePerson();
};
//添加监听
Key.addListener(keyListener);
//
//根据键盘消息进行位置移动
function movePerson() {
//根据按键信息,确定人物的位置方向
my_person.gotoAndStop(dir);
switch (dir) {
case "上" :
if (ditu_array[row_num - 1][col_num].zhenghaoma != tree) {
if (box_array[row_num - 1][col_num] == undefined) {
//如果这个位置上没有箱子,人向上移动一格
my_person._y = ditu_array[row_num - 1][col_num]._y;
row_num--;
} else {
//这里摆放有一个箱子
if (ditu_array[row_num - 2][col_num].zhenghaoma != tree && box_array[row_num - 2][col_num] == undefined) {
//下下个位置上不是树,也不是箱子,人物和箱子一起向上移动
box_array[row_num - 1][col_num]._y = ditu_array[row_num - 2][col_num]._y;
box_array[row_num - 2][col_num] = box_array[row_num - 1][col_num];
box_array[row_num - 1][col_num] = undefined;
my_person._y = ditu_array[row_num - 1][col_num]._y;
row_num--;
}
}
}
break;
case "右" :
if (ditu_array[row_num][col_num + 1].zhenghaoma != tree) {
if (box_array[row_num][col_num + 1] == undefined) {
//如果这个位置上没有箱子,人物向上移动
my_person._x = ditu_array[row_num][col_num + 1]._x;
col_num++;
} else {
//这里摆放有一个箱子
if (ditu_array[row_num][col_num + 2].zhenghaoma != tree && box_array[row_num][col_num + 2] == undefined) {
//下下个位置上不是树,也不是箱子,人物和箱子可以一起向上移动
box_array[row_num][col_num + 1]._x = ditu_array[row_num][col_num + 2]._x;
box_array[row_num][col_num + 2] = box_array[row_num][col_num + 1];
box_array[row_num][col_num + 1] = undefined;
my_person._x = ditu_array[row_num][col_num + 1]._x;
col_num++;
}
}
}
break;
case "下" :
if (ditu_array[row_num + 1][col_num].zhenghaoma != tree) {
if (box_array[row_num + 1][col_num] == undefined) {
//如果这个位置上没有箱子,人物可以向下移动
my_person._y = ditu_array[row_num + 1][col_num]._y;
row_num++;
} else {
//这里摆放有一个箱子
if (ditu_array[row_num + 2][col_num].zhenghaoma != tree && box_array[row_num + 2][col_num] == undefined) {
//下下个位置上不是墙,也不是箱子,人物和箱子可以一起向下移动
box_array[row_num + 1][col_num]._y = ditu_array[row_num + 2][col_num]._y;
box_array[row_num + 2][col_num] = box_array[row_num + 1][col_num];
box_array[row_num + 1][col_num] = undefined;
my_person._y = ditu_array[row_num + 1][col_num]._y;
row_num++;
}
}
}
break;
case "左" :
if (ditu_array[row_num][col_num - 1].zhenghaoma != tree) {
if (box_array[row_num][col_num - 1] == undefined) {
//如果这个位置上没有箱子,人物可以向上移动
my_person._x = ditu_array[row_num][col_num - 1]._x;
col_num--;
} else {
//这里摆放有一个箱子
if (ditu_array[row_num][col_num - 2].zhenghaoma != tree && box_array[row_num][col_num - 2] == undefined) {
//下下个位置上不是墙,也不是箱子,人物和箱子一起向上移动
box_array[row_num][col_num - 1]._x = ditu_array[row_num][col_num - 2]._x;
box_array[row_num][col_num - 2] = box_array[row_num][col_num - 1];
box_array[row_num][col_num - 1] = undefined;
my_person._x = ditu_array[row_num][col_num - 1]._x;
col_num--;
}
}
}
break;
}
}
//AD......
ad_btn.onRelease = function() {
getURL("http://www.taoshaw.com/", "_blank");
};
/*------------- www.taoshaw.com ---------------*/

FYP 2 - Game Homepage

First draft for the Game page (Start)

Tuesday, March 29, 2011

FYP 2 - Research on Game (Stage 3) & Sketch


Sample of maze design

Inspiration from the maze design and come out with this game (Stage 3). Below is my layout design and game play for stage 3

This is the last stage to complete your mission here. As you can see, there are 4 entrance to let you start the game. Once the game is started, you will counter several questions. Mission task is answer correctly each question and go to the final destination in order to complete this game. But, if you select wrong answer, the road been blocked and you have to choose another way to continue your journey. Beware of time given, think twice before you answer.

FYP 2 - Research on Game (Stage 2) & Sketch



========================================================

My final sketch. This stage is in the cave and user will facing several obstacles and they have to done this mission within the time given. While playing this game, the floor will getting slanting and the user will move to backward. To solve this problem, user have to try their best to answer every questions else they would lost their lives. User have to reach certain score only can proceed to next stage. The questions are all about the types of puppet and stages as well.

FYP 2 - Research on Game (Stage 1) & Sketch

This is my first ideation for the game (Stage 1). At first, I was thinking of doing a hunting treasure box kind of game, but I couldn't think a better way to let user learn something from the game. So, I took some elements from this game and invent a new game. Below is my layout design for the game (Stage 1)

  1. Questions about historical and types of puppetry.
  2. Cactus will pop out few selections to let user answer.
  3. User must use hammer to hit their answer to get the score.
  4. This is interesting, before you do anything to the game, all cactus will be in the sleeping mode. Once you answer correctly, cactus will immediately awake and cactus will gone after you answer correctly twice. But, make sure you can make a decision in a short time else cactus will sleep again.
  5. This is the bar showing how sleepiness cactus is.
  6. The score that you earn. To go to next stage, you have to reach a certain score. Score will lost once you choose a wrong answer.
  7. 3 lives will be given. Lives will deduct once user make cactus's sleepiness goes to danger zone and step on quicksand.
  8. Don't ever try to escape from answering questions and choose a short cut way. Once you step here, you lives will lost.