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.

2D All the way! / probably easy solution on sprites....

Author
Message
celt
20
Years of Service
User Offline
Joined: 27th Sep 2003
Location:
Posted: 24th Oct 2003 22:17
Hi all,
I have been fiddling about with DB classic on and off for a few weeks now. I have been using the lunar lander program on DBheaven as a basis for practicing some basic 2d. I have added some backgrounds, utilised some sprites and sprite collision and chucked some sounds and music in too. I have an explosion sound that plays when I hit a rock e.t.c except I dont know how to replace the sprite with an explosion animation.
Could I somehow replace the sprite with an avi in the exact spot that I collide?
If so how?
Is there another recommendation from one of you guys that I could adopt?

I have a bitmap with an explosion animation on that I could use to import.
Any help would be much appreciated.

celt

p.s I have no knowledge of animation and was planning on learning it for this process.

err help..
celt
20
Years of Service
User Offline
Joined: 27th Sep 2003
Location:
Posted: 24th Oct 2003 23:57
ok i have spent the last couple of hours eating chips, watching pop idol extra and also learning how to animate an explosion.
all i need now is to know how to replace my 'crashed' ship with an exploding animation.

is there a 'replace sprite' command, something like that?

all help appreciated
celt

err help..
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 25th Oct 2003 00:19
The sprite has an image attatched to it. Just attatch a new image to it. In fact attatch all of your explosion animation to it 1 frame at a time. Or make an avi of the animation, hide the sprite, and put the avi in its place.

Pincho.
celt
20
Years of Service
User Offline
Joined: 27th Sep 2003
Location:
Posted: 25th Oct 2003 01:04
I used xpos# and ypos# in the animation loop so that it appeared where the sprite (ship) was.
paste image ani,xpos#, ypos#, 1 (something like that)

it worked but was a bit glitchy and any other sprites on the screen disappeared from the screen which I cant really tell why.

your idea may (read, probably will) work better and I will try tomorrow.

thanks

err help..
Codger
21
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 25th Oct 2003 06:34
Don't use DBC but in DBP
The Sprite Command is "SPRITE #,X,Y,IMAGE

When you need to change the sprite image change From

SPRITE 1,X,Y,1
to
SPRITE 1,X,Y,2

etc.

System
PIII 650 MZ H.P. Pavillion
394 Mem GeForce 4 400MX
celt
20
Years of Service
User Offline
Joined: 27th Sep 2003
Location:
Posted: 25th Oct 2003 17:42
thanks for help so far, but still getting a bit stuck.
below is the code for when i collide with the sides of the screen or another sprite



I have two sprites on the screen, sprite 1 is the ship and sprite 2 is a block I have to avoid. with the above code when I collide, both sprites get deleted although the explosion occurs in the right place. I dont want sprite 2 to disappear.
I know u suggested changing the image attached to the sprite, where in the above code would I do that, perhaps someone could provide an example?
I adapted the above animation from code elsewhere in these forums so I dont pretend to understand it inside out.

any further help would be appreciated.

err help..

Login to post a reply

Server time is: 2024-04-28 10:56:21
Your offset time is: 2024-04-28 10:56:21