Mercurial > hg > Members > e085711
diff webGL/dandy/resources/Character_state.js~ @ 7:4343c1feedb5
upload boss.js xmlAlpha file
author | NOBUYASU Oshiro |
---|---|
date | Mon, 05 Jul 2010 17:19:51 +0900 |
parents | 881478004f18 |
children | 1d76f5717ba7 |
line wrap: on
line diff
--- a/webGL/dandy/resources/Character_state.js~ Mon Jun 21 17:37:26 2010 +0900 +++ b/webGL/dandy/resources/Character_state.js~ Mon Jul 05 17:19:51 2010 +0900 @@ -3,54 +3,55 @@ for(var i = 0; Boolean(active_chara_list.enemy[i]) ; i++) { var p = active_chara_list.enemy[i]; - if(p.f == true) + if(p.flag == true) { p = p.state(p); } } } - function Putenemy(charano, x, y, vx, vy, chara_state) { - var p = new Character(); - - // p.collision = atari; + p.collision = atari; p.x = x; p.y = y; p.vx = vx; p.vy = vy; + p.charano = charano; // p.tama = tf; // p.vit = enemystate[charano].p; // p.score = enemystate[charano].sc; // p.s = 0; - p.f = true; - loadState(chara_state, p); - loadImage(charano, p); - - active_chara_list.enemy.push(p); -} -function Putenemy2(charano, x, y, vx, vy, chara_state) -{ - - var p = new Character(); + p.flag = true; + p.state = chara_state; - // p.collision = atari; - p.x = x; - p.y = y; - p.vx = vx; - p.vy = vy; - // p.tama = tf; - // p.vit = enemystate[charano].p; - // p.score = enemystate[charano].sc; - // p.s = 0; - p.f = true; - p.state = chara_state; - loadImage(charano, p); + loadEnemyImage(charano, p);//image の登録 active_chara_list.enemy.push(p); + +} + +function loadEnemyImage(charano, p) +{ + p.image = enemy[charano]; + p.texture = enemy[charano].texture; + p.w = enemy[charano].w; + p.h = enemy[charano].h; +} + +noaction = function no_action(p) +{ + p.state = noaction; + return p; +} + +delete_chara = function delete_character( p ) +{ + p.state = noaction; + p.flag = false; + return p; } chara_state0 = function character_state0( p ) @@ -77,36 +78,256 @@ return p; } +chara_state8 = function character_state8( p ) +{ + /* + if(p.y < 520) + { + teki0 = p; + kyeenmyno = p; + p.y += p.vy; + count++; + DefSpriteEx(p.charano, 16*4, 32*4); + PutSpriteEx(p.charano, (p.x * 4), (p.y * 4), 0.2, 0.2, 1); + p.dt1 = 512; + p.s = 0.125; + p.state = chara_state8; + return p; + } + */ + p.state = chara_state9; -function loadState(charano, p) + return p; +} + +chara_state9 = function character_state9( p ) { - if(charano == 0) p.state = chara_state0; - if(charano == 1) p.state = chara_state1; - if(charano == 3) p.state = chara_state1; - if(charano == 4) p.state = chara_state1; + /* + if(p.s <= 2) + { + p.s += 0.05 + p.y -= 12; + // count++; + DefSpriteEx(54, 16*4, 32*4); + PutSpriteEx(54, (p.x * 4), (p.y * 4), p.x, p.x, 1); + p.state = chara_state9; + return p; + } + count++; + DefSpriteEx(54, 16,32); + PutSpriteEx(54, p.x, p.y, p.s, p.s, 1); + rinkx = p.x; + rinky = p.y; + Putenemy(5, rinkx - 16, rinky -16, 1, 0, chara_state10); + Putenemy(5, rinkx - 16, rinky -16, -1, 0, chara_state10); + p.state = chara_state11; + p.dt1 = 8192; + */ + return p; +} + +chara_state10 = function character_state10( p ) +{ + /* + if(p.dt1 < 48) + { + p.x += p.vx; + p.y += p.vy; + p.dt1++; + p.state = chara_state10; + return p; + } + rinkf1 = 1; + p.dt1 = rinkx; + p.dt2 = rinky; + p.state = chara_state13; + */ + return p; +} + +chara_state11 = function character_state11( p ) +{ + /* + if(rinkf1 == 0) + { + count++; + DefSpriteEx(54, 16, 32); + PutSpriteEx(54, p.x, p.y, p.s, p.s, 1); + p.state = chara_state11; + return p; + } + p.dt1 = 0; + p.dt2 = 0; + p.state = chara_state12; + */ + return p; } -function loadImage(charano, p) +chara_state12 = function character_state12( p ) { - if(charano == 0) + /* + if(fastebos > 60+60) + { + if(p.y > 240+32) + { + p.state = delete_chara; + } + p.y += 3; + rinky += 3; + count++; + DefSpriteEx(54, 16, 32); + PutSpriteEx(54, p.x, p.y, 2, 2, 1); + p.state = chara_state12; + return p; + } + if(p.dt1 <= 60) { - p.image = enemy[0]; - p.texture = enemy[0].texture; + if(jiki.x + 15 -rinkx < -5) + { + p.vx = -0.3; + } + else if(jiki.x + 15 - rinkx > 5) + { + p.vx = +0.8; + } + else p.vx = 0; + rinkx = p.x; + rinky = p.y; } - if(charano == 1) + if((p.dt1 > 60) && (p.dt1 <= 70)) + { + if(p.dt1 % 2 == 1) + { + Puttama(0, rinkx - 16, rinky); + Puttama(0, rinkx, rinky); + Puttama(0, rinkx + 16, rinky); + } + } + if((p.dt1 > 180) && (p.dt1 <= 240)) + { + if(p.dt1 % 2 == 1) + { + rinkf2 = 1; + Puttama(2, rinkx - 16, p.y -32); + Puttama(3, rinkx + 32 - 16, p.y - 32); + } + else + { + rinkf2 = 2; + } + } + if(p.df1 > 240) + { + rinkf2 = 2; + } + if((p.dt1 > 240) && (p.dt1 <= 400)) { - p.image = enemy[1]; - p.texture = enemy[1].texture; + count++; + PutSprite(count, rinkx - 16, rinky + 32, 58 + p.dt1 %4) } - if(charano == 2) + if((p.dt1 > 300) && (p.dt1 <= 400)) + { + rinkf2 = 3; + if(jiki.x + 15 - rinkx < -5) + { + p.vx = -1; + } + else if(jiki.x + 15 - rinkx > 5) + { + p.vx = +1; + } + else p.vx = 0; + p.x += -.vx; + rinkx = p.x; + rinky = p.y; + Puttama(4, rinkx - 8, rinky + 16); + } + if((p.dt1 > 400) && (p.dt1 <= 500)) { - p.image = enemy[2]; - p.texture = enemy[2].texture; + rinkf2 = 4; + if(jiki.x + 15 - rinkx > 5) + { + p.vx = -1; + } + else if(jiki.x + 15 - rinkx >5) + { + p.vx = +1; + } + else p.vx = 0; + p.x += p.vx; + rinkx = p.x; + rinky = p.y; } - if(charano == 3) + if(p.dt1 > 500) { - p.image = enemy[3]; - p.texture = enemy[3].texture; + rinkf2 = 5; + if(jiki.x + 15 - rinkx < -5) + { + p.vx = -1; + } + else if(jiki.x + 15 - rinkx > 5) + { + p.vx = +1; + } + else p.vx = 0; + p.x += p.vx; + rinkx = p.x; + rinky = p.y; } + if(p.dt1 > 600) + { + rinkf2 = 0; + p.dt1 = 0; + } + fastebos++; + p.dt1++; + count++; + DefSpriteEx(54, 16, 32); + PutSpriteEx(54, p.x, p.y, 2, 2, 1); + */ + return p; + } +chara_state13 = function character_state13(p) +{ + /* + if(tekino0.flag == false) + { + Bom(p.x, p.y); + p.flag = false; + p.state = delete_chara; + p.collision = noaction; + return p; + } + + p.x += rinkx - p.dt1; + p.y += rinky -p.dt2; + p.dt1 = rinkx; + p.dt2 = rinky; + if(rinkf2 == 1) + { + if(p.x > rinkx) + { + Puttama(2, p.x + 32, p.y); + } + } + if(rinkf2 == 4) + { + count++; + PutSprite(count, p.x, p.y + 56, 58+filpcount % 4); + } + if(rinkf2 == 5) + { + if(p.x > rinkx) + { + Puttama(5, p.x + 8, p.y + 24); + } + if(p.x < rinkx) + { + Puttama(5, p.x + 8, p.y + 24); + } + } + */ + return p; +}