2022年 5月 27日
ゲームスタート時に、色々な設定をできるスタート画面を作った。
設定できるのは「マップサイズ」「プレイヤー人数」「操作人数」「国の数」「キャラクターユニットの登場数」「ユーザーカラーの使用」「マップ表示速度」「戦闘表示速度」「戦闘表示種類」となっている。
SUI(スクロール・ユーザー・インターフェイス、適当)の考えにより、画面は縦にスクロールする。
マップサイズは画面の x(横)の大きさ事で、1~3画面まで設定できる。
プレイヤー数は勢力数の事で、最大 20勢力で争う事ができる。
操作人数は操作する勢力数の事で、普通は 1人、これは最大勢力数まで、つまり全員操作まで設定できる。
LANDは国の数、各勢力の国数が均等になるように、勢力数の倍数になるようにしている。
キャラクターユニットは、0なら出現無し、1~3はそのレベルのキャラクターユニットまで出現する。
レベル 1なら、Lv1の攻撃指揮官、防御指揮官、軍師、民生官、君主が出る。
ゲームレベルはゲームの難易度を設定する、1が簡単~5が難しい。
ユーザーカラーは USE(使う)の時にオリジナルカラーをプレイヤー 1に設定できる。
オリジナルカラーは元の色はシルバーで、その色を変えて使う。
ランダムの場合は 20色をバラバラに割り当てる。
マップの表示ウエイトを設定できます。
戦闘の表示ウエイトを設定できます。
戦闘表示の種類、画面切り替え ← → 簡易表示の設定をします。
以上を任意に設定して右下の STARTを押すとゲームが始まります。
ソース
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 |
////////// ゲームスタート /////////// *game_start_ini gs_ly=0 ; スクロール座標 gs_cly1=109 ; 背景分割ライン1 gs_cly2=829 ; 背景分割ライン2 gs_fgx1=245 ; 数字のケタ gs_fgx2=270-50-1 gs_fgx3=270+1 gs_fgx4=270-75-2 gs_fgx5=270-25 gs_fgx6=270+25+2 ; 矢印上下 gs_arux=540/2-192/2 gs_aruy=gs_cly1-23 gs_ardx=gs_arux gs_ardy=gs_cly2+8 gs_arux1=170 gs_arux2=370 gs_aruy1=gs_aruy-4 gs_aruy2=gs_cly1-3 gs_ardx1=170 gs_ardx2=370 gs_ardy1=gs_ardy-4 gs_ardy2=gs_ardy1+24 ; キー入力 dim gs_kx1,11 dim gs_kx2,11 dim gs_ky1,11 dim gs_ky2,11 ; MAP SIZE gs_sy1=117 gs_msx1=102 gs_msx2=245 gs_msx3=388 gs_msy1=gs_sy1+79 ; PLAYR gs_sy2=gs_sy1+185 gs_kx1(1)=70 gs_kx2(1)=gs_kx1(1)+130 gs_ky1(1)=gs_sy2+46 gs_ky2(1)=gs_ky1(1)+120 gs_kx1(2)=340 gs_kx2(2)=gs_kx1(2)+130 gs_ky1(2)=gs_ky1(1) gs_ky2(2)=gs_ky2(1) ; OPERATION PLAYER gs_sy3=gs_sy2+185 gs_kx1(3)=70 gs_kx2(3)=gs_kx1(3)+130 gs_ky1(3)=gs_sy3+46 gs_ky2(3)=gs_ky1(3)+120 gs_kx1(4)=340 gs_kx2(4)=gs_kx1(4)+130 gs_ky1(4)=gs_ky1(3) gs_ky2(4)=gs_ky2(3) ; LAND gs_sy4=gs_sy3+183 gs_kx1(5)=70 gs_kx2(5)=gs_kx1(5)+130 gs_ky1(5)=gs_sy4+46 gs_ky2(5)=gs_ky1(5)+120 gs_kx1(6)=340 gs_kx2(6)=gs_kx1(6)+130 gs_ky1(6)=gs_ky1(5) gs_ky2(6)=gs_ky2(5) ; CHARACTER UNIT gs_sy5=gs_sy4+197 dim gs_cux,4 k=109 gs_cux(0)=84 gs_cux(1)=gs_cux(0)+k gs_cux(2)=gs_cux(1)+k gs_cux(3)=gs_cux(2)+k gs_cuy1=gs_sy5+83 ; GAME LEVEL gs_sy6=gs_sy5+201 dim gs_lvx,6 k=92 gs_lvx(1)=61 gs_lvx(2)=gs_lvx(1)+k gs_lvx(3)=gs_lvx(2)+k gs_lvx(4)=gs_lvx(3)+k gs_lvx(5)=gs_lvx(4)+k gs_lvy1=gs_sy6+83 ; COLOR CHANGE gs_sy8=gs_sy6+202;246 gs_sy9=gs_sy8+73 gs_c9x1=115 ; USE gs_c9x2=288 ; RANDOM gs_ccx1=94 ; ゲージ gs_ccy1=gs_sy9+74 gs_ccy2=gs_sy9+149 gs_ccy3=gs_sy9+224 ; Map display speed gs_sy10=gs_sy9+344 dim gs_mdx,6 k=92 gs_mdx(1)=61 gs_mdx(2)=gs_mdx(1)+k gs_mdx(3)=gs_mdx(2)+k gs_mdx(4)=gs_mdx(3)+k gs_mdx(5)=gs_mdx(4)+k gs_mdy1=gs_sy10+83 ; Battle display speed gs_sy11=gs_sy10+199 dim gs_bdx,6 k=92 gs_bdx(1)=61 gs_bdx(2)=gs_bdx(1)+k gs_bdx(3)=gs_bdx(2)+k gs_bdx(4)=gs_bdx(3)+k gs_bdx(5)=gs_bdx(4)+k gs_bdy1=gs_sy11+83 ; 戦闘表示 FULL SIMPLE gs_sy12=gs_sy11+199 gs_sy13=gs_sy12+73 gs_c13x1=115 ; FULL gs_c13x2=288 ; SIMPLE gs_cckf=283.0/176.0 ; 間隔 gs_ccarlx=38 ; ← gs_ccarrx=460 ; → gs_lyb=1430 ; スクロール最下段 gs_btx1=26 ; back gs_bty1=861 gs_btx2=277 ; start gs_bty2=861 return #deffunc gs_fg_put int _gs_fg_putn n=_gs_fg_putn s=str(n) f=strlen(s) if f=1 { ; 1ケタ pos gs_fgx1,y+25 : celput fg50grw,n return } if f=2 { ; 2ケタ n2=n/10 : pos gs_fgx2,y+25 : celput fg50grw,n2 n2=n\10 : pos gs_fgx3,y+25 : celput fg50grw,n2 return } if f=3 { ; 3ケタ n2=n/100 : pos gs_fgx4,y+25 : celput fg50grw,n2 n2=n/10 : n2=n2\10 : pos gs_fgx5,y+25 : celput fg50grw,n2 n2=n\10 : pos gs_fgx6,y+25 : celput fg50grw,n2 return } return #deffunc gs_put gmode 2 ; 背景 pos 0,gs_cly1 : celput gs3Bw ; MAP SIZE y=gs_sy1-gs_ly if y>0 and y<gs_cly2 : pos 167,y : celput gsft4w y=gs_msy1-gs_ly : if y>0 and y<gs_cly2 { pos gs_msx1 ,y : celput fg50orw,1 pos gs_msx2 ,y : celput fg50orw,2 pos gs_msx3 ,y : celput fg50orw,3 if scf=1 : pos gs_msx1-25,y-25 : celput gswd1w,0,0.8,0.8 if scf=2 : pos gs_msx2-25,y-25 : celput gswd1w,0,0.8,0.8 if scf=3 : pos gs_msx3-25,y-25 : celput gswd1w,0,0.8,0.8 } ; ALL PLAYER y=gs_sy2-gs_ly if y>0 and y<gs_cly2 : pos 180,y : celput gsft5w y+=56 : if y>0 and y<gs_cly2 { pos 100,y : celput gsar1w,0,0.7,0.7 pos 368,y : celput gsar2w,0,0.7,0.7 gs_fg_put plb } ; OPERATION PLAYER y=gs_sy3-gs_ly if y>0 and y<gs_cly2 : pos 47,y : celput gsft6w y+=56 : if y>0 and y<gs_cly2 { pos 100,y : celput gsar1w,0,0.7,0.7 pos 368,y : celput gsar2w,0,0.7,0.7 gs_fg_put spln } ; LAND y=gs_sy4-gs_ly if y>0 and y<gs_cly2 : pos 210,y : celput gsft7w y+=56 : if y>0 and y<gs_cly2 { pos 100,y : celput gsar1w,0,0.7,0.7 pos 368,y : celput gsar2w,0,0.7,0.7 gs_fg_put ldb } ; CHARACTER UNIT y=gs_sy5-gs_ly if y>0 and y<gs_cly2 : pos 67,y : celput gsft8w y=gs_cuy1-gs_ly : if y>0 and y<gs_cly2 { ;boxf gs_cux1-25,y-25,gs_cux1+72,y+72 repeat 4 pos gs_cux(cnt),y : celput fg50orw,cnt loop pos gs_cux(cusf)-25,y-25 : celput gswd1w,0,0.8,0.8 } ; GAME LEVEL y=gs_sy6-gs_ly if y>0 and y<gs_cly2 : pos 130,y : celput gsft9w y=gs_lvy1-gs_ly : if y>0 and y<gs_cly2 { repeat 5,1 pos gs_lvx(cnt),y : celput fg50blw,cnt loop pos gs_lvx(glv)-25,y-25 : celput gswd1w,0,0.8,0.8 } ; FULL DICE y=gs_sy7-gs_ly if y>0 and y<gs_cly2 : pos 155,y : celput gsft11w y=gs_diy1-gs_ly : if y>0 and y<gs_cly2 { pos gs_dix1,y : celput fg50grw,8 pos gs_dix2,y : celput fg50grw,1 pos gs_dix2+48,y : celput fg50grw,2 pos gs_dix3,y : celput fg50grw,1 pos gs_dix3+48,y : celput fg50grw,6 if dcb=8 : pos gs_dix1-44,y-41 : celput gswd1w,0,1.1,1.1 if dcb=12 : pos gs_dix2-17,y-41 : celput gswd1w,0,1.1,1.1 if dcb=16 : pos gs_dix3-18,y-41 : celput gswd1w,0,1.1,1.1 } ; COLOR CHANGE y=gs_sy8-gs_ly if y>0 and y<gs_cly2 : pos 131,y : celput gsft12w y=gs_sy9-gs_ly if y>0 and y<gs_cly2 { pos gs_c9x1,y : celput gsft13w pos gs_c9x2,y : celput gsft14w if clcgf=1 : pos gs_c9x1-42,y+2 : celput guidew ; USE if clcgf=0 : pos gs_c9x2-42,y+2 : celput guidew ; RANDOM } ; RGBゲージ y=gs_ccy1-gs_ly : if y>0 and y<gs_cly2 /*and clcgf=1*/ { color cld(55),cld(56),cld(57) k=int(double(cld(55)-48)*gs_cckf) boxf gs_ccx1+35,y+7,gs_ccx1+35+k,y+49 pos gs_ccx1,y : celput gaugew,0,0.8,0.8 pos gs_ccarlx,y : celput gsar1w,0,0.4,0.4 pos gs_ccarrx,y : celput gsar2w,0,0.4,0.4 pos gs_ccx1+14+k,y+5 : celput gspow } y=gs_ccy2-gs_ly : if y>0 and y<gs_cly2 /*and clcgf=1*/ { color cld(55),cld(56),cld(57) k=int(double(cld(56)-48)*gs_cckf) boxf gs_ccx1+35,y+7,gs_ccx1+35+k,y+49 pos gs_ccx1,y : celput gaugew,0,0.8,0.8 pos gs_ccarlx,y : celput gsar1w,0,0.4,0.4 pos gs_ccarrx,y : celput gsar2w,0,0.4,0.4 pos gs_ccx1+14+k,y+5 : celput gspow } y=gs_ccy3-gs_ly : if y>0 and y<gs_cly2 /*and clcgf=1*/ { color cld(55),cld(56),cld(57) k=int(double(cld(57)-48)*gs_cckf) boxf gs_ccx1+35,y+7,gs_ccx1+35+k,y+49 pos gs_ccx1,y : celput gaugew,0,0.8,0.8 pos gs_ccarlx,y : celput gsar1w,0,0.4,0.4 pos gs_ccarrx,y : celput gsar2w,0,0.4,0.4 pos gs_ccx1+14+k,y+5 : celput gspow } ; Map display speed y=gs_sy10-gs_ly if y>0 and y<gs_cly2 : pos 40,y : celput gsft16w y=gs_mdy1-gs_ly : if y>0 and y<gs_cly2 { repeat 5,1 pos gs_mdx(cnt),y : celput fg50piw,cnt loop pos gs_mdx(bpwt1f)-25,y-25 : celput gswd1w,0,0.8,0.8 } ; Battle display speed y=gs_sy11-gs_ly if y>0 and y<gs_cly2 : pos 113,y : celput gsft17w y=gs_bdy1-gs_ly : if y>0 and y<gs_cly2 { repeat 5,1 pos gs_bdx(cnt),y : celput fg50piw,cnt loop pos gs_bdx(bpwt2f)-25,y-25 : celput gswd1w,0,0.8,0.8 } ; 戦闘表示 y=gs_sy12-gs_ly if y>0 and y<gs_cly2 : pos 80,y : celput gsft18w y=gs_sy13-gs_ly if y>0 and y<gs_cly2 { pos gs_c13x1,y : celput gsft19w pos gs_c13x2,y : celput gsft20w if btl_putf=0 : pos gs_c13x1-42,y+2 : celput guidew ; USE if btl_putf=1 : pos gs_c13x2-42,y+2 : celput guidew ; RANDOM } ; 背景 pos 0,0 : celput gs3Aw pos 0,gs_cly2 : celput gs3Cw ; 枠 gmulcolor 255,255,255 repeat 12 pos 40+cnt*40,0 : celput gswk5w pos 40+cnt*40,920 : celput gswk8w loop repeat 22 pos 0 ,40+cnt*40 : celput gswk6w pos 500,40+cnt*40 : celput gswk7w loop pos 0 ,0 : celput gswk1w pos 500,0 : celput gswk2w pos 0 ,920 : celput gswk3w pos 500,920 : celput gswk4w ; game_start pos 77,24 : celput gsft1w ; back pos gs_btx1,gs_bty1 : celput gsbt1w pos 96,878 : celput gsft3w ; start pos gs_btx2,gs_bty2 : celput gsbt1w pos 335,878 : celput gsft2w pos gs_arux,gs_aruy : celput gsar3w pos gs_ardx,gs_ardy : celput gsar3w,2 return #deffunc gs_key_syo switch gsky case 1 ; プレイヤー数 plb- if plb<2 : plb=2 if ldb<ldba : ldb=ldba ;: ldb+=plb-(ldb\plb) ldb-=ldb\plb if ldb<ldba : ldb+=plb-(ldb\plb) if plb<spln : spln=plb swbreak case 2 plb+ if plb>20 : plb=20 if ldb\plb=0 : swbreak ldb+=plb-(ldb\plb) if ldb>ldbb : ldb-=plb swbreak case 3 ; 操作人数 spln- : if spln<1 : spln=1 swbreak case 4 spln+ : if spln>plb : spln=plb swbreak case 5 ; 国の数 ldb- if ldb<plb : ldb=plb : swbreak ; 最小人数 if ldb<ldba : ldb=ldba ; 最小国数 ldb-=ldb\plb if ldb<ldba : ldb+=plb-(ldb\plb) swbreak case 6 ldb+=plb-(ldb\plb) if ldb>ldbb : ldb-=plb : swbreak swbreak case 11 ; 画面数 scf=1 : ldba=2 : ldbb=40 if ldb<ldba : ldb=ldba : if ldb\plb!0 : ldb+=plb-(ldb\plb) if ldb>ldbb : ldb=ldbb : if ldb\plb!0 : ldb-=ldb\plb swbreak case 12 scf=2 : ldba=20 : ldbb=80 if ldb<ldba : ldb=ldba : if ldb\plb!0 : ldb+=plb-(ldb\plb) if ldb>ldbb : ldb=ldbb : if ldb\plb!0 : ldb-=ldb\plb swbreak case 13 scf=3 : ldba=40 : ldbb=120 if ldb<ldba : ldb=ldba : if ldb\plb!0 : ldb+=plb-(ldb\plb) if ldb>ldbb : ldb=ldbb : if ldb\plb!0 : ldb-=ldb\plb swbreak ; CHARACTER UNIT case 14 : cusf=0 : swbreak case 15 : cusf=1 : swbreak case 16 : cusf=2 : swbreak case 17 : cusf=3 : swbreak ; GAAME LEVEL case 19 : glv=1 : swbreak case 20 : glv=2 : swbreak case 21 : glv=3 : swbreak case 22 : glv=4 : swbreak case 23 : glv=5 : swbreak ; FULL DICE case 24 : dcb=8 : swbreak case 25 : dcb=12 : swbreak case 26 : dcb=16 : swbreak ; COLOR CHANGE case 27 : clcgf=1 : swbreak ; USE case 28 : clcgf=0 : swbreak ; RANDOM case 29 : cld(55)=int(double(mx-gs_ccx1-35)*(176.0/283.0)+48) : swbreak ; RED case 30 : cld(56)=int(double(mx-gs_ccx1-35)*(176.0/283.0)+48) : swbreak ; GREEN case 31 : cld(57)=int(double(mx-gs_ccx1-35)*(176.0/283.0)+48) : swbreak ; BLUE case 32 ; R+ cld(55)- : if cld(55)<48 : cld(55)=48 swbreak case 33 ; R+ cld(55)+ : if cld(55)>224 : cld(55)=224 swbreak case 34 ; G- cld(56)- : if cld(56)<48 : cld(56)=48 swbreak case 35 ; G+ cld(56)+ : if cld(56)>224 : cld(56)=224 swbreak case 36 ; B- cld(57)- : if cld(57)<48 : cld(57)=48 swbreak case 37 ; B+ cld(57)+ : if cld(57)>224 : cld(57)=224 swbreak case 39 : mainf=5 : swbreak ; start ; Map display speed case 40 : bpwt1f=1 : swbreak case 41 : bpwt1f=2 : swbreak case 42 : bpwt1f=3 : swbreak case 43 : bpwt1f=4 : swbreak case 44 : bpwt1f=5 : swbreak ; Battle display speed case 45 : bpwt2f=1 : swbreak case 46 : bpwt2f=2 : swbreak case 47 : bpwt2f=3 : swbreak case 48 : bpwt2f=4 : swbreak case 49 : bpwt2f=5 : swbreak ; 戦闘表示 case 50 : btl_putf=0 : swbreak case 51 : btl_putf=1 : swbreak swend if cusf=3 and ldb<15 : cusf=2 if cusf=2 and ldb<10 : cusf=1 if cusf=1 and ldb<5 : cusf=0 return *game_start if scf=1 : ldba=2 : ldbb=40 if scf=2 : ldba=20 : ldbb=80 if scf=3 : ldba=40 : ldbb=120 kwc=5 : gskyk=10 : gskyc=0 repeat k=0 : mx=0 : my=0 ; 入力リセット repeat 1 if kwc>0 : kwc- : break ; ウエイト mx=mousex : my=mousey ; カーソル位置 stick k,256 ; マウスボタン、スマホクリック loop ; キー位置 gsky=0 : my2=my+gs_ly repeat 1 ; スクロール矢印上下 if gs_arux1<mx and gs_aruy1<my and gs_arux2>mx and gs_aruy2>my and k=256 { gs_ly-=10 : if gs_ly<0 : gs_ly=0 break } if gs_ardx1<mx and gs_ardy1<my and gs_ardx2>mx and gs_ardy2>my and k=256 { gs_ly+=10 : if gs_ly>=gs_lyb : gs_ly=gs_lyb break } if gs_btx1+2<mx and gs_bty1+2<my and gs_btx1+235>mx and gs_bty1+66>my : gsky=38 : break ; back if gs_btx2+2<mx and gs_bty2+2<my and gs_btx2+235>mx and gs_bty2+66>my : gsky=39 : break ; start if my<gs_cly1 : break ; 画面外上 if my>gs_cly2 : break ; 画面外下 ; プレイヤー数 if gs_msx1-25<mx and gs_msy1-25<my2 and gs_msx1+72>mx and gs_msy1+72>my2 : gsky=11 : break if gs_msx2-25<mx and gs_msy1-25<my2 and gs_msx2+72>mx and gs_msy1+72>my2 : gsky=12 : break if gs_msx3-25<mx and gs_msy1-25<my2 and gs_msx3+72>mx and gs_msy1+72>my2 : gsky=13 : break ; CHARACTER UNIT repeat 4 if gs_cux(cnt)-25<mx and gs_cuy1-25<my2 and gs_cux(cnt)+72>mx and gs_cuy1+72>my2 { gsky=14+cnt : break } loop ; GAAME LEVEL repeat 5,1 if gs_lvx(cnt)-25<mx and gs_lvy1-25<my2 and gs_lvx(cnt)+72>mx and gs_lvy1+72>my2 { gsky=18+cnt : break } loop ; FULL DICE if gs_dix1-46<mx and gs_diy1-41<my2 and gs_dix1+89 >mx and gs_diy1+92>my2 : gsky=24 : break if gs_dix2-18<mx and gs_diy1-41<my2 and gs_dix2+117>mx and gs_diy1+92>my2 : gsky=25 : break if gs_dix3-19<mx and gs_diy1-41<my2 and gs_dix3+116>mx and gs_diy1+92>my2 : gsky=26 : break ; COLOR CHANGE if gs_c9x1-15<mx and gs_sy9-10<my2 and gs_c9x1+101>mx and gs_sy9+50>my2 : gsky=27 : break ; USE if gs_c9x2-15<mx and gs_sy9-10<my2 and gs_c9x2+206>mx and gs_sy9+50>my2 : gsky=28 : break ; RANDOM ;if clcgf=1 { ; USE if gs_ccx1+35<=mx and gs_ccy1+4<my2 and gs_ccx1+35+283>=mx and gs_ccy1+51>my2 : gsky=29 : break ; RED if gs_ccx1+35<=mx and gs_ccy2+4<my2 and gs_ccx1+35+283>=mx and gs_ccy2+51>my2 : gsky=30 : break ; GREEN if gs_ccx1+35<=mx and gs_ccy3+4<my2 and gs_ccx1+35+283>=mx and gs_ccy3+51>my2 : gsky=31 : break ; BLUE if gs_ccarlx-9<mx and gs_ccy1-5<my2 and gs_ccarlx+48>mx and gs_ccy1+61>my2 : gsky=32 : break ; R- if gs_ccarrx-7<mx and gs_ccy1-5<my2 and gs_ccarrx+50>mx and gs_ccy1+61>my2 : gsky=33 : break ; R+ if gs_ccarlx-9<mx and gs_ccy2-5<my2 and gs_ccarlx+48>mx and gs_ccy2+61>my2 : gsky=34 : break ; G- if gs_ccarrx-7<mx and gs_ccy2-5<my2 and gs_ccarrx+50>mx and gs_ccy2+61>my2 : gsky=35 : break ; G+ if gs_ccarlx-9<mx and gs_ccy3-5<my2 and gs_ccarlx+48>mx and gs_ccy3+61>my2 : gsky=36 : break ; B- if gs_ccarrx-7<mx and gs_ccy3-5<my2 and gs_ccarrx+50>mx and gs_ccy3+61>my2 : gsky=37 : break ; B+ ;} ; Map display speed repeat 5,1 if gs_mdx(cnt)-25<mx and gs_mdy1-25<my2 and gs_mdx(cnt)+72>mx and gs_mdy1+72>my2 { gsky=39+cnt : break } loop ; Battle display speed repeat 5,1 if gs_bdx(cnt)-25<mx and gs_bdy1-25<my2 and gs_bdx(cnt)+72>mx and gs_bdy1+72>my2 { gsky=44+cnt : break } loop ; 戦闘表示 if gs_c13x1-20<mx and gs_sy13-10<my2 and gs_c13x1+130>mx and gs_sy13+50>my2 : gsky=50 : break ; 通常表示 if gs_c13x2-20<mx and gs_sy13-10<my2 and gs_c13x2+180>mx and gs_sy13+50>my2 : gsky=51 : break ; 簡易表示 ; 矢印 repeat 8 if gs_kx1(cnt+1)<mx and gs_ky1(cnt+1)<gs_ly+my and gs_kx2(cnt+1)>mx and gs_ky2(cnt+1)>gs_ly+my { gsky=cnt+1 : break } loop loop ; 押してる repeat 1 if k!256 : break if kf=0 : kf=1 : kepy=my : keply=gs_ly : gsky=0 if kf=1 { if kepy-my>18 or my-kepy>18 : kf=2 ; スクロールモード gskyc+ if gskyc=gskyk { ; キーウエイト gskyc=0 : gskyk- : if gskyk<1 : gskyk=1 gs_key_syo ; キー処理 } } if kf=2 { ; スクロール gs_ly=keply+(kepy-my)*2 if gs_ly<0 : gs_ly=0 if gs_ly>=gs_lyb : gs_ly=gs_lyb } loop ; 押してない repeat 1 if k=256 : break ; 放してない gskyk=10 : gskyc=0 if kf=0 : break ; 一度も押してない if kf=2 : kf=0 : break ; スクロールモード kf=0 gs_key_syo ; キー処理 loop if mainf!3 : break ; 戻る redraw 0 gs_put font "",30 dg_put redraw 1 await 1000/50 loop if scf=1 : hxb=19 ; 横のマスの数 if scf=2 : hxb=37 if scf=3 : hxb=55 mb=hxb*hyb lsb=hxb*hyb ; land_set cld2(55)=cld(55)+8 cld2(56)=cld(56)+8 cld2(57)=cld(57)+8 bpwt1_cul ; 10~50、攻守国表示時間 bpwt2_cul ; 10*2~50*2、ダイスロール表示時間 gosub *map_create ; マップ生成 gosub *start_data ; スタートデータセット ;save ; スタートセーブ return |
画面はスクロールするようにしてます。
値は gs_lyです、各座標の y座標に gs_lyを足す事によってスクロールさせてます。
一応画面外のものは表示をスキップするようにしてます。
画面一番上と一番下の文字はスクロールしません。
これが意外と難しくて、ノーマルの HSPだと「何画面のどこからどこまでをコピー表示」つまり gcopy 1,0,0,540,100 のようにできますけど、HSP Dishだと gcopyは使えません。
しかもバッファ画面から表示画面へコピーもできません。
バッファ画面から表示画面へコピーができると、別画面に完成表示を作ったら、後は表示画面へ都度完成画面を切り取って表示させるだけで間単にスクロールができるんですけど、Dishではできません。
そのため都度、その座標に合わせて表示画面に全部表示処理する必要があります。
そこで問題になったのが、上の文字と下の文字の表示です、背景をどうするかですね。
めんどくさいので詳細ははぶきますけど、背景画面を上と真ん中と下の 3画面に分割して表示させてます。
Aパーツ
Bパーツ
Cパーツ
まず真ん中の背景を表示して、その上にスクロールする設定の画面を書きます。
その上に画面上と下の背景を表示して、文字を書きます。
するとスクールの上の端と下の端の表示を切り取る事ができます。
キー入力の座標もすべて gs_lyを足す事によって算出してます。
後、難しかったのは画面数やプレイヤー人数に対する国数の倍数調整ですね。
画面数に対する最大数、最小数も含めて、プレイヤー人数の倍数になるように調整する式がややこしかったです。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
case 1 ; プレイヤー数 plb- if plb<2 : plb=2 if ldb<ldba : ldb=ldba ldb-=ldb\plb if ldb<ldba : ldb+=plb-(ldb\plb) if plb<spln : spln=plb swbreak case 2 plb+ if plb>20 : plb=20 if ldb\plb=0 : swbreak ldb+=plb-(ldb\plb) if ldb>ldbb : ldb-=plb swbreak |
こんな感じのやつですけど、これは人数が一人減る場合と一人増える場合ですね。
plbがプレイヤー数、ldbが国数、ldbaが国の最小、ldbbが国の最大数です。
人数は 2人~20人ですね。
国数を人数で割った余りを引いたり足したりして、人数の倍数になるように調整してます。
自分でも何やってるのか分かりません、適当に試行錯誤したら動いたという感じのやつです。
別に人数に対して国数が同じで無くても良いんですけどね、なんとなくフェアにしたいじゃないですか。
画面の大きさに対する国数の最小数と最大数は今の所
1画面、最小2 、最大40
2画面、最小20、最大80
3画面、最小40、最大120
となってます、これ以外だとマップを生成できなくなります。