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 Professional Discussion / Custom particles code and demo...

Author
Message
WLGfx
18
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 5th May 2011 03:54 Edited at: 6th May 2011 13:25
It's in it's beginning at the moment but I've got the basic to work and it's pretty fast so far. The demo shows two type of particles, one that trails a bullet and the other type used for smoke. The initialisation creates simple images so far but when it's finished the particles will be able to be animated and have more movement available. Any ideas welcome to improving on this.

Here's the particle code: download attached for a demo (uses sparky's but the exe will run)

Hope it helps anyone out!

Warning! May contain Nuts!
petethesparky
15
Years of Service
User Offline
Joined: 18th Mar 2011
Location:
Posted: 6th May 2011 01:30
When I tried to run it the error was..

"You have hit a function declaration mid-program!"
WLGfx
18
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 6th May 2011 02:35 Edited at: 6th May 2011 02:44
I used codesurge to compile the project. The header file for the particles I had to put at the top of the compile order, then main and then the rest. I was thinking of trying to declare the global dim arrays in the init functions to see if that worked.

Codesurge allows you to prioritise the compile order which is the only thing I dislike about DBP. I'll have a look at it in the morning and change the code around to suit both compilers...

EDIT: if you've downloaded the source then the head file for the particles just copy the text to the top of the main file and try that. I'll get that part sorted. It annoyed me, I'm used to C++.

Warning! May contain Nuts!
WLGfx
18
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 6th May 2011 13:26
Fixed now. The WLP_INIT_PARTICLES() function now initialises the global arrays. No need for a header file before the main file.

Warning! May contain Nuts!

Login to post a reply

Server time is: 2026-07-11 04:24:24
Your offset time is: 2026-07-11 04:24:24