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.

DarkBASIC Professional Discussion / Background Image & Sprite Animation

Author
Message
NETMAN007
22
Years of Service
User Offline
Joined: 16th Jan 2003
Location: Malta
Posted: 15th Feb 2003 14:50
I have two questions:
Question 1.When I use the Load Bitmap command the background dissapears once the program flow enters a loop.
To avoid this I use the Load Image command and everytime the program flow enters a loop I use the paste Image command.
When I use an If statment to check if the arrow keys are pressed the screen does not flicker but when I type an If statment to check if the shift key or space bar are pressed the screen flickers everytime one of these keys are pressed. What is the problem?

Question 2. How do you create an animated sprite?
I have created a sequence of frame in a single image and used the Create Animated Sprite and then the Play Sprite command but I did neitheir see the image nor the animation.

Any help would be appreciated on both questions.

Netman007
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 15th Feb 2003 14:57
For your first Q, can you post some code so we can see what you are doing?

As for your second Q, I have never used an automatically animated sprite - I always animate my images myself. I could guess, but I thinks it's better for someone who *knows* to answer for you.
NETMAN007
22
Years of Service
User Offline
Joined: 16th Jan 2003
Location: Malta
Posted: 15th Feb 2003 19:22
Thanks Ianm for your quick reply

My code is
load image "c:\media_dbasic\platform.jpg",1
load image "c:\media_dbasic\cowboy1_right.bmp",2
load image "c:\media_dbasic\trees.bmp",6
load image "c:\media_dbasic\rocky.bmp",7
sprite 1,0,450,1
sprite 2,0,410,2
do
r_key = rightkey()
if r_key = 1
x_mov2 = x_mov2 + 1
set sprite image 2,2
sprite 2,x_mov2,410,2
endif
l_key = leftkey()
if l_key = 1
x_mov2 = x_mov2 - 1
sprite 2,x_mov2,410,2
set sprite image 2,4
endif
u_key = upkey()
if u_key = 1
sprite 2,x_mov2,380,2
wait 50
sprite 2,x_mov2,410,2
endif
loop

Before I said the shift key,Now I tried the upkey and the effect of flickering is still the same.
I think when you change the y-cordinates the image does not stay there?

May you please tell me how you animate your characters?

Login to post a reply

Server time is: 2025-05-18 02:32:13
Your offset time is: 2025-05-18 02:32:13