'■ 背景付き残像のテスト '■ やってることは tb_33.bas と いっしょ(^^) clear 10,1300 screen 0 depth = 3: ' <= 半透明の深さ (1〜5) same_blend = 1: ' <= 同一ブレンド率の面を何枚ならべるか sprwindow 0,63,319,162 '■ 背景の定義 (texture_id=0) BG_ID=1 gload "cd:tekend.1" g_height = 100 settex 0,320,g_height,32768 setatr 0,1,(0,0,3,0,0,3+64) gcopy 0,(0,120)-(319,120+g_height) to tx$ gcopy tx$ to 10,(0,0) for i=0 to depth-1 obj(i+BG_ID,@atr) = 0 obj(i+BG_ID,@type) = 1 obj(i+BG_ID,@xs) = &h.fffc obj(i+BG_ID,@xp) = 0,0,i*200+200 next '■ キャラクタの定義 (texture_id=1) cls 0:CHR_ID=10 settex 1,64,64,32768 setatr 1,1,(0,0,3,1,0,64) active 11:cls 11 for i=0 to 15 line(i,i)-(63,63),rgb(31,31,31-i),bf next line(10,10)-(55,55),rgb(31,0,0),bf line(10,10)-(53,53),-1,bf for i=0 to depth*same_blend obj(i+CHR_ID,@atr) = 1 obj(i+CHR_ID,@type) = 1 obj(i+CHR_ID,@xs) = &h.fffc obj(i+CHR_ID,@xp) = 0,0,i*200/same_blend-100+200 next '■ キャラクタの移動とキー入力 dim xp(256),yp(256),zr(256) v=3 *main xp(0)=xsin(i/360)*160 yp(0)=xcos(i/120)*60 p=pad(0,1) if p and @pad_left then v=v+(v>0)*0.1/same_blend if p and @pad_right then v=v-(v<5)*0.1/same_blend if p and @pad_up then zr(0)=zr(0)-0.03/same_blend if p and @pad_down then zr(0)=zr(0)+0.03/same_blend vsync for j=depth*same_blend to 0 step -1 obj(j+CHR_ID,@xp)=xp(j),yp(j) obj(j+CHR_ID,@zr)=zr(j) xp(j+1)=xp(j):yp(j+1)=yp(j):zr(j+1)=zr(j) next i=(i+v)mod 360 goto *main end