Mercurial > hg > Members > e085711
changeset 9:1d76f5717ba7
upload dandy4.html
author | NOBUYASU Oshiro |
---|---|
date | Sat, 10 Jul 2010 16:38:10 +0900 |
parents | 03b67cd2bde7 |
children | a959cdca5b62 |
files | webGL/dandy/dandy4.html webGL/dandy/resources/Character.js webGL/dandy/resources/Character.js~ webGL/dandy/resources/Character_state.js webGL/dandy/resources/Character_state.js~ webGL/dandy/resources/parse.js webGL/dandy/resources/parse.js~ webGL/dandy/resources/schedule.js webGL/dandy/resources/schedule.js~ |
diffstat | 9 files changed, 136 insertions(+), 73 deletions(-) [+] |
line wrap: on
line diff
--- a/webGL/dandy/dandy4.html Fri Jul 09 01:48:59 2010 +0900 +++ b/webGL/dandy/dandy4.html Sat Jul 10 16:38:10 2010 +0900 @@ -43,6 +43,7 @@ <script src="resources/keybord.js"> </script> <script src="resources/boss.js"> </script> <script src="resources/parse.js"> </script> + <script src="resources/bom.js"> </script> <script id="vshader" type="x-shader/x-vertex"> uniform mat4 u_modelViewProjMatrix; @@ -103,7 +104,8 @@ gl.enable(gl.TEXTURE_2D); - parseXml(gl);//parse.js + + parseXml(gl);//parse.js return gl; } @@ -147,6 +149,8 @@ state_update(); collision_detect(); + PutBom(ctx); + framerate.snapshot(); }
--- a/webGL/dandy/resources/Character.js Fri Jul 09 01:48:59 2010 +0900 +++ b/webGL/dandy/resources/Character.js Sat Jul 10 16:38:10 2010 +0900 @@ -62,7 +62,8 @@ // generate the model-view matrix var mvMatrix = new CanvasMatrix4(); - mvMatrix.scale(jiki.scale, jiki.scale, jiki.scale); + // mvMatrix.scale(jiki.scale, jiki.scale, jiki.scale); + mvMatrix.scale(glObj.scale, glObj.scale, glObj.scale); mvMatrix.translate(glObj.x,glObj.y,10); // construct the normal matrix from the model-view matrix
--- a/webGL/dandy/resources/Character.js~ Fri Jul 09 01:48:59 2010 +0900 +++ b/webGL/dandy/resources/Character.js~ Sat Jul 10 16:38:10 2010 +0900 @@ -15,6 +15,7 @@ { this.x=0; this.y=0; + this.scale=1.0; this.dx=0; this.dy=0; this.w=0; @@ -61,9 +62,7 @@ // generate the model-view matrix var mvMatrix = new CanvasMatrix4(); - mvMatrix.scale(1, 1, 1); - mvMatrix.translate(0,0,0); - mvMatrix.rotate(180, 0,0,1); + mvMatrix.scale(jiki.scale, jiki.scale, jiki.scale); mvMatrix.translate(glObj.x,glObj.y,10); // construct the normal matrix from the model-view matrix
--- a/webGL/dandy/resources/Character_state.js Fri Jul 09 01:48:59 2010 +0900 +++ b/webGL/dandy/resources/Character_state.js Sat Jul 10 16:38:10 2010 +0900 @@ -40,6 +40,12 @@ p.texture = enemy[charano].texture; p.w = enemy[charano].w; p.h = enemy[charano].h; + /* + p.image = bom[charano]; + p.texture = bom[charano].texture; + p.w = bom[charano].w; + p.h = bom[charano].h; + */ } noaction = function no_action(p)
--- a/webGL/dandy/resources/Character_state.js~ Fri Jul 09 01:48:59 2010 +0900 +++ b/webGL/dandy/resources/Character_state.js~ Sat Jul 10 16:38:10 2010 +0900 @@ -21,6 +21,7 @@ p.charano = charano; // p.tama = tf; // p.vit = enemystate[charano].p; + p.vit = 240; // p.score = enemystate[charano].sc; // p.s = 0; p.flag = true; @@ -80,55 +81,56 @@ chara_state8 = function character_state8( p ) { - /* - if(p.y < 520) + if(p.y > 0) { - teki0 = p; + p.y -= p.vy; + /* + tekino0 = 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; - return p; } chara_state9 = function character_state9( p ) { - /* + 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.y += 0.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); +// DefSpriteEx(54, 16,32); +// PutSpriteEx(54, p.x, p.y, p.s, p.s, 1); +// Putenemy(5, rinkx - 16, rinky -16, 1, 0, chara_state10); +// Putenemy(5, rinkx - 16, rinky -16, -1, 0, chara_state10); + PutBoss(2, rinkx - 16, rinky -16, 1, 0, chara_state10); + PutBoss(2, 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; @@ -141,43 +143,39 @@ 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); + // 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; } chara_state12 = function character_state12( p ) { - /* if(fastebos > 60+60) { - if(p.y > 240+32) + if(p.y > 70+boss[1].h) { p.state = delete_chara; } - p.y += 3; - rinky += 3; + p.y += 0.3; + rinky += 0.3; count++; - DefSpriteEx(54, 16, 32); - PutSpriteEx(54, p.x, p.y, 2, 2, 1); - p.state = chara_state12; + // DefSpriteEx(54, 16, 32); + // PutSpriteEx(54, p.x, p.y, 2, 2, 1); + p.state = chara_state12; return p; } if(p.dt1 <= 60) @@ -198,9 +196,9 @@ { if(p.dt1 % 2 == 1) { - Puttama(0, rinkx - 16, rinky); - Puttama(0, rinkx, rinky); - Puttama(0, rinkx + 16, rinky); + // Puttama(0, rinkx - 16, rinky); + // Puttama(0, rinkx, rinky); + // Puttama(0, rinkx + 16, rinky); } } if((p.dt1 > 180) && (p.dt1 <= 240)) @@ -208,8 +206,8 @@ if(p.dt1 % 2 == 1) { rinkf2 = 1; - Puttama(2, rinkx - 16, p.y -32); - Puttama(3, rinkx + 32 - 16, p.y - 32); + // Puttama(2, rinkx - 16, p.y -32); + // Puttama(3, rinkx + 32 - 16, p.y - 32); } else { @@ -223,7 +221,7 @@ if((p.dt1 > 240) && (p.dt1 <= 400)) { count++; - PutSprite(count, rinkx - 16, rinky + 32, 58 + p.dt1 %4) + // PutSprite(count, rinkx - 16, rinky + 32, 58 + p.dt1 %4) } if((p.dt1 > 300) && (p.dt1 <= 400)) { @@ -237,10 +235,10 @@ p.vx = +1; } else p.vx = 0; - p.x += -.vx; + p.x += p.vx; rinkx = p.x; rinky = p.y; - Puttama(4, rinkx - 8, rinky + 16); +// Puttama(4, rinkx - 8, rinky + 16); } if((p.dt1 > 400) && (p.dt1 <= 500)) { @@ -282,25 +280,23 @@ fastebos++; p.dt1++; count++; - DefSpriteEx(54, 16, 32); - PutSpriteEx(54, p.x, p.y, 2, 2, 1); - */ + // DefSpriteEx(54, 16, 32); + // PutSpriteEx(54, p.x, p.y, 2, 2, 1); + p.state = chara_state12; return p; } chara_state13 = function character_state13(p) { - /* if(tekino0.flag == false) { - Bom(p.x, p.y); + // 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; @@ -315,19 +311,18 @@ if(rinkf2 == 4) { count++; - PutSprite(count, p.x, p.y + 56, 58+filpcount % 4); + // 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); + // Puttama(5, p.x + 8, p.y + 24); } if(p.x < rinkx) { - Puttama(5, p.x + 8, p.y + 24); + // Puttama(5, p.x + 8, p.y + 24); } } - */ return p; }
--- a/webGL/dandy/resources/parse.js Fri Jul 09 01:48:59 2010 +0900 +++ b/webGL/dandy/resources/parse.js Sat Jul 10 16:38:10 2010 +0900 @@ -1,5 +1,6 @@ function parseXml(gl) { + loadCharaXml(gl, "./xml/character.xml");//gl.charaにxmlファイルの中身を入れる loadEffectXml(gl, "./xml/effect.xml");//gl.effectにxmlファイルの中身をいれる loadBossXml(gl, "./xml/boss.xml");//gl.bossにxmlファイルの中身を入れる @@ -14,6 +15,9 @@ bullets = [];//弾の情報を入れておく配列を用意、グローバル pushPlayerBullets(gl,bullets);//配列bullets[]に弾をpush + + bom = [];//撃破時の爆発の情報をいれておく配列を用意。グローバル + pushBom(gl, bom);//配列 bom[]に爆発をpush } function loadCharaXml(gl,url) @@ -83,3 +87,14 @@ // return bullets; } +function pushBom(gl, bom) +{ + bom.push(gl.effect["redbomb_anim_1"]); + bom.push(gl.effect["redbomb_anim_2"]); + bom.push(gl.effect["redbomb_anim_3"]); + bom.push(gl.effect["redbomb_anim_4"]); + bom.push(gl.effect["redbomb_anim_5"]); + bom.push(gl.effect["redbomb_anim_6"]); + bom.push(gl.effect["redbomb_anim_7"]); + +} \ No newline at end of file
--- a/webGL/dandy/resources/parse.js~ Fri Jul 09 01:48:59 2010 +0900 +++ b/webGL/dandy/resources/parse.js~ Sat Jul 10 16:38:10 2010 +0900 @@ -1,3 +1,33 @@ +function parseXml(gl) +{ + loadCharaXml(gl, "./xml/character.xml");//gl.charaにxmlファイルの中身を入れる + loadEffectXml(gl, "./xml/effect.xml");//gl.effectにxmlファイルの中身をいれる + loadBossXml(gl, "./xml/boss.xml");//gl.bossにxmlファイルの中身を入れる + + jiki = new makePlayer(gl.chara);//自機の情報をいれておくクラス、グローバル + + enemy = [];//敵の情報を入れておく配列を用意、グローバル + pushEnemy(gl,enemy);//配列enemy[]に敵をpush + + boss = [];//bossの情報を入れておく配列を用意,グローバル + pushBoss(gl, boss);//配列boss[]にbossの情報をpush + + bullets = [];//弾の情報を入れておく配列を用意、グローバル + pushPlayerBullets(gl,bullets);//配列bullets[]に弾をpush +} + +function loadCharaXml(gl,url) +{ + if(gl.chara == undefined) gl.chara = new Object(); + var xmlChara = new Object(); + xmlChara = parsePanel(url); + for (var name in xmlChara) + { + gl.chara[name] = makeXmlObj(gl, xmlChara[name]); + gl.chara[name].texture = loadImageTexture(gl, xmlChara[name].image); + } +} + function loadEffectXml(gl,url) { if(gl.effect == undefined)gl.effect = new Object(); @@ -10,33 +40,46 @@ } } +function loadBossXml(gl,url) +{ + if(gl.boss == undefined)gl.boss = new Object(); + var xmlChara = new Object(); + xmlChara = parsePanel(url); + for (var name in xmlChara) + { + gl.boss[name] = makeXmlObj(gl, xmlChara[name]); + gl.boss[name].texture = loadImageTexture(gl, xmlChara[name].image); + } +} -function parseEnemy(gl) +function pushBoss(gl, boss) { - var enemy = []; + for(var name in gl.boss) + { + boss.push(gl.boss[name]); + } +} + + +function pushEnemy(gl, enemy) +{ enemy.push(gl.chara["enemy_greenclab"]); enemy.push(gl.chara["missile"]); enemy.push(gl.chara["gunbattery"]); enemy.push(gl.chara["meteo"]); - return enemy; } -function parseBoss(gl) + + +function pushPlayerBullets(gl,bullets) { - var boss = []; - for(var name in gl.boss) - { - boss.push(gl.boss[name]); - } - return boss; + // if(bullets == undefined) var bullets = []; + bullets.push(gl.effect["bluebarrier"]); + bullets.push(gl.effect["bulebullet_left"]); + bullets.push(gl.effect["bulebullet_right"]); + bullets.push(gl.effect["redbullet"]); + bullets.push(gl.effect["greenbullet"]); + bullets.push(gl.effect["lonlaser"]); + // return bullets; } -function parseBullet(gl) -{ - var bullets = []; - for(var name in gl.bullet) - { - bullets.push(gl.bullet[name]); - } - return bullets; -}
--- a/webGL/dandy/resources/schedule.js Fri Jul 09 01:48:59 2010 +0900 +++ b/webGL/dandy/resources/schedule.js Sat Jul 10 16:38:10 2010 +0900 @@ -8,7 +8,8 @@ case 1: break; case FRAME_RATE * 2: - Putenemy(0, 30, 80, 0, 0.3, chara_state1); + bom2(30,80); + // Putenemy(0, 30, 80, 0, -0.3, chara_state0); // for(var x = 0; x < 1000; x+=2){ // Putenemy(0, x-50, 80, 0, 0.3, 1); // }
--- a/webGL/dandy/resources/schedule.js~ Fri Jul 09 01:48:59 2010 +0900 +++ b/webGL/dandy/resources/schedule.js~ Sat Jul 10 16:38:10 2010 +0900 @@ -8,7 +8,6 @@ case 1: break; case FRAME_RATE * 2: - // PutBoss(1, 0, 80, 0, 1, chara_state8); // 1面ボスをPutenemy Putenemy(0, 30, 80, 0, 0.3, chara_state1); // for(var x = 0; x < 1000; x+=2){ // Putenemy(0, x-50, 80, 0, 0.3, 1);