HSPポータル
サイトマップ お問い合わせ


HSPTV!掲示板


未解決 解決 停止 削除要請

2013
0906
火狐バッファーから画像が取り出せない1未解決


火狐

リンク

2013/9/6(Fri) 13:08:58|NO.56927

最近何回も質問してすいません
横スクロールシューティングを作ったのですが
敵を表示させる際に字でやるとうまくいくのに絵だとうまくいきません
というのはバッファー画面に敵1などの文字を読み込んでいるのですがその字をteki1.jpg
などの絵にすると表示されないのです
なぜですか?


;///画像読み込み/// color 255,255,255 buffer 1 :mes "自キャラ" buffer 2 :mes "地形地形地形地形地形" buffer 6 pos 0,0 :mes "敵1" pos 100,0 :mes "敵2" pos 200,0 :mes "敵3" pos 300,0 :mes "敵4" pos 400,0 :mes "敵5" screen 0,1350,800 SC=0 :STAGE=1 *hazimenomae color 0,0,0 pos 255,255 mes "スタート" repeat stick KY,31 if (KY&16)=16 :goto *GAMESTART await 10 loop stop ;/■/■/■ゲームスタート/■/■/■ *GAMESTART TEKIKAZU=30 gosub *SETPATSTR gosub *SETMAP mmplay 1 MX=80 :MY=160 :MYLIVE=1 dim SX,3 :dim SY,3 :dim SHOT,3 dim EX,TEKIKAZU :dim EY,TEKIKAZU :dim ELIVE,TEKIKAZU dim EDX,TEKIKAZU :dim EDY,TEKIKAZU dim POINTER,TEKIKAZU :dim ELOOP,TEKIKAZU dim ESYURUI,TEKIKAZU ;敵の種類 BAKULIVE=0: BAKUX=0: BAKUY=0 WORLDX=-320 ;スクロール座標 gmode 2 ;/■/■/■メインループ/■/■/■ *hazime redraw 0 color 0,0,0 boxf 0,0,2000,2000 MPSHIFT=WORLDX\16 MPSTART=WORLDX/16 gosub *DRAWMAP ;地形描画呼びだし if MPSHIFT=0 :gosub *SETRETU ;敵配置呼びだし stick KY,31 if (KY&1)=1 :MX=MX-12 :if MX<0 :MX=0 ;自キャラの左移動判定 if (KY&4)=4 :MX=MX+12 :if MX>1280 :MX=1280 ;自キャラの右移動判定 if (KY&2)=2 :MY=MY-12 :if MY<0 :MY=0 ;自キャラの上移動判定 if (KY&8)=8 :MY=MY+12 :if MY>799 :MY=799 ;自キャラの下移動判定   repeat 3 gosub *GOSHOT ;弾処理 loop repeat TEKIKAZU ;敵キャラ処理 if ELIVE(cnt)!0 :gosub *GOENEMY loop repeat TEKIKAZU ;当たり判定 if ELIVE(cnt)!0 :gosub *ATARI loop MPX0=(MPSHIFT+MX+12)/16 :MPY0=(MY+12)/16 ;地形との当たり判定 MPX1=(MPSHIFT+MX+20)/16 :MPY1=(MY+20)/16 C=peek(MAPS,MPY0*MAPLENG+MPSTART-30+MPX0) if (C>'0')and(C<'A') :MYLIVE=0 C=peek(MAPS,MPY1*MAPLENG+MPSTART-30+MPX1) if (C>'0')and(C<'A') :MYLIVE=0 pos MX,MY ;自キャラ表示 gcopy 1,0,0,65,30 if BAKULIVE>0{ ;爆発表示 BAKULIVE=BAKULIVE-1 pos BAKUX,BAKUY gcopy 1,96,0,32,32 } font "MS ゴシック",18,1 ;スコア表示 pos 0,0 :color 255,255,255 :mes "SCORE:"+sc redraw 1 await 30 ;ステージクリアー、ゲームオーバー条件 if MYLIVE=0 :goto *GAMEOVER if MAPLENG-2=MPSTART :goto *CLEARSTAGE ;スクロール WORLDX=WORLDX+4 goto *hazime ;/■/■/■弾の移動ルーチン/■/■/■ *GOSHOT if (KY&16)=16 and SHOT(cnt)=0 and RENSYA=0 { SHOT(cnt)=1 ;弾発射チェック SX(cnt)=MX+40 SY(cnt)=MY+12 RENSYA=20 } if SHOT(cnt)=1 { ;弾移動 SX(cnt)=SX(cnt)+30 color 255,255,80 boxf SX(cnt),SY(cnt),SX(cnt)+20,SY(cnt)+4 if SX(cnt)>1351 :SHOT(cnt)=0 MPX0=(MPSHIFT+SX(cnt)+6)/16 :MPY0=(SY(cnt)+2)/16 ;地形との当たり判定 C=peek(MAPS,MPY0*MAPLENG+MPSTART-30+MPX0) if (C>'0')and(C<'A') :SHOT(cnt)=0 } if RENSYA>0 :RENSYA=RENSYA-1 return ;/■/■/■敵の移動ルーチン/■/■/■ *GOENEMY if ELOOP(cnt)>0 { ELOOP(cnt)=ELOOP(cnt)-1 } else { COM=PATSTR(POINTER(cnt),ESYURUI(cnt)) SP=int(PATSTR(POINTER(cnt)+1,ESYURUI(cnt))) ELOOP(cnt)=int(PATSTR(POINTER(cnt)+2,ESYURUI(cnt))) POINTER(cnt)=POINTER(cnt)+3 SP2=int(0.7*SP) if COM="D1" { ;命令解釈 EDX(cnt)=-SP :EDY(cnt)=0 } if COM="D2" { EDX(cnt)=-SP2:EDY(cnt)=-SP2 } if COM="D3" { EDX(cnt)=0:EDY(cnt)=-SP } if COM="D4" { EDX(cnt)=SP2:EDY(cnt)=-SP2 } if COM="D5" { EDX(cnt)=SP:EDY(cnt)=0 } if COM="D6" { EDX(cnt)=SP2:EDY(cnt)=SP2 } if COM="D7" { EDX(cnt)=0:EDY(cnt)=SP } if COM="D8" { EDX(cnt)=-SP2:EDY(cnt)=SP2 } if COM="S" { D=sqrt( (MX-EX(cnt))*(MX-EX(cnt)) + (MY-EY(cnt))*(MY-EY(cnt)) ) if D!0.0{ EDX(cnt)=int(double(MX-EX(cnt))/D * SP)-2 ;スクロール補正 EDY(cnt)=int(double(MY-EY(cnt))/D * SP) } } if COM="R" :POINTER(cnt)=0 } EX(cnt)=EX(cnt)+EDX(cnt) EY(cnt)=EY(cnt)+EDY(cnt) pos EX(cnt),EY(cnt) gcopy 6,ESYURUI(cnt)*100,0,70,30 if (EX(cnt)<0) or (EX(cnt)>1350) or (EY(cnt)<0) or (EY(cnt)>800) { ELIVE(cnt)=0 ;画面外に出たら消滅 } return ;/■/■/■敵パターン設定/■/■/■ *SETPATSTR sdim PATSTR,3,35,4 PATSTR(0,0)="D1","4","30","D8","6","15","D1","12","70","R","0","0" PATSTR(0,1)="D8","6","10","D1","6","10","D2","6","10","D1","6","10","R","0","0" PATSTR(0,2)="D8","10","30","D2","10","30","R","0","0" PATSTR(0,3)="D1","4","30","D8","6","15","D5","8","70","R","0","0" return ;/■/■/■当たり判定/■/■/■ *ATARI TEV=ELIVE(cnt) :TEX=EX(cnt) :TEY=EY(cnt) if TEV=1 & (TEX+24)>(MX+8) & (MX+24)>(TEX+8) & (TEY+24)>(MY+8) & (MY+24)>(TEY+8) { MYLIVE=0 ;自キャラと敵の当たり判定 } repeat 3 ;敵と弾の当たり判定 if SHOT(cnt)=1 & TEV=1 & (TEX+32)>SX(cnt) & (SX(cnt)+12)>TEX & (TEY+32)>SY(cnt) & (SY(cnt)+12)>TEY { TEV=0 SHOT(cnt)=0 SC=SC+10 mmplay 0 } loop ELIVE(cnt)=TEV return ;/■/■/■マップ読み込み/■/■/■ *SETMAP MAPLENG=512 sdim MAPS,MAPLENG*88 bload "yokomap.txt",MAPS,MAPLENG*20 return ;/■/■/■マップ表示/■/■/■ *DRAWMAP repeat 80 RCNT=cnt repeat 100 if MPSTART-30+cnt<0 :continue C=peek(MAPS,RCNT*MAPLENG+MPSTART-30+cnt) if (C>'0') and (C<'A'){ pos cnt*16-MPSHIFT,RCNT*16 gcopy 2,(C-'1')*16,0,16,16 } loop loop return ;/■/■/■敵配置/■/■/■ *SETRETU if MPSTART<0 :return repeat 80 RCNT=cnt C=peek(MAPS,RCNT*MAPLENG+MPSTART) if C>='A' { repeat TEKIKAZU if ELIVE(cnt)=0 { ELIVE(cnt)=1 EX(cnt)=480 EY(cnt)=RCNT*16 POINTER(cnt)=0 ELOOP(cnt)=0 ESYURUI(cnt)=C-'A' break } loop } loop return ;/■/■/■ゲームオーバー処理/■/■/■ *GAMEOVER dialog "ゲームオーバー",1,"GAMEOVER" if stat=6 : goto *hazime end *clearstage

あと大変申し訳ないのですがyokomap.txtという名前のテキストを同じ場所に保存してください。
内容は


000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000111116111111111111118111191111111711111111111111111111111111111111111111111111111181111111111111111111111111111111111111111111111111111111111111111111111111111116666666611111111111111111111111111111116111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118111111111111811111111111111111111111111111111111111111888998811111111100000C0ADC0ADC0C0000000000000000000000000000000
00000000000000000000000111111111111111111111111111111111111111811111111111111111111155111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111666666666611111111111111111111119111111117111111111111111111111111111111111111111111111000001111999999999999999991991111111111111111111111111111111177777777999997771111111111111111155555C0C0C0C0C0C01111111111117111111111111800800100000000000001111111111111111111888998811111110000000000000000000000000000000000000000000000000
000000000000000000000000055555555554445555555544444555555555555555555511111555555555000000000000000000000000000000000000000000000110000000000000000000000000055555555555555555555111111111166666711111111111155551111000000000000000000001111111111111977777911111111111115550000000000111111111999999999999999988888888888899999999991111111111111111111111111111111111111100000000000000000000000000000000000000000111111111111111111111111000000000000011111444444411111000000000C0ADC0ADC0C0000000000000000000000000000000
000000000000000000000000000000000000000000000AD00000000000000000000AD0000000000000000000000000000000000000000000000000000000000001110000C0C0C0C0C0C00000000000000000000000000000005551111111169661111111115510C0C0C0C0C0C0000000000000000000441111111199977791111111111155000000000000000111111111111111199999999999999999991111111111111111111111111111111111111100000000000000000C0C0C0C0C0C000000000000000000000000000B0B0B0B0B0B000000000000000000000000000AD00ADAD0000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000332221111111000000000000000000000000000000000000000000000000555111666666611111555100000000000000000000000000AD0AD00004944111197791191111111155500000000000000000001111111111111111111111111111111111111111111111111111111444444444111000000000000000000000000000000000000AD00000000000000000B0B000000000000000000000000000000000000000000000000000000000000C0ADC0ADC0C0000000000000000000000000000000
000000000000000000000000000000000000AD000000000000000000000000000000AD00000000000000000000000000000000000000000000001111111167778111110000C0C0C0C0C00000000000001110000C0C000000000000000511116611115500000000C0C0C0C0C0C0000000000000000000000000441197779991111555500000000AD0000000000ADAD01111111111111177777777777777777777111114444444111110B0B0B0B0B0B0000000000000000000000000000000000000000000000B0B0B0B0B00000B0B0B0B0B0B000000000000000000000000000ADAD00AD0000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000AD000000000000000000000000000000000000000000B0B0B0B0B0B0B0000000001111111111111696611111000000000000000000000001117110000000000000000000000001166110000000000000000000000000000000000000AD00AD000000044111111111440AD000000000000000000000000000001111111111111111111111111111414444110B0B0B0B0B0B000000000000000000000000000000000000000000000AD000000000000000000000B0B0000000000000000000000000000000000000000000000000000000B0B0B0B0B0B0B0B0B0B0000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004555444540000000000000000000000111188881110000000C0C0C0C0000000000660000000000000000000000001130000000000000000000000000004444111140AD00000000000000000000AD00000000000000000444444455555444444400B0B0B0B0000000000000000000000000000000000000000000000000000000AD00AD00AD00000B0B0B0B0B0000004444444000000000000000000000000000000AD00ADAD0000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000B0B0B0B0B0B0B000000000000000AD00AD0AD00000000000000000000000000000111171100000000000000000000000000000000000000000000000000011111000000000000000000000000000000444400000000000000000000000000000000000000B0B0B0B0B0B0B0B0B0B0B0B0B000000000000000000000000000000000000000000000000000000000000AD000000000000000000000000000444411111114444000000000000000000000000000000000000000B0B0B0B0B0B0B0B0B0B0000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001110000000000000000000000000000000000000000000000000000111113000000000000000000000000AD00AD44000000000000000000AD000000000000AD0000000000000000000000000000000000000000000000000022222222221000000000000000000000000000000000000AD00AD0AD000000000111111111111111111111111111100000000000000000ADAD00AD0000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000A00000000000000000000000000000000000000000B0B0B0B0B0B0B0000000000000000AD0AD0AD000000000000000000000000000000000000000000000000000000000000000000000000000000000AD00011000013330000000000000000000000000000AD000000000000000000000000000000000000000000000000000000000000000000000003333333333331111111111111100000000000000000000000000000AD00000000000AD000000000000055511111155550000000000000000000000000000000000000000B0B0B0B0B0B0B0B0B0B000000000000000000000000000000
00000000000000000000B0B0B0B0B0B0B0B0000000000000000000011000000011300000000000000000000000AD00000000000000000000000000000000000000000000000000000022220000000003333333311111111111000001111110011133331000000000000000000000000000000000AD000000000B0B0B0B0B055555500B0B0B0B000000000000000000000AD00ADAD0000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000B0B0B0B0B0B0B0B0000000000000000000011000000011300000000000000000000000AD00000000000000000000000000000000000000000000000000000022220000000003333333311111111111000001111110011133331000000000000000000000000000000000AD000000000B0B0B0B0B055555500B0B0B0B000000000000000000000AD00ADAD0000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000AD00000000000000AD00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000B0B0B0B0B0B0B0B0000000000000000000011000000011300000000000000000000000AD00000000000000000000000000000000000000000000000000000022220000000003333333311111111111000001111110011133331000000000000000000000000000000000AD000000000B0B0B0B0B055555500B0B0B0B000000000000000000000AD00ADAD0000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000AD00000000000000AD00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000B0B0B0B0B0B0B0B0000000000000000000011000000011300000000000000000000000AD00000000000000000000000000000000000000000000000000000022220000000003333333311111111111000001111110011133331000000000000000000000000000000000AD000000000B0B0B0B0B055555500B0B0B0B000000000000000000000AD00ADAD0000000000000000000000000000000000000000000000000000000
00000000000000000000000000000AD000000000000000AD000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000001300000000000000000000000000000000000000000000000000000000000002222222222222211111111111111111111111100000000000000000000110000000011333331000000000000000000000000AD0000000000000000000000B0B0B0B00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001110000000000003300000000000000000000000000000000000000000000000000000022221111111111111111111111111111111111100000000000000000000000000000000000000001133311310000000000000AD0000000000000000B0B0B0B0B000000000B0B0B0B000000000000000000000ADAD00AD0000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000A0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001110110000000000001300000000000000000000000000000000000000000000000000221100000000000000000001111111111111100000000000066077008800990066000000000000000000001111133333110000000000000000000000000000000000B0B0B0B00000000000000000000000000000000000000000000000000ADADADADAD00000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002222113333333333312213333333122223222221000000000000000000000000000000000000000000111000011000000000000130000000000000000000000000000000000000000000002221111111111110000000000000000111100011000000000022222222222222222222222000000000000000000666666661111110000000000000000000000000000000000000000000000000000000000000000000AD00ADAD0000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022222222222222222222233333333338888888888888888888888888888888888888811000000000000000000000000000000000000000111000000000110066600000013322222222222222200000000000111133332222222211111111111111111111111000000000001100011000000000011111111111111111111111000000000000000000777777777777111111110000000000000000000000000000000000002222233333333000000000000000000000000000000000ADADADADAD00000000000000000000000000000000
000000000000000000000003333333003333333333333330033333333333333333333333333333333333331111111111777777777777777777777777777777777777777777777777777777777777777777711111111111111111111111111111111111111111000000777000111111111111111111111111111111111111111111111111100000000000000000000000000000000000000000000100001000000000000000001111111111111111000000000000000000888888888888888888111113333110000000000000000022222222221111000011111333333333333333333000000000000000000000000000000000000000000000000000000000
000000000000000000011111111111671111111111111116611111111111111111111111111111111111111999999999999999999999999999999999999999999999999999999999999999999999999999911111111111111111111111111111111111111111111111111111100000000000111111111111111111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000011111111100000000000000000000999999999999999999999999911418888888888888882211111111111111111111111111111111111111111333333330000000000000000000000000000000000000000000000000
000000000000000011111111111111111118111119111111111111111111111111111111111111111111111111111111111111111111111111111111111116666666666666666666666666666666666666611111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112222222222222222222222222222222222222222222222222211111111122222222222222222222111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100000000000000000000000000000000000000000000000

です
途中で切れているかと思いますが途中まででも大丈夫です。



この記事に返信する


123

リンク

2013/9/6(Fri) 14:36:04|NO.56930

文字読み込んだ際にソースはこうなってるけど

buffer 1 :mes "自キャラ"
buffer 2 :mes "地形地形地形地形地形"
buffer 6
pos 0,0 :mes "敵1"
pos 100,0 :mes "敵2"
pos 200,0 :mes "敵3"
pos 300,0 :mes "敵4"
pos 400,0 :mes "敵5"

screen 0,1350,800
----------------------------------------------
画像取り込んだとき下のようにやってまず画像がちゃんと取り込まれてるか見てみた?

screen 1 :絵を読み込む処理
screen 2 :絵を読み込む処理
screen 6 :絵を読み込む処理

screen 0,1350,800

stop



ONION software Copyright 1997-2023(c) All rights reserved.