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 / [DBP] Fire Generator

Author
Message
Ankillito
17
Years of Service
User Offline
Joined: 10th Dec 2006
Location: Litigious California
Posted: 21st Apr 2007 09:33 Edited at: 22nd Apr 2007 05:31
I just put this in the code base. I want to polish it up some more, but maybe it'll be a good start for someone. Any recommendations on how to improve would be welcome.

[Edit] updated with Jack's line.
Here's a full app


Here's just the setup subroutine:


Here's the sub for inside a loop:


"There will always be evil, for, without evil, the good shall lose their virtue."
Ankillito
17
Years of Service
User Offline
Joined: 10th Dec 2006
Location: Litigious California
Posted: 21st Apr 2007 10:00
Hm... I tried using these subs in another program of mine, and am getting quite confused. Maybe these subs aren't as easy to integrate as I thought the were...

"There will always be evil, for, without evil, the good shall lose their virtue."
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 21st Apr 2007 13:38
Functions all the way! (cool fire btw)

Jack
20
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 21st Apr 2007 20:02 Edited at: 21st Apr 2007 20:06
Hi Zotoaster.
Just add
"disable object zwrite Flame(i).ID"

after you've created the plane. It will fix a ghost object on bug.


[/center]
Ankillito
17
Years of Service
User Offline
Joined: 10th Dec 2006
Location: Litigious California
Posted: 22nd Apr 2007 05:29
@ Zotoaster: I agree, but is there a way to pass a whole array into a function?

@ Jack: You ROCK!!!

"There will always be evil, for, without evil, the good shall lose their virtue."
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 22nd Apr 2007 15:30
Quote: "but is there a way to pass a whole array into a function?"


Nope. It's really annoying that you can't, though just recently I discovered that DBP can use pointers that can be stored just like a regular variable. The idea is, that a pointer variable basically has a memory location, and the amount of memory it takes up, so you can use each one of those memory locations to store data just like you would an array, but they are harder to handle.

david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 23rd Apr 2007 05:51
@ankillito, I am going to be making a particle system based on dark physics, I would like to know if it is ok if I use this as a base to start that system from.

Thank you.
Ankillito
17
Years of Service
User Offline
Joined: 10th Dec 2006
Location: Litigious California
Posted: 23rd Apr 2007 06:09
Um, ask Joseph Thomson. The visual product was all his design. All I did was make the code faster, more modular, and easier to apply. If it was my choice, I'd say yes. Besides, I put it in the code base, so isn't it anybody's game?

"There will always be evil, for, without evil, the good shall lose their virtue."
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 23rd Apr 2007 06:18
ok then I guess I will use it...Thanks
Ankillito
17
Years of Service
User Offline
Joined: 10th Dec 2006
Location: Litigious California
Posted: 27th Apr 2007 02:37
Well, Joseph Thomson put it in the code base, and my Dad, who used to teach programing, seems to think it's ok.

Is DarkPhysics that add-on that requires a special CPU?

"There will always be evil, for, without evil, the good shall lose their virtue."
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 27th Apr 2007 03:04
It dosent require and add-on card, but if you get one you get a performance boost. So its a personal decision.
Pricey
21
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 18th May 2007 14:22
you don't need to pass arrays into functions
arrays are automatically all global

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 18th May 2007 15:27
That is a good point, and an annoying one too ¬.¬

Ankillito
17
Years of Service
User Offline
Joined: 10th Dec 2006
Location: Litigious California
Posted: 19th May 2007 02:45


ok then, I'll just go give myself a concussion from hitting my head against my desk.

"There will always be evil, for, without evil, the good shall lose their virtue."
HeavyAmp
18
Years of Service
User Offline
Joined: 25th Oct 2006
Location: Castle in the Sky!
Posted: 20th May 2007 05:06
Man thats a nice fire effect!

In theory, there is no difference between theory and practice. But, in practice, there is.
Ankillito
17
Years of Service
User Offline
Joined: 10th Dec 2006
Location: Litigious California
Posted: 20th May 2007 05:08
Thx! Check out what I did with it in my screen saver!
http://forum.thegamecreators.com/?m=forum_view&t=106584&b=8&p=0

"There will always be evil, for, without evil, the good shall lose their virtue."

Login to post a reply

Server time is: 2024-11-22 18:44:44
Your offset time is: 2024-11-22 18:44:44