This site requires JavaScript, please enable it in your browser!
Greenfoot back

mjrb4's Comments

Back to mjrb4's profile

mjrb4mjrb4

2008/8/22

...because simplicity is often best!
mjrb4mjrb4

2008/8/22

Really nice idea! I used to spend hours playing with these and never getting anywhere... Now here's a challenge - how about a solve button? One that actually solves the puzzle by sliding the blocks so you can see what it's doing? I might have a go at that myself actually when I'm next in the mood for a challenge...
mjrb4mjrb4

2008/8/19

Wow, now that's tough!
mjrb4mjrb4

2008/8/14

I have an idea to make it a bit trickier - instead of all the balls starting at 0 velocity, you could assign them a small value to start with just so you're forced to do something rather than sit there with them all accumulating in the middle!
mjrb4mjrb4

2008/8/12

Ahh it was me, I was dragging it up and down rather than left and right!
mjrb4mjrb4

2008/8/9

Nice idea! The tilting of the board seems a bit jerky though and it's hard to get the mouse right on it - any chance it could be smoothened up?
They're actors - I did try drawing them directly to the background, but that seemed to make things worse. Though thinking about it, that was my coding at 2 in the morning so there's a good chance there was something I missed...
Actually, I scrapped the array of points / redraw the entire screen each time for the reasons you mentioned pretty early on, I figured it'd be pretty inefficient and get very laggy after a while, especially redrawing the whole screen. In fact, none of the lines are stored at all. There's only one point stored, and that's the previous one. Then it draws a line between the previous point and the new one, then sets the new point to the previous point and loops again. Nothing is redrawn at all, it's just one line drawn per act cycle (while the mouse is being dragged, of course.) The only reason I can think of for it being laggy is the sheer number of lines on the screen - and there's not a lot I can do about that!
mjrb4mjrb4

2008/7/31

That's the next thing to do! This was forming the basis of a tutorial though and I wanted to keep it very simple to start with. Hopefully it'll build up into something a bit better.. :)