PDA

View Full Version : Tile Testa.dll



peter
03-12-2013, 21:30
Hello,

Updated A.dll and A.inc

Small Tile Test here.


#INCLUDE "a.inc"
OpenWindow 640,480,1


%AZURE = &hFFFFF0
Long t1,t2,t3,mo,am,mz,az
Single mv,av


t1 = LoadTile "tiles/afont.bmp",16,6
t2 = LoadTile "tiles/cfont.bmp",16,6
t3 = LoadTile "tiles/dfont.bmp",16,6
mo = LoadTile "tiles/mario.bmp",4,8
am = LoadTile "tiles/anima.bmp",8,2

While KeyDown(27)=0
ClearScr %AZURE

TileText t1, 50, 20,"HELLO",48,32
TileText t2, 50, 60,"HELLO",48,64
TileText t3, 50,130,"HELLO",48,96
TileText t2, 50,260,"THIS ARE TILES FONTS.",16,16
TileText t1,160,440,"PRESS ESCAPE",24,24

DrawTile mo,340,20,64,64,mz,0
DrawTile mo,404,20,64,64,mz,1
DrawTile mo,468,20,64,64,mz,2
DrawTile mo,532,20,64,64,mz,3
DrawTile mo,340,94,64,64,mz,4
DrawTile mo,404,94,64,64,mz,5
DrawTile mo,468,94,64,64,mz,6
DrawTile mo,532,94,64,64,mz,7

DrawTile am,340,294,64,64,az,0
DrawTile am,404,294,64,64,az,0
DrawTile am,468,294,64,64,az,0
DrawTile am,532,294,64,64,az,0
DrawTile am,340,358,64,64,az+4,0
DrawTile am,404,358,64,64,az+4,0
DrawTile am,468,358,64,64,az+4,0
DrawTile am,532,358,64,64,az+4,0

DrawTile am, 54,294,64,64,az,1
DrawTile am,118,294,64,64,az,1
DrawTile am,182,294,64,64,az,1
DrawTile am,246,294,64,64,az,1
DrawTile am, 54,358,64,64,az+4,1
DrawTile am,118,358,64,64,az+4,1
DrawTile am,182,358,64,64,az+4,1
DrawTile am,246,358,64,64,az+4,1


av +=.1
If av >=1 Then
av=0
az +=1
If az=4 Then az=0
End If

mv +=.1
If mv >=1 Then
mv=0
mz +=1
If mz=4 Then mz=0
End If

Events
FlipBuffer
Sleep 10
Wend
CloseWindow

peter
04-12-2013, 18:38
Hi,

Sorry, I forgot an EVENTS in TILE TEST source code.
Without EVENTS, you will get a GPF.

Here is a ThinBasic pixel test.


#INCLUDE "a.inc"
OpenWindow 800,600,1


Single a,t,xp,yp,zp,xs,ys,z


Sub xCircle(x As Single,y As Single,w As Single, r As Byte,g As Byte,b As Byte)
Local a As Long
For a=0 To 36 Step 2
DrawPoint(x+Sin(a)*w, y+Cos(a)*w,2,2, Rgb (r,g,b))
Next
End Sub


While KeyDown(27)=0
ClearScr Rgb(0,0,255)
For t=0 To 6 Step .01
xp = 120 * Cos(t*2)
yp = 120 * Sin(t*2)
zp = a*Sin(t*16) + 200
xs = (200 + xp * 320 \ 160)
ys = (200 - yp * 320 \ 160)
xCircle(200+xs, ys+100, zp-150, 255,255,255)
Next

Events
FlipBuffer
a +=1
If a>=200 Then
a = -a
End If
Wend
CloseWindow