Page 1 of 1

[HELP] Falling "sand" timer

Posted: Mon Aug 18, 2014 2:16 am
by lolsasory
So I have a timer that counts down and every second it "drops" a pixel, I have it stop at the bottom of the screen minus one pixel, but how do I have it interact like falling sand? I've looked at physics in the game but I dont get it. Ive also tried looking at others falling sand games and that doesn't help either.

Re: [HELP] Falling "sand" timer

Posted: Fri Sep 19, 2014 6:43 pm
by artofwork
Your code has no physics at all, sure your using a rectangle to draw on screen in the Y but your not telling love, Hey! these rectangles are physical objects treat them as such.

Use this tutorial below and change your code accordingly.
http://www.love2d.org/wiki/Tutorial:Physics

Re: [HELP] Falling "sand" timer

Posted: Sat Sep 20, 2014 10:30 am
by Jepcats
You can also implement your own gravity, collision detection, and things like that as well if you like. You could do something like for each sand grain check what the positions and velocities of the neighbouring sand grains are and update accordingly.