goo blog サービス終了のお知らせ 

ズブの初心者がゲーム作れるまで勉強するブログ

現在、シューティングゲームの作り方を勉強中

HSPシューティング 花火みたいな弾 たくさんでない

2006-03-29 22:50:38 | Weblog

#define MAX 32

buffer 2,640,480
screen 0,640,480

dim bx,MAX
dim by,MAX
dim rad,MAX

repeat MAX
 bx.cnt=320
 by.cnt=240
loop

tx=rnd(640)
ty=rnd(480)

repeat MAX
 rad.cnt=atan(tx-bx.0, ty-by.0)-6.28/MAX*cnt
loop

repeat
 gsel 2,0
 cls 4
 await 100

 color 255, 255, 255

 repeat MAX
  circle tx, ty, tx+16, ty+16, 1
  circle bx.cnt, by.cnt, bx.cnt+16, by.cnt+16, 1
 
  bx.cnt=bx.cnt+sin(rad.cnt)*10
  by.cnt=by.cnt+cos(rad.cnt)*10
 
  if abs(tx-bx.cnt)<16 and abs(ty-by.cnt)<16  or by.cnt>480 {
   tx=rnd(640)
   ty=rnd(480)

   repeat MAX
    bx.cnt=320
    by.cnt=240
    rad.cnt=atan(tx-bx.0, ty-by.0)-6.28/MAX*cnt
   loop
  }
 loop

 gsel 0,1
 gcopy 2,0,0,640,480 
loop


HSP狙い撃ち弾 弾が当たらない

2006-03-29 14:44:23 | Weblog

buffer 2,640,480
screen 0,640,480

bx=320
by=240

tx=rnd(640)
ty=rnd(480)

//rad=atan(tx-bx, ty-by)  //計算箇所1

repeat
 gsel 2,0
 cls 4
 await 1

 color 255, 255, 255
 mes rad

 rad=atan(tx-bx, ty-by)  //計算箇所2
 
 circle tx, ty, tx+16, ty+16, 1

 circle bx, by, bx+16, by+16, 1

 bx=bx+sin(rad)*10
 by=by+cos(rad)*10

 if abs(tx-bx)<16 and abs(ty-by)<16 {
  tx=rnd(640)
  ty=rnd(480)
  rad=atan(tx-bx, ty-by)
 }


 gsel 0,1
 gcopy 2,0,0,640,480 
loop