To start off my adventures in PB I'd like to write a program that displays falling snow - that is one pixel represents one flake, falling from the top of the screen to the bottom and building up there in drifts as it were. What is the best means of keeping track of a few hundred flakes as they fall at different speeds. Is a list or an array the best option in this regards? To check if a flake has reached the bottom of the screen I'll just check it's status on the Y-Axis, but what about the build-up of flakes along the bottom of the screen? Is a check of the colour of the pixel in front of (below) the falling flake the right way of determining whether a flake continues to fall or not the right way of doing it?
Looking forward to some helpful replies, thanks.
Falling Snow
Re: Falling Snow
http://www.purebasic.fr/english/viewtop ... 60#p337560
Example...
http://www.flashpulse.com/purebasic/Snow%20Test.zip

Example...
http://www.flashpulse.com/purebasic/Snow%20Test.zip

www.posemotion.com
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Even the vine knows it surroundings but the man with eyes does not.
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Even the vine knows it surroundings but the man with eyes does not.
Re: Falling Snow
Thanks for the link, J. Baker, there's no comments which leaves some of it a bit cryptic for me. for starters could you explain whatJ. Baker wrote:http://www.purebasic.fr/english/viewtop ... 60#p337560
Example...
http://www.flashpulse.com/purebasic/Snow%20Test.zip
Static Dim Snow.SnowCalculations(#MaxFlakes) is doing - you have a static array of some type called snow is it??? or is the array called Snow.SnowCalculations - I'm coming from C# so whenever I see dot notation I'm thinking of it like a method or property.
Thanks again.
Re: Falling Snow
http://www.purebasic.com/documentation/ ... ables.htmlThe Th!ng wrote: Static Dim Snow.SnowCalculations(#MaxFlakes) is doing - you have a static array of some type called snow is it??? or is the array called Snow.SnowCalculations - I'm coming from C# so whenever I see dot notation I'm thinking of it like a method or property.
http://www.purebasic.com/documentation/ ... e/dim.html
SnowCalculations it's the data type, it's a structure, so Snow it's an array of structures.
Probably you should give the manual a read from top to bottom before starting to code something not trivial, anyway it's your choice.

"Have you tried turning it off and on again ?"
Re: Falling Snow
Ah, now I understand, thank you for clearing that up and for the links, too.luis wrote:http://www.purebasic.com/documentation/ ... ables.htmlThe Th!ng wrote: Static Dim Snow.SnowCalculations(#MaxFlakes) is doing - you have a static array of some type called snow is it??? or is the array called Snow.SnowCalculations - I'm coming from C# so whenever I see dot notation I'm thinking of it like a method or property.
http://www.purebasic.com/documentation/ ... e/dim.html
SnowCalculations it's the data type, it's a structure, so Snow it's an array of structures.
Probably you should give the manual a read from top to bottom before starting to code something not trivial, anyway it's your choice.
I bought a copy of Programming 2D Scrolling Games for my Kindle yesterday and I have been reading the PureBasic - A Beginner's Guide To Computer Programming *.pdf as well as using the help file that comes with PB.
Regards.