today i have started to experiment with sprites and sprite sheets - i've downloaded a free sprite from itch.io assets and i took BasicCoder2 code from the forum and played with it and modified it here is what i came up with so far...
first here is the sprite sheet for you to download from dropbox https://www.dropbox.com/s/6jtx7fcw4ux80 ... 9.bmp?dl=0
please tell me if you succeed in downloading it from dropbox it's a 768x64 (64x64) pixel bmp file (modified from png file with MS-3d-paint (it seems that when you convert it from png format to bmp the background is no longer transparent like it was in the original png file format...
and here is the code originally borrowed from BasicCoder2 code from the forum :
Code: Select all
#include "fbgfx.bi"
using FB
screenres 640,480,32
color rgb(0,0,0),rgb(120,120,120):CLS
'Const xk = Chr(255)
'Const key_up = xk + "H"
'Const key_dn = xk + "P"
'Const key_rt = xk + "M"
'Const key_lt = xk + "K"
dim shared as any ptr Sheet 'create pointer
Sheet = imagecreate(768,64) 'point at new bitmap
bload "Holly\Aerial_swing (64 x 64).bmp",Sheet 'load image into bitmap
dim shared as integer frame 'current animation frame
dim as double st 'start of time
st = TIMER 'st = current time
DIM AS INTEGER x = 360, y = 140
DIM k AS STRING
DO
'k = INKEY
IF MULTIKEY(SC_UP) THEN y -= 5
IF MULTIKEY(SC_LEFT) THEN x -= 5
IF MULTIKEY(SC_RIGHT) THEN x += 5
IF MULTIKEY(SC_DOWN) THEN y += 5
if TIMER-st > 0.05 then 'next frame
st = TIMER 'reset start
screenlock
cls
put (x,y),Sheet,(frame*64,0)-(frame*64+63,64),trans
screenunlock
frame = frame + 1 'next frame
if frame = 11 then frame = 0
end if
sleep 2
loop until multikey(&H01) 'loop until ESC keypress
ron77