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 / Explosions Anyone?

Author
Message
Dom
20
Years of Service
User Offline
Joined: 31st May 2004
Location:
Posted: 10th Oct 2004 20:48
BOOM! Hehe!
Thats what I want to happen!
***SILENCE*** Huh?
Thats what does happen!
Can someone help me create some sort of explosion to put into my game. E.g: Rocket hits wall, BOOM!!!!!
Any help will be most aprecciaated

MAIN GAMES PRESENTS: Catz
Turn Based War Game
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 11th Oct 2004 03:14 Edited at: 11th Oct 2004 03:14
visualy or audibly? all you need to do is to place the correct commands in the statements that handle the collision, either load and play a sound and/or run some kind of particle system or animation (coded or predefined).

Mentor.

PC1: P4 3ghz, 1gig mem, 3x160gig hd`s, Radeon 9800pro w cooler (3rd gfx card), 6 way speakers.
PC2: AMD 2ghz, 512mb ram, FX5200 ultra, 16 bit SB.
Mini ATX cases suck.
Dom
20
Years of Service
User Offline
Joined: 31st May 2004
Location:
Posted: 12th Oct 2004 03:47
Quote: "run some kind of particle system or animation (coded or predefined)"
Thats the bit I need help with

MAIN GAMES PRESENTS: Catz
Turn Based War Game
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 12th Oct 2004 06:05
V simple explosion thingy


sync on:sync rate 40
autocam off
position camera 25,25,25
point camera 0,0,0
rem explodable cube
make object cube 1,1
basic_particles()
exploder#=0.0
load sound "boom.wav",1

do

text 0,0,"press space to explode cube"

if spacekey()
exploder#=1
endif

if exploder#>=1
play sound 1
fadeout=300
hide object 1
repeat
for i=1 to 40
move object i+1,0.5
scale object i+1,100+exploder#,100+exploder#,100+exploder#
exploder#=exploder#+0.9
fade object i+1,fadeout
next i
sync
dec fadeout,5
until fadeout=0
exploder#=0.0
for i=1 to 40
delete object i+1
next i
basic_particles()
show object 1
ghost object off 1
endif
sync
loop

function basic_particles()
rem crude particles (spheres...ouch! polygon count)
for i=1 to 40
make object sphere i+1,0.5+(rnd(100)/200.0)
ghost object on i+1
point object i+1,rnd(100)-50,rnd(200)-50,rnd(100)-50
next i
endfunction

just take some spheres, place them inside the object, point em at all points west, then delete the object and let em fly and fade, this is VERY polygon intensive though, use plains instead and point them at the camera, or place a plain at your objects position with a animated explosion texture, then play the animation and ghost and then fade the object at the same time, or you could animate the models explosion in an editor and then run that animation when you blow it up, just remember to scale and lose all the parts before the end of the animation.

Mentor.

PC1: P4 3ghz, 1gig mem, 3x160gig hd`s, Radeon 9800pro w cooler (3rd gfx card), 6 way speakers.
PC2: AMD 2ghz, 512mb ram, FX5200 ultra, 16 bit SB.
Mini ATX cases suck.
PoHa!84
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location: To your left.
Posted: 12th Oct 2004 08:39
Might I also suggest the particle effects example that can be found in the Dark Basic help files? It doesn't have sound or pretty-ness, but it can easily be tweaked:



something
Dom
20
Years of Service
User Offline
Joined: 31st May 2004
Location:
Posted: 14th Oct 2004 01:45
Cool. Thanks

MAIN GAMES PRESENTS: Catz
Turn Based War Game

Login to post a reply

Server time is: 2025-05-24 21:15:29
Your offset time is: 2025-05-24 21:15:29