Hello I am new to DarkBASIC Pro and would like to ask a simple question. I was experimenting with user defined types and came up with this.
alieninfo as mytype
Type mytype
xcoords
ycoords
EndType
load image "ani-invader.bmp",1
do
if upkey()=1 then alieninfo.ycoords=-1
if downkey()=1 then alieninfo.ycoords=+1
if rightkey()=1 then alieninfo.xcoords=+1
if leftkey()=1 then alieninfo.xcoords=-1
sprite 1,0,0,1
spritex=sprite x(1)+alieninfo.xcoords
spritey=sprite y(1)+alieninfo.ycoords
paste sprite 1,spritex,spritey
loop
My only problem is that I can only move the sprite 1 space to up, down, left or right. I know there must be a simple solution to this.
Cheers,
FireDragon
PS: I've noticed that other code snippets on the fourm are seen by pressing +code snippet. How is that done?