- Timestamp:
- 02/24/08 07:10:10 (9 months ago)
- Location:
- lang/d/koke/trunk
- Files:
-
- 3 modified
-
build.bat (modified) (1 diff)
-
character.d (modified) (4 diffs)
-
gamecore.d (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/d/koke/trunk/build.bat
r6898 r7081 9 9 @echo off 10 10 if NOT ERRORLEVEL 1 GOTO RUN 11 pause 11 12 goto END 12 13 13 14 :RUN 14 15 koke.exe 15 make -fMakefile.dmd.win32 obj-clean16 #make -fMakefile.dmd.win32 obj-clean 16 17 goto END 17 18 18 19 :END 19 pause20 20 -
lang/d/koke/trunk/character.d
r6962 r7081 52 52 [ false , true , true , false , false , true , true ]; // 衝突判定の有無 53 53 static const int type_life_dec[] = 54 [ 0 , 40 , 0 , 0 , 0 , 40 , 80 ]; // ライフ減少時間(フレーム)54 [ 0 , 40 , 0 , 0 , 0 , 40 , 40 ]; // ライフ減少時間(フレーム) 55 55 56 56 // 方向 … … 211 211 case TYPE.RAINBOW_RAY: 212 212 if(motion == MOTION.NORMAL) setMotion(MOTION.WALK); 213 destroyNeig bor();213 destroyNeighbor(); 214 214 break; 215 215 … … 396 396 } 397 397 398 void destroyNeighbor(){ 399 destroyMap(cast(int)position.x , cast(int)position.y); 400 } 398 401 // ぶっとばすぞー 399 void destroyNeigbor(){ 400 for(int x=-1;x<2;x++){ 401 for(int y=-1;y<2;y++){ 402 int px = cast(int)position.x + x; 403 int py = cast(int)position.y + y; 404 405 if(!gamemain.map.isMap( px , py , MapChip.TYPE.NONE)){ 402 void destroyMap(int xx,int yy,int size = 1, bool all = false){ 403 for(int x=-size;x<=size;x++){ 404 for(int y=-size;y<=size;y++){ 405 int px = xx + x; 406 int py = yy + y; 407 408 if(gamemain.map.isMap( px , py , MapChip.TYPE.MOVIE) || (all && !gamemain.map.isMap( px , py , MapChip.TYPE.NONE))){ 409 gamemain.map.set( px , py , MapChip.TYPE.NONE); 406 410 Character c = gamemain.charpool.set( new Vec3(px , py , 0) , TYPE.EXPLODE); 407 411 if(c){ … … 409 413 } 410 414 } 411 gamemain.map.set ( px , py , MapChip.TYPE.NONE);415 gamemain.map.setGrass( px , py , 0 ); 412 416 413 417 Character ch[] = gamemain.charpool.getCharacterAtMap(px,py); -
lang/d/koke/trunk/gamecore.d
r6962 r7081 27 27 private import map; 28 28 29 private import std.math; 30 29 31 /********************************************************************************/ 30 32 … … 64 66 int config_reload_timer; // 「コンフィグをリロードした」表示用 65 67 68 int mray_timer; // 運営レーザー用タイマ 69 70 int shake_power; // 画面ゆれ強度 71 66 72 static const int CONFIG_RELOAD_CHECK_INTERVAL = 40 * 5; // コンフィグ再読み込み確認 67 73 static const int CONFIG_RELOAD_SHOW_INTERVAL = 40 * 3; // 「コンフィグ読み込んだ」表示時間 74 75 // 運営レーザー用タイマー数値 76 static const int MRAY_TIMER_FIRST_WAIT = 40; // 待ち 77 static const int MRAY_TIMER_SECOND_TARGET = 80; // ターゲット 68 78 69 79 this() … … 74 84 configparser.load(CONFIG_PATH); 75 85 config_reload_timer = 0; 86 87 mray_timer = 0; 88 shake_power = 0; 76 89 77 90 int mapw = configparser.getint("MAP_WIDTH"); … … 187 200 case "manage_ray": 188 201 // 運営レーザー コマンド 189 // TODO:実装する 202 mray_timer++; 203 if(mray_timer > MRAY_TIMER_SECOND_TARGET){ 204 shake_power = 16; 205 Character c = charpool.set( new Vec3(cursor_x , cursor_y , 0) , Character.TYPE.EXPLODE); 206 c.destroyMap(cursor_x , cursor_y , Hell_randInt(0,5) , true); // 一次的な対応 207 c.setMotion(Character.MOTION.VANISH); 208 } 190 209 break; 191 210 … … 216 235 break; 217 236 } 237 }else{ 238 mray_timer = 0; 239 if(shake_power > 0)shake_power--; 218 240 } 219 241 // 右クリック … … 271 293 resetPerspective(); 272 294 Hell_setAlpha(HELL_ALPHA_NORMAL); 295 296 // 画面ゆれ 297 double shake_x = 0 , shake_y = 0; 298 if(shake_power > 0){ 299 shake_x = Hell_randInt(-shake_power , shake_power); 300 shake_y = Hell_randInt(-shake_power , shake_power)/2; 301 } 302 map.draw_ofs_x += shake_x; 303 map.draw_ofs_y += shake_y; 273 304 274 305 map.draw(); … … 296 327 } 297 328 329 // 運営レーザー 330 if(mray_timer > 0 && map.inRange(cursor_x,cursor_y)){ 331 static const int CHIP_CENTER_OFFSET_X = 16; 332 static const int CHIP_CENTER_OFFSET_Y = 24; 333 334 double mx = map.toViewX(cursor_x,cursor_y); 335 double my = map.toViewY(cursor_x,cursor_y); 336 if(mray_timer < MRAY_TIMER_FIRST_WAIT){ 337 int alpha = 255 * mray_timer / MRAY_TIMER_FIRST_WAIT; 338 Hell_drawRect(cast(int)mx - 2 + CHIP_CENTER_OFFSET_X , 0 339 , 5, cast(int)my + CHIP_CENTER_OFFSET_Y , 0 340 , 0 , 255,160,32,alpha / 4); 341 Hell_drawRect(cast(int)mx + CHIP_CENTER_OFFSET_X , 0 342 , 1, cast(int)my + CHIP_CENTER_OFFSET_Y , 0 343 , 0 , 255,160,32,alpha); 344 }else if(mray_timer < MRAY_TIMER_SECOND_TARGET){ 345 Hell_drawRect(cast(int)mx - 2 + CHIP_CENTER_OFFSET_X , 0 346 , 5, cast(int)my + CHIP_CENTER_OFFSET_Y , 0 347 , 0 , 255,160,32,64); 348 Hell_drawRect(cast(int)mx + CHIP_CENTER_OFFSET_X , 0 349 , 1, cast(int)my + CHIP_CENTER_OFFSET_Y , 0 350 , 0 , 255,160,32); 351 352 for(double rr=1;rr<3;rr++){ 353 for(double t=0;t<PI*2;t+=PI/8){ 354 double tr = cast(double)(MRAY_TIMER_SECOND_TARGET - mray_timer) / (MRAY_TIMER_SECOND_TARGET - MRAY_TIMER_FIRST_WAIT); 355 double vx1 = 8.0 * rr*rr * std.math.sin(t+PI/8) * tr + cursor_x; 356 double vy1 = 8.0 * rr*rr * std.math.cos(t+PI/8) * tr + cursor_y; 357 double vx2 = 8.0 * rr*rr * std.math.sin(t) * tr + cursor_x; 358 double vy2 = 8.0 * rr*rr * std.math.cos(t) * tr + cursor_y; 359 360 Hell_drawLine( map.toViewX(vx1,vy1) + CHIP_CENTER_OFFSET_X , map.toViewY(vx1,vy1) + CHIP_CENTER_OFFSET_Y 361 , map.toViewX(vx2,vy2) + CHIP_CENTER_OFFSET_X , map.toViewY(vx2,vy2) + CHIP_CENTER_OFFSET_Y 362 , 8 ,255,196,32,92); 363 Hell_drawLine( map.toViewX(vx1,vy1) + CHIP_CENTER_OFFSET_X , map.toViewY(vx1,vy1) + CHIP_CENTER_OFFSET_Y 364 , map.toViewX(vx2,vy2) + CHIP_CENTER_OFFSET_X , map.toViewY(vx2,vy2) + CHIP_CENTER_OFFSET_Y 365 , 1 ,255,196,32,196); 366 } 367 } 368 }else{ 369 for(int t=0;t<32;t++){ 370 int w = Hell_randInt(1,16); 371 if(t > 24){ 372 Hell_drawRect(cast(int)mx + Hell_randInt(-8,8) - w/2 + CHIP_CENTER_OFFSET_X , 0 373 , w , cast(int)my + CHIP_CENTER_OFFSET_Y + Hell_randInt(-8,8) 374 , 0 , 0, 375 255,255,255,128); 376 }else if(t > 8){ 377 Hell_drawRect(cast(int)mx + Hell_randInt(-16,16) - w/2 + CHIP_CENTER_OFFSET_X , 0 378 , w , cast(int)my + CHIP_CENTER_OFFSET_Y + Hell_randInt(-8,8) 379 , 0 , 0, 380 255,255,32,128); 381 }else{ 382 Hell_drawRect(cast(int)mx + Hell_randInt(-32,32) - w/2 + CHIP_CENTER_OFFSET_X , 0 383 , w , cast(int)my + CHIP_CENTER_OFFSET_Y + Hell_randInt(-8,8) 384 , 0 , 0, 385 255,160,32,128); 386 } 387 } 388 } 389 Hell_drawFont("T:" ~ std.string.toString(mray_timer) , mouse_x - 32 , mouse_y - 0); 390 } 391 298 392 // 種類別キャラクタ数表示(左上) 299 393 for(int t=0;t<Character.TYPE.MAX;t++){ … … 320 414 , 1 , 255,128,0); 321 415 } 416 417 // 画面ゆれ・ズレ分を元に戻す 418 map.draw_ofs_x -= shake_x; 419 map.draw_ofs_y -= shake_y; 322 420 323 421 // fps/cpu
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)