Hi,
I've trying to create a game with my son similar to a game qix (http://www.scratch.mit.edu/ext/youtube/?v=NEq-mxFDuHM) I used to play when I was young. What I need to do is, using the arrows move a sprite around the screen, using pen this sprite draws a red line, when you hit the edge which has a boundary of a black line, the red line I’ve drawn changes color to black. I've a ball randomly moving around the screen when it hits black it bounces back. The idea of the game is to try and fill in as much of the stage with black lines thus reducing the amount of space the ball has to move around in. The catch is, if this ball hits the red line I’m drawing, I’m dead. If I make it to another black line or the boundary black line the pen line I’ve drawn changes to black and if the ball hits it now, it bounces off and I’m safe. My problem is, is there any way to change the pen line I’ve drawn to black like I’ve described above.
Thanks.
Offline
NoxSpooth wrote:
I might be wrong, but... Once the line is drawn, you can't change its color...
This is correct, but what you can do is draw over it in black. I know the game you're talking about and used to enjoy it a lot too
I guess the easiest way to make this work would be to record where the mouse was clicked to start the lines and then run something like this once the drawing sprite hits black:
if<touching color [black]?> set pen color to [black] go to x: (click x) y: (click y) pen up end
Offline
Though you can't change stuff that's already been "penned," you can create a sprite that would go over all of your printed lines with black. Create a sprite, shaped like your ball but +1 pixel larger in all directions and give it this script:
when greenflag clicked pen up clear delete (all v) of [PennedX v] delete (all v) of [PennedY v] set pen color to [black] forever go to [Ball v] add (x position) to [PennedX v] add (y position) to [PennedY v] if <touching color [black]?> repeat (length of [PennedX v]) go to x: (item (1) of [PennedX v]) y: (item (1) of [PennedY v]) delete (1) of [PennedX v] delete (1) of [PennedY v] end end
Offline