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 / Question Regarding Sprite Animation

Author
Message
iuxion
21
Years of Service
User Offline
Joined: 19th Jan 2003
Location: United States
Posted: 22nd Jan 2003 06:36
Hello everyone

I just downloaded the DBP trial version, eager to see if it works just as advertised. After playing around with it for several hours I was pretty impressed but one thing in my code did not work, and I don't know if this is a bug in DBP, something I don't understand, or something that previously was a bug and was later corrected in an offical patch but not in the trial version.

You see I was trying out the CREATE ANIMATED SPRITE command and when I used it in conjunction with the PLAY SPRITE command, things did not really work.

It captured two (out of three) of the frames of my animation correctly, but the third frame it captured was cut off at the center, and I don't know why this is happening because they are all aligned the same in the image file.

I love the program, the interface, and the language and was just curious about this little thing. Did anyone else experience this program or is it just my bad coding?

Thanks for your help in advance.
iuxion
21
Years of Service
User Offline
Joined: 19th Jan 2003
Location: United States
Posted: 22nd Jan 2003 06:40
"Did anyone else experience this program or is it just my bad coding?"

Err.. I meant to say:
Did anyone else experience this problem or is it just my bad coding?"

Shadow
22
Years of Service
User Offline
Joined: 17th Oct 2002
Location: In the shadows
Posted: 22nd Jan 2003 16:27
I've had problems with animated sprites. I think to make it work, the size of each frame (or maybe the total size) has to be a power of 2 (i.e. 1,2,4,8,16,32,64,128,256,512,etc.)
Richard Davey
Retired Moderator
22
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 22nd Jan 2003 16:40
Actually it's a bug in the "play sprite" command. The create animated sprite part works just fine, but you can't "play" them. Try it and see - what it does is show the first frame and then start from the frame after that and the loop is messed-up. Sadly it's a Patch5 fix as well.

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
iuxion
21
Years of Service
User Offline
Joined: 19th Jan 2003
Location: United States
Posted: 23rd Jan 2003 07:39
It doesn't seem to be the play sprite that is the problem, when I played with just the first 2 frames, ommitting the 3rd frame (which is the broken one), everything worked fine. Also, when I showed each frame individually without the play sprite command, the 3rd frame was still cut off. Any ideas?
Arrow
21
Years of Service
User Offline
Joined: 1st Jan 2003
Location: United States
Posted: 23rd Jan 2003 08:41
Weither it's truely a bug or not there will always be a way around it. If you're the patient type, wait till Patch 5 comes out, I think someone said it'll be here round March. In the mean time you can work on other parts of your porgram.

This is Truth!
This is my Belief!
...at least for now.
Richard Davey
Retired Moderator
22
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 23rd Jan 2003 12:33
Trust me - play sprite is broken. But you are right, it still shouldn't cut off your images. Post the code (AND) media files or just email them to me (rich@darkbasic.com) and I'll have a look.

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
Kangaroo2
22
Years of Service
User Offline
Joined: 26th Sep 2002
Location: United Kingdom
Posted: 23rd Jan 2003 14:15
Obviously, you can just load the images separately and write your own route to play them eg

load image "player1frame1.bmp",1,1
load image "player1frame2.bmp",2,1
load image "player1frame3.bmp",3,1
load image "player1frame4.bmp",4,1
do
player1anim=player1anim+1
if player1anim>4 then player1anim=1
if player1anim=1 then sprite 1,p1x,p1y,1
if player1anim=2 then sprite 1,p1x,p1y,2
if player1anim=3 then sprite 1,p1x,p1y,3
if player1anim=4 then sprite 1,p1x,p1y,4
sync
loop

or something along those lines. Personally I find this kind of layout easier to edit and control anyway Obviously you have to write your own code to control the speed of the anim tho

iuxion
21
Years of Service
User Offline
Joined: 19th Jan 2003
Location: United States
Posted: 24th Jan 2003 03:31
Thanks for all your help in this.

I was curious about this since this was the only hiccup I experienced with the DBP trial. From what I’ve seen, it looks like the Dark Basic team is very reliable in helping their customers with problems and patching their products.

I just wanted to say thank you and good job. I’ll be ordering my copy now..,

Login to post a reply

Server time is: 2024-11-23 22:54:05
Your offset time is: 2024-11-23 22:54:05