Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Simulating Objects

Author
Message
scooter43
21
Years of Service
User Offline
Joined: 21st Jan 2003
Location:
Posted: 23rd Jan 2003 21:42
Has anyone tried simulating objects? For instance:


REM Name : Sprite Manager
REM Author : Scott Knowles
REM Date : 1-22-02
REM Purpose:
REM


REM A list of created sprites
DIM spriteList(100)

REM The type : SpriteManager
TYPE SpriteManager
REM The last created sprite number
spriteNumber AS INTEGER
REM The next position in the list
spriteListIndex AS INTEGER
ENDTYPE




REM Some basic function
FUNCTION SpriteManager_Init(spm as SpriteManager)
spm.spriteNumber = 0
spm.spriteListIndex = 0
EMPTY ARRAY spriteList
ENDFUNCTION



REM NAME : SpriteManager_CreateSprite
REM INPUT: spm The SpriteManager
REM xpos The xposition of the sprite
REM ypos The yposition of the sprite
REM image The image id of the sprite
REM RETURN: A sprite id number of created sprite
FUNCTION SpriteManager_CreateSprite(spm as SpriteManager,xpos,ypos,image,bsave,trans)
REM Increase both the spriteNumber and the spriteListIndex
INC spm.spriteNumber,1
INC spm.spriteListIndex,1

REM Create the sprite
SPRITE spm.SpriteNumber, xpos, ypos, image
REM Set it's backsave and transparency
SET SPRITE spm.SpriteNumber, bsave, trans

REM Add the sprite number to the list
ARRAY INSERT AT BOTTOM spriteList
spriteList(spm.spriteListIndex) = spm.SpriteNumber

ret = spm.SpriteNumber
ENDFUNCTION ret



So now I have a basic Sprite Manager to manager sprites for me.

Will this work in DBPro... the fully patched version?

Thanks,

Scott Knowles

Login to post a reply

Server time is: 2024-11-23 22:23:03
Your offset time is: 2024-11-23 22:23:03