Hi ran across this made by
D Ogre
but cant get sprite transparancy working, im stuck lol
help me anyone to point out whats missing or what wrong
` --------------------------------------------------
` 3D Person Controls Using An Animated Texture Plain
` Demo By D Ogre
` --------------------------------------------------
` Setup Program
sync on
sync rate 0
set display mode 1024,768,32
hide mouse
set image colorkey 255,0,255
` Load Media And Get Character Textures
load bitmap "knight.bmp",1
set current bitmap 1
for y=0 to 7
inc cell
get image cell,0,y*96,96,y*96+96,1
next y
` Create Matrix Texture
create bitmap 2,32,32
set current bitmap 2
ink rgb(32,32,32),0
box 0,0,31,31
ink rgb(64,64,64),0
box 0,0,15,15
box 16,16,31,31
get image 9,0,0,31,31,1
` Program Maintainance
set current bitmap 0
delete bitmap 1
delete bitmap 2
` Setup Matrix
make matrix 1,100.0,100.0,25,25
prepare matrix texture 1,9,2,2
fill matrix 1,0.0,1
for y=0 to 24
for x=0 to 24
inc tile:if tile>2 then tile=1
set matrix tile 1,x,y,tile
next x
next y
update matrix 1
position matrix 1,-50.0,0.0,-50.0
` Make Player
make object plain 1,2.0,2.0
set object 1,1,0,1
` Initialize Player Variables
x#=object position x(1)
z#=object position y(1)
frame=1
delay=50
` *** MAIN GAME LOOP ***
do
` Display
ink rgb(255,255,255),0
text 0,0,"Animation Frame: "+str$(frame)
` Control Player (3rd Person Camera)
if timer()>speed
speed=timer()+delay
if leftkey()=0 and rightkey()=0
if upkey()=1
x#=newxvalue(x#,a#,0.2):z#=newzvalue(z#,a#,0.2)
inc frame:if frame>8 then frame=1
endif
if downkey()=1
x#=newxvalue(x#,a#,-0.2):z#=newzvalue(z#,a#,-0.2)
dec frame:if frame<1 then frame=8
endif
endif
if leftkey()=1 then a#=wrapvalue(a#-3.0):frame=5
if rightkey()=1 then a#=wrapvalue(a#+3.0):frame=8
endif
` Update Player Position
y#=get ground height(1,x#,z#)+1.0
position object 1,x#,y#,z#
yrotate object 1,a#
texture object 1,frame
` Position Camera Relative To Player
cx#=newxvalue(x#,wrapvalue(a#+180),5)
cz#=newzvalue(z#,wrapvalue(a#+180),5)
cy#=get ground height(1,cx#,cz#)+2.0
position camera cx#,cy#,cz#
point camera x#,y#,z#
` Update Screen
sync
loop
//Cheers
Yes www.darkbasic.se - swedish forum is comming
