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 Discussion / my little explosion

Author
Message
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 15th Nov 2003 20:03 Edited at: 15th Nov 2003 20:23
for my explosion i am making a sphere and texturing it w/my fire texture. and what i want it to do is start real small then grow and fade out.
i was thinking, how will i go about doing that?
put it in a for/next loop?



but how do i make it fade out? and will that work?

edit:
i got it to work, but it just looks like it instantly grows, but i want it to grow slowly.



Two words, moo.
Turoid
21
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 15th Nov 2003 20:37
try something like this:


explosion=0
do
sync
if spacekey()=1 then explosion = 1

if explosion=1
scale=scale+100
if scale=5000 :` type the max. scale of the object.
scale=1
explosion=0
hide object 5
endif
scale object 5,scale,scale,scale
endif
loop

lalala
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 15th Nov 2003 20:41 Edited at: 15th Nov 2003 20:46
ok, im trying that now : it didnt work.

i have another problem too for anyone who wants to tell me why

when i make a sphere in DB it looks like this on the front end
http://www.geocities.com/deathlink84095/sphere.bmp

i didnt have a problem with that until now, my explosion (see above) is a sphere made in DB, i thought that that would go away when i texture it, but it doesnt! i dont like it! is there anyway to get rid of it?

Two words, moo.
Hell IVIonkey
22
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Outer Limits
Posted: 15th Nov 2003 23:20
His code was fine; look at the concept of the code and apply it to your situation.

Anyhow, I altered it a bit to so what you were asking. Space to create explosion.



=C=
22
Years of Service
User Offline
Joined: 8th May 2003
Location: United Kingdom
Posted: 17th Nov 2003 15:23
How would you change this code to a function?

I have to say that I already know how but, big but, when you convert an in line code to a function sometimes the program stops, executes the function and then continues.

I was wondering if there is a clever way of doing that. Idealy you should be able to write a function that handles itself and is defined as:

function do_explosion(x, y, z, max)
endfunction

where x, y, z the position of the explosion and max the maximum scale of the fireball.

Still I am afraid that once you implement something as a function you loose a bit of the multythreadabily (sic) of your game and that is bad...

Any Advice, issues? knowledge???

-------------------------------
Pointy birds, Oh pointy pointy
Anoint my head, Anointy 'nointy
Hell IVIonkey
22
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Outer Limits
Posted: 18th Nov 2003 07:41
In this situation, as we don't have multithreading capabilities nor even pointer passing, it would probable be best left as a GOSUB.

waffle
22
Years of Service
User Offline
Joined: 9th Sep 2002
Location: Western USA
Posted: 18th Nov 2003 08:13
Add a "stage" parameter to the function and call the function
each time through the main loop. Within the function you adjust the "current" size of the explosion based upon the stage value and have the function return a value that states if the explosion is complete or not.

internet gaming group

Login to post a reply

Server time is: 2025-05-21 18:01:18
Your offset time is: 2025-05-21 18:01:18