;--初期設定------------------------- randomize title "升研究" ;--マスの列 cell_line_x=6 cell_line_y=6 ;--マスのサイズ cell_size_x=50 cell_size_y=50 ;--スクリーン設定 screen 0,cell_size_x*cell_line_x,cell_size_y*cell_line_y ;--データ--------------------------- ;--マス用配列変数設定 dim cell_dim,cell_line_x,cell_line_y ;--ランダム配色 repeat cell_line_x cntx=cnt repeat cell_line_y cell_dim(cntx,cnt)=rnd(6) loop loop ;--流れ星初期位置 star_pos_x=rnd(ginfo(12))+1 star_pos_y=rnd(ginfo(13))+1 ;--文字データ str_col = "赤","緑","青","紫","黄","水" ;--カラー ;--ユーザー定義命令------------------ goto *main ;--カラー #deffunc change_color int col_nam if col_nam=0 : color 255,000,000 ;--赤 if col_nam=1 : color 000,255,000 ;--緑 if col_nam=2 : color 000,000,255 ;--青 if col_nam=3 : color 255,000,255 ;--紫 if col_nam=4 : color 255,255,000 ;--黄 if col_nam=5 : color 000,255,255 ;--水 return ;--マス座標確認 ;--横 #deffunc cell_point_x int clipo_x ans=(clipo_x/cell_size_x)+1 if ans>cell_line_x : ans=cell_line_x return ans ;--縦 #deffunc cell_point_y int clipo_y ans=(clipo_y/cell_size_y)+1 if ans>cell_line_y : ans=cell_line_y return ans ;--マス塗りつぶし #deffunc paint_cell int pai_x,int pai_y boxf cell_size_x*(pai_x-1),cell_size_y*(pai_y-1), cell_size_x*pai_x,cell_size_y*pai_y return ;--メイン--------------------------- *main ;--入力処理 stick click,0,1 ;--左クリック(色変更) if click=256 { cell_dim(cursor_cell_x-1,cursor_cell_y-1)++ if cell_dim(cursor_cell_x-1,cursor_cell_y-1)>5 : cell_dim(cursor_cell_x-1,cursor_cell_y-1)=0 } ;--右クリック(星の位置変更) if click=512 { star_pos_x=mousex : star_pos_y=mousey } ;--流れ星移動処理 ;--移動量加算 star_pos_x+=3 : star_pos_y+=3 ;--ループ判定 if star_pos_x>ginfo(12) : star_pos_x=0 ;--横 if star_pos_y>ginfo(13) : star_pos_y=0 ;--縦 ;--位置探査 ;--カーソル cell_point_x mousex : cursor_cell_x=stat ;--横 cell_point_y mousey : cursor_cell_y=stat ;--縦 ;--流れ星 cell_point_x star_pos_x : star_cell_x=stat ;--横 cell_point_y star_pos_y : star_cell_y=stat ;--縦 ;--描画処理 redraw 0 ;--ウィンドウ塗りつぶし color 0,0,0 boxf 0,0,ginfo(12),ginfo(13) ;--マス塗りつぶし ;--カーソル change_color cell_dim(cursor_cell_x-1,cursor_cell_y-1) paint_cell cursor_cell_x,cursor_cell_y ;--流れ星 change_color cell_dim(star_cell_x-1,star_cell_y-1) paint_cell star_cell_x,star_cell_y ;--流れ星表示 ;--影 color 25,25,25 pos star_pos_x-1,star_pos_y-1 mes "★" ;--本体 color 255,255,255 pos star_pos_x,star_pos_y mes "★" ;--情報表示 pos 0,0 color 255,255,255 ;--マウス座標 mes "マウス座標X : "+mousex mes "マウス座標Y : "+mousey mes "マス座標X : "+cursor_cell_x mes "マス座標Y : "+cursor_cell_y mes "マスの色 : "+str_col(cell_dim(cursor_cell_x-1,cursor_cell_y-1)) redraw 1 ;--ウェイト await 30 goto *main