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 Discussion / Cellular Autonomy: Sand!

Author
Message
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 27th Oct 2007 17:37 Edited at: 28th Oct 2007 20:58
Here's another cellular autonomy program
I've found that having a buffer, and what you do with it, is one of the most important things for this type of program.

I've used an array to store two versions of the world, a buffer and active version. This allows the program to make changes to the world that don't effect the cells that have yet to be checked.
The sand tap only exists in one version of the world, and so the line of falling sand is dotted.



[edit]
Sand! version 3
I've tidied it up a bit (cell detection is still horrible with lots of if statements) and it will now scale the grid to fit in the screen. I haven't let the user adjust the grid's size but I've labelled the variables in the code so you can change them.


Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 27th Oct 2007 19:40 Edited at: 28th Oct 2007 20:56
edit
sorry this was kind of a pointless double post

demons breath
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 27th Oct 2007 19:46
That's a really cool programme mate.

http://jamesmason01.googlepages.com/index.htm
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 27th Oct 2007 20:12 Edited at: 27th Oct 2007 20:13
thanks demon
didn't recognise you there, I like the new avatar
I'd love to make a game with this

luke810
18
Years of Service
User Offline
Joined: 4th Sep 2006
Location: United States
Posted: 27th Oct 2007 20:50
It is pretty cool.

You should add a random to the check though so the sand can go left or right. It would add more realism.
demons breath
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 28th Oct 2007 12:20
Yeah the forum wiped all my data and I couldn't find the old picture so I put a God Forbid cd cover up

I played about for ages with the new updated version - it's really cool.

One of my old phones had some sort of SandArt thing on it - you could stop and start sand, move where the nozzle thing was and change the colour of the sand. That was quite cool. It was the best thing on my phone (which just tells you how lame it was) and it was in black and white so it was worse. But if you can come up with a more interesting thing to do with it I'd be interested to see what else you can do with this idea.

Login to post a reply

Server time is: 2025-05-31 21:30:21
Your offset time is: 2025-05-31 21:30:21