*DRAWLOOP hgdraw hgsync 20 selpos JIKIOBJ :objgetfv FV stick KY,31 if KY&1 :fvadd FV,-0.15f,0.0f,0.0f if KY&4 :fvadd FV, 0.15f,0.0f,0.0f if KY&2 :fvadd FV, 0.0f,-0.15f,0.0f if KY&8 :fvadd FV, 0.0f,0.15f,0.0f fvmin FV, -4.2f,-4.5f,0.0f fvmax FV, 4.2f,0.0f,0.0f objsetfv FV gosub *SHOT goto *DRAWLOOP *SHOT if (KY&16) and (SHOTMODE=0){ ;こここここですすすすす SHOTMODE=1 selpos JIKIOBJ:objgetfv FV ;実機の位置習得 regobj SHOTOBJ,SHOTMODEL selpos SHOTOBJ : objsetfv FV setcoli SHOTOBJ,1,2 } if SHOTMODE=1{ selpos SHOTOBJ: objgetfv FV fvadd FV.2,-1.0f objsetfv FV fcmp RETVAL , FV.2,-80.0f if RETVAL=-1{ delobj SHOTOBJ SHOTMODE=0 } } return
全体です
#include "hgimg.as" randomize screen 0,640,480,0 hgini ;時キャラ作成 setsizef 0.7f,1.4f setuv 0,0,63,127 addplate JIKIMODEL,1 texload "supejiki.bmp" uvanim JIKIMODEL,50,2,0 ;床作成 setsizef 10.0f,4.0f setuv 0,0,640,208 addplate YUKAMODEL,1 texload "ground.bmp" uvanim YUKAMODEL,16,3,0 ;背景 texloadbg "supeback.bmp" ddim FV,4 ;弾作成 setsizef 1.0f,1.0f setuv 0,0,63,63 addplate SHOTMODEL,1 texload "supetama.bmp" uvanim SHOTMODEL,5,4,0 ;カメラ設定 selcpos: objsetf3 0.0f,-2.0f,6.0f gsel 0 regobj JIKIOBJ,JIKIMODEL,0 regobj YUKAOBJ,YUKAMODEL,OBJ_GROUND selpos YUKAOBJ : objsetf3 0.0f,0.5f,0.0f SHOTMODE=0 *DRAWLOOP hgdraw hgsync 20 selpos JIKIOBJ :objgetfv FV stick KY,31 if KY&1 :fvadd FV,-0.15f,0.0f,0.0f if KY&4 :fvadd FV, 0.15f,0.0f,0.0f if KY&2 :fvadd FV, 0.0f,-0.15f,0.0f if KY&8 :fvadd FV, 0.0f,0.15f,0.0f fvmin FV, -4.2f,-4.5f,0.0f fvmax FV, 4.2f,0.0f,0.0f objsetfv FV gosub *SHOT goto *DRAWLOOP *SHOT if (KY&16) and (SHOTMODE=0){ SHOTMODE=1 selpos JIKIOBJ:objgetfv FV ;実機の位置習得 regobj SHOTOBJ,SHOTMODEL selpos SHOTOBJ : objsetfv FV setcoli SHOTOBJ,1,2 } if SHOTMODE=1{ selpos SHOTOBJ: objgetfv FV fvadd FV.2,-1.0f objsetfv FV fcmp RETVAL , FV.2,-80.0f if RETVAL=-1{ delobj SHOTOBJ SHOTMODE=0 } } return