Omnimaga
General Discussion => Technology and Development => Computer Projects and Ideas => Topic started by: Spyro543 on November 01, 2011, 04:49:01 pm
-
New Version 2 out. Click here (http://ourl.ca/13759/259807)
I made a very simple fluid simulation in Game Maker:
Link to video (http://www.youtube.com/watch?v=_GuJmUB8HO8)
Here's the source: http://anova.57o9.org/junk/fluid.gm81 (http://anova.57o9.org/junk/fluid.gm81)
The controls are: click to place a wall block, right click to release water, Shift to erase whatever is currently under the mouse, Delete to erase everything, and Enter to make a water pump that continually releases water.
The cellular automata rules are very simple:
1. If space to left empty: move left
2. If space to right empty: move right
3. If both left and right spaces are empty: randomly move either left or right
4. If space below empty: move down
Here's the code I used to simulate the water physics:
if position_empty(x,y+6)
{
y = y + 6;
exit
}
if position_empty(x+6,y) and position_empty(x-6,y)
{
randrange = irandom_range(1,2);
if randrange = 1 {x += 6};
if randrange = 2 {x -= 6};
exit
}
if position_empty(x+6,y)
{
x += 6
exit
}
if position_empty(x-6,y)
{
x -= 6
exit
}
I know I need to add a toolbar or a little box that shows the commands you can use in the next release. Besides this, any other suggestions or comments?
-
Looks pretty interesting. I wonder how the speed compares with a calc equivalent? I unfortunately forgot where was located Builderboy's Axe version on the forums. XD Also to run the gm81 file do I need Game Maker installed? I wonder if you could make an exe file if that's the case?
-
Here it is DJ http://ourl.ca/4279/169816 :D It's part of the physics lessons tutorials. And nice implementation! It seems you stumbled upon the same set of rules that I used! ^^
-
Ah thanks :D. I like that kind of demo.
-
Here it is DJ http://ourl.ca/4279/169816 :D It's part of the physics lessons tutorials. And nice implementation! It seems you stumbled upon the same set of rules that I used! ^^
Yeah I actually used your cellular automata tutorials to make this ^_^
-
I could compile it into an exe for ya. i have the full 8.1 version.
-
I could compile it into an exe for ya. i have the full 8.1 version.
Thanks! For some reason, GM 8.1 won't accept my license I paid for...
-
UPDATE!!! (v2)
Awesome updates!!!
- Particles are now 1 pixel big instead of 6*6 pixels
- Different control scheme
- New particle addition: Sand
Here's the new controls:
- Left click draws walls
- Right click erases whatever is under the mouse
- "W" button creates water
- "S" button creates sand
- Enter creates a water pump
- Delete erases entire board
Here's a video for your enjoyment:
Source file: http://anova.57o9.org/junk/fluid.gm81 (http://anova.57o9.org/junk/fluid.gm81)
If anyone with GM 8.1 Pro could compile this, that would be great!
-
Isn't GM supposed to be free including for compiling? I saw many GM games being compiled using free versions before, the only difference being that no 3D was possible and there was a GM advertisement at the beginning when it was loading.
Btw this looks really nice. :D
-
Do you have plans for adding other particles? And does the sand and water interact? e.g. Does the sand sink? Also, you might find that making the particles larger might be better, as GM gets really slow when you add a lot of objects. This does look really cool though. ;)
-
Update: I guess I can help with it now. :P I added some new elements.
Changes:
Fazer added (allows particles to pass through for 1 second every 2 seconds)
Lava added
Bouncers added
I need help on the Lava+Water=Stone problem though, as "change object" and "create instance" don't seem to work.
-
I always love these, and as inspiration I cooked up my own version (much smaller) a week ago online here (http://www.playmycode.com/play/game/joe/blocky-sand).