Wednesday, April 20, 2011

FYP 2 - Critique 2 Working Progress 4 (Game)

Coding (Sleeping Mode)

function sleep(milliseconds) {
hiddenInterval = setInterval(sleepwait, milliseconds);
}

function
sleepwait() {
stopSleeping();
}


function
stopSleeping() {
clearInterval(hiddenInterval);
}

FYP 2 - Critique 2 Working Progress 3

I started with my first game with the existing source code and I and I stuck already ><

This is the modified version game, the enemies manage to stop moving but it's still appear in my game and just couldn't move around. My main problem is stuck when the player touch the remarks, I couldn't add in my questions as the remarks are appear randomly and my game is there each remark carry out different Q&A.


FYP 2 - Critique 2 Working Progress 2

This is my second edition of layout design that done in flash. A complete animated flash application. Following are my screen shots of every pages. The game will be update soon. ^^

Homepage

History page

Puppetry Page

Puppets Page

Friday, April 8, 2011

FYP 2 - Critique 2 Working Progress

This is my new layout design for my flash application. I'm still working on this layout and feel like it doesn't convey any Chinese feeling. So, some Chinese landscape painting will be add in as the background design and will modify the colours that looks more like a Chinese application.

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)