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.

Code Snippets / Missile Smoke Trails

Author
Message
adr
21
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 30th Jun 2003 01:12 Edited at: 5th Sep 2003 21:59
I've been trying for a while to get realistic-ish missile trails using the native particle system, but gave up and wrote some code this afternoon which does it nicely.

image deleted

This code is really pitched at a newbie, since it's quite simple. I suppose it's just handy to have knockin about really. It only handles one missile at a time (so you can't unleash terror) which is what I need in my game, but I suppose that could be easily adapted with a 'Missile Age' array...



If you use this in a game and you feel like crediting me, go for it. If you don't, then it's not like you wouldn't have figured this out for yourself after a while...

Enjoy

-- edited -- removed a text() call in the example

A wise man once said: "I know that I need codes but I dont know the codes"
adr
21
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 30th Jun 2003 02:41 Edited at: 16th Aug 2003 14:36
Here we are, a coupla tweaks later, and it's in the game:

http://www.fuzzee.co.uk/game/heli/shot10.jpg

I opened the case to my PC today and thought, my exhaust fan sucks.
Morales
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: - Please Select -
Posted: 30th Jun 2003 07:22
that looks good!!

whats global for? never heard of this comand
Puffy
22
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United States
Posted: 30th Jun 2003 07:52
o_O variables by nature are local... only used in a specific function... but when you make it global ... it can be used within functions and within other functions... =\ I just go ahead and use references... only globals I would make are constant... =P

EVERYONE LOVES THE PUFF!... =\
KamaKase
22
Years of Service
User Offline
Joined: 29th Oct 2002
Location:
Posted: 9th Aug 2003 21:25
If you make a global outside a function, call the function, change the global in the function. When you end the function would the global have changed value or would it be out of scope?
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 10th Aug 2003 03:06
KamaKase : why not just try it yourself!

See code below, the variable 'a' is global and if set in a function, it keeps its value outside the function.

Remember also, arrays are global's default and functions automatically have access to all arrays defined outside the functions.



The programmer formerly known as sonic
Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 10th Aug 2003 16:04
Page not found on the image

cuRant PRogekt: a three-de map editer
Why the hell'd you ask me for crying out loud!?!
Athelon XP 1400 Plus - Nvidia Geforce MX400 - 256mb RAM
adr
21
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 16th Aug 2003 14:36
Forgot about this post

Changed the links ....

I opened the case to my PC today and thought, my exhaust fan sucks.
KamaKase
22
Years of Service
User Offline
Joined: 29th Oct 2002
Location:
Posted: 5th Sep 2003 19:56
I did, I was just being lazy (I have to turn the other comp on....grrrr).

The links still don't work BTW....and I wanna see!!!
adr
21
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 5th Sep 2003 22:00
sorry - I posted it so long ago and it looks like I've deleted the image!

Just make a black square (64x64) and splash on some grey in a air-brush like fashion. Use that as the smoke texture and use the code.

A wise man once said: "I know that I need codes but I dont know the codes"

Login to post a reply

Server time is: 2024-11-24 01:45:51
Your offset time is: 2024-11-24 01:45:51