comparison webGL/dandy/resources/Character_state.js @ 16:527eac9a7d0b

update
author NOBUYASU Oshiro
date Sat, 17 Jul 2010 12:56:57 +0900
parents a2b31fe50d9d
children 2018ad94fd9b
comparison
equal deleted inserted replaced
15:7f68fc18554a 16:527eac9a7d0b
374 } 374 }
375 return p; 375 return p;
376 } 376 }
377 377
378 378
379 chara_state20 = function character_state(p) 379 chara_state20 = function character_state20(p)
380 { 380 {
381 p.x += p.vx; 381 p.x += p.vx;
382 p.y += p.vy; 382 p.y += p.vy;
383 p.vx -= 0.5*d_x; 383 p.vx -= 0.5*d_x;
384 p.vy += 0.4*d_y; 384 p.vy += 0.4*d_y;
395 } 395 }
396 396
397 chara_state22 = function character_state22(p) 397 chara_state22 = function character_state22(p)
398 { 398 {
399 sf = Math.random() % 4; 399 sf = Math.random() % 4;
400 sf = parseInt(sf);
400 if((sf == 0) || (sf == 1)) 401 if((sf == 0) || (sf == 1))
401 { 402 {
402 p.x = -35; 403 p.x = -35*d_x;
403 p.y = Math.random() % (120 - 35); 404 p.y = Math.random() % (120 - 35)*d_y;
404 p.vx = (Math.random() % 4 + 1); 405 p.vx = (Math.random() % 4 + 1)*d_x;
405 p.vy = Math.random() % 3 + 1; 406 p.vy = ( Math.random() % 3 + 1 )*d_y;
406 p.state = chara_state23; 407 p.state = chara_state23;
407 } 408 }
408 if((sf == 2)) 409 if((sf == 2))
409 { 410 {
410 p.x = Math.random() % 290; 411 p.x = ( Math.random() % 290 )*d_x;
411 p.y = -30; 412 p.y = -30 * d_y;
412 p.vx = Math.random() % 3 - 1; 413 p.vx = ( Math.random() % 3 - 1 )*d_x;
413 p.vy = (Math.random() % 4 + 1); 414 p.vy = ( (Math.random() % 4 + 1) )*d_y;
414 p.state = chara_state23; 415 p.state = chara_state23;
415 } 416 }
416 if(sf == 3) 417 if(sf == 3)
417 { 418 {
418 p.x = 320; 419 p.x = ( 320 )*d_x;
419 p.y = Math.random() % (120 - 35); 420 p.y = ( Math.random() % (120 - 35) )*d_y;
420 p.vx = (Math.random() % 4 + 1) * -1; 421 p.vx = ( (Math.random() % 4 + 1) * -1 ) *d_x;
421 p.vy = Math.random() % 3 -1; 422 p.vy = ( Math.random() % 3 -1 ) *d_y;
422 p.state = chara_state23; 423 p.state = chara_state23;
423 } 424 }
424 return p; 425 return p;
425 } 426 }
426 427
427 428 chara_state23 = function character_state32(p)
429 {
430 /*本当はこの 2 行だけ
431 p=asteroid(p);
432 return p;
433 */
434
435 //
436 p.x += p.vx;
437 p.y += p.vy;
438 p.state = chara_state23;
439 return p;
440 }
428 441
429 chara_state400 = function character_state400(p) 442 chara_state400 = function character_state400(p)
430 { 443 {
431 p.vy++; 444 p.vy++;
432 p.y += p.vy / 4; 445 p.y += p.vy / 4;