comparison webGL/dandy/resources/Character_state.js~ @ 11:680b5b0cd1e4

upload
author NOBUYASU Oshiro
date Mon, 12 Jul 2010 08:01:12 +0900
parents 1d76f5717ba7
children 61febc94fa62
comparison
equal deleted inserted replaced
10:a959cdca5b62 11:680b5b0cd1e4
6 if(p.flag == true) 6 if(p.flag == true)
7 { 7 {
8 p = p.state(p); 8 p = p.state(p);
9 } 9 }
10 } 10 }
11 }
12 function Putenemy(charano, x, y, vx, vy, chara_state)
13 {
14 var p = new Character();
15
16 p.collision = atari;
17 p.x = x;
18 p.y = y;
19 p.vx = vx;
20 p.vy = vy;
21 p.charano = charano;
22 // p.tama = tf;
23 // p.vit = enemystate[charano].p;
24 p.vit = 240;
25 // p.score = enemystate[charano].sc;
26 // p.s = 0;
27 p.flag = true;
28 p.state = chara_state;
29
30
31 loadEnemyImage(charano, p);//image の登録
32
33 active_chara_list.enemy.push(p);
34
35 }
36
37 function loadEnemyImage(charano, p)
38 {
39 p.image = enemy[charano];
40 p.texture = enemy[charano].texture;
41 p.w = enemy[charano].w;
42 p.h = enemy[charano].h;
43 } 11 }
44 12
45 noaction = function no_action(p) 13 noaction = function no_action(p)
46 { 14 {
47 p.state = noaction; 15 p.state = noaction;
76 p.x -= 0.25; 44 p.x -= 0.25;
77 p.y += p.vy; 45 p.y += p.vy;
78 p.state = chara_state2; 46 p.state = chara_state2;
79 return p; 47 return p;
80 } 48 }
49
50 chara_state3 = function character_state3( p )
51 {
52 p.x += p.vx;
53 p.y += p.vy;
54 if((p.dt1 == 60) ||
55 (p.dt1 == 90) ||
56 (p.dt1 == 30))
57 {
58 Puttama(0, p.x, p.y);
59 }
60 p.dt1++;
61 p.state = chara_state3;
62 return p;
63 }
64
65
81 66
82 chara_state8 = function character_state8( p ) 67 chara_state8 = function character_state8( p )
83 { 68 {
84 if(p.y > 0) 69 if(p.y > 0)
85 { 70 {