I am working on a "dust" routine that can be used with platformers. ie: When the player decelerates is creates a small particle "cloud" of dust behind it.
The reason it is in AI Slop is that, I originally used AI to create a routine and example for RCBasic 4. RCB is my "goto" Basic and have been using it for years... I figured it may be useful for the platformer that 1michael is creating. Although the program runs perfectly in RCB, I cannot get it to run with N7.
"(renv) dust4.n7:230,155: runtime error: Index 0 not found (BC_MLOAD_R)"
10-06-2026, 05:03 AM (This post was last modified: 10-06-2026, 06:49 AM by Marcus.)
(10-05-2026, 10:15 PM)johnno56 Wrote: I am working on a "dust" routine that can be used with platformers. ie: When the player decelerates is creates a small particle "cloud" of dust behind it.
The reason it is in AI Slop is that, I originally used AI to create a routine and example for RCBasic 4. RCB is my "goto" Basic and have been using it for years... I figured it may be useful for the platformer that 1michael is creating. Although the program runs perfectly in RCB, I cannot get it to run with N7.
"(renv) dust4.n7:230,155: runtime error: Index 0 not found (BC_MLOAD_R)"
I will attach the RCB listing for reference....
I seem to struggle with array errors... *sigh*
I haven't tested the code, since I'm on my phone. But, maybe, replace:
Code:
dust_x = [MAX_DUST]
with
Code:
dust_x = fill(0, MAX_DUST)
Same goes for the other arrays. 'dust_x = [MAX_DUST]' just puts the value MAX_DUST in an array. 'a = fill(value, size)' fills an array of size 'size' with 'value'.
But I'll try the code later today
Edit: That worked At first I couldn't spot the dust, but after changing its color I could. And you need to add 'true' as a last parameter to 'draw rect' for it to be filled:
Code:
...
set color 64, 64, 64, alpha
'------------------------------------------------
' Dust is deliberately wider than it is tall.
' This gives a small horizontal puff.
'------------------------------------------------
10-06-2026, 07:04 AM (This post was last modified: 10-06-2026, 07:05 AM by Marcus.)
It is certainly 100% super okay to use different arrays for the dust properties! But you could also use a single array filled with objects (or tables or whatever one wants to call them). I've attached a modified version of the code that does that.
Thank you, sir. I will have to remember the "fill" command. Yes. I had to change the colour as well. So, the dust colour, may have to be modified to suit the game. The idea was to create a simple method of making dust. The next step is to add it to an actual platformer... Could be fun...
I think with larger screen sizes, elliptical dust would be ok and rectangles for low res... Just a thought
Hi Johnno, I see that this started with a look at the Particle Library in N6 that Marcus provided. That library was actually translated many moons ago, and I'll attach it here, in case it helps at all in your investigations:
There's also a very simplified program included that can be used to see the effect of changing various parameters. I wrote this years ago, and had forgotten about it, so there may well be bugs or issues with it
10-06-2026, 07:00 PM (This post was last modified: 10-06-2026, 07:28 PM by johnno56.)
I have just downloaded the Demo... At the moment I have priorities... I have just started my 6am coffee... But rest assured... your Demo will be next... lol
Well... I figured that I only need one hand to drink coffee... May as well attempt a little multi-tasking! lol
Oh... I remember this program... I tinkered with it several times, just to see what it could do, but as usual, programs such as these, were way over my head... Do not get me wrong... It is a VERY impressive piece of work... I just couldn't figure out how to apply it to a game/program... lol
Now that I am retired, it seems that I should have a lot more available time to spare... lol Now that I have your program, I will "take it out for a spin" and check out all the functions and you never know... I might be able to figure out how to apply it... lol
(10-06-2026, 03:23 PM)kevin Wrote: ... the Particle Library...
Thank you for sharing the particle effects. They're really interesing. I've never seen anything quite like them before.
For game development, I think they could be useful for visualizing things like magic spells, as well as explosions in a galaxy space shooter game.