Author Topic: How do you make a evented brick color move?  (Read 1493 times)

Kind of, but when I do that, it doesn't work, this is how I do it
You press the action button and a pixel pops up, when you press the arrow he moves right, then I get stuck. What I do is I make him move but a red brick trails behind him.
I hopw this isn't a big bump

I had invented a nice movement system before for this purpose :D

1) Name all the bricks on the screen that you can move to "PlayerNotHere"
2) Name the brick you start on "PlayerIsHere"
3) Put these events on all the PlayerNotHere bricks AND the PlayerIsHere brick:

Code: [Select]
onRelay -> Named Brick "PlayerIsHere" -> setColor -> Black
onRelay -> Named Brick "PlayerIsHere" -> setBrickName -> "PlayerNotHere"
onRelay -> Self -> setColor -> Red
onRelay -> Self -> setBrickName -> "PlayerIsHere"

4) Create your four directional buttons. Have them fire a relay in the direction you want it to go from PlayerIsHere. For example, to move your "character" north, you'd put:

Code: [Select]
onActivate -> Named Brick "PlayerIsHere" -> fireRelayNorth
And thats really all there is two it. Barely any events, takes almost no time to put on (especially with the duplicator), even for large screens. The buttons also only have one event each!

"Walls" or the boundaries of the screen should not have any events on them. This way nothing happens when you shoot it with the relay called from your buttons.

Questions? Feel free to inquire further.

Forgot to mention that setBrickName is an add-on event, which you can download off the forums here.