![]() |
||||||||||||||
|
||||||||||||||
blade2k
» articles & tutorialsboulder to switch tutorial
<>Four variables <>A common event <>A switch (or another variable) The principle behind this is that you calculate how many steps away from the target switch the boulder is. Make two events, one for the "Boulder", one for the "Target". Make sure the "Target" event is set on "Parallel Process". First off, my first test boulder was one step down and two steps to the right. In this case, get into the "Target" event and open up "Variable Operations." <>Variable Oper: [XXXX:targetX] Set, 2 **this is because the boulder is two steps away on the X-axis <>Variable Oper: [XXXX:targetY] Set, 1 **this is because the boulder is one step away on the Y-axis That's all the coding for the "Target". Next, the "Boulder." Make a blank page and a new switch. Name it something like, "puzzleon" or something and have this page make it turn on. Then, make a new page, with "puzzleon" as the switch trigger. Then, make four separate branch conditions with no "Else" statements; we won't be needing them. <>Branch: Hero Left Facing __<>Variable Oper: [XXXX:boulderX]+, 1 **shows that the boulder is moving closer to the target on the X-axis __<>Move Event: this event, Move Away from Hero **make sure to check the "ignore impossible moves" box. <>Branch: Hero Right Facing __<>Variable Oper: [XXXX:boulderX]-, 1 **shows that the boulder is moving away from the target on the X-axis __<>Move Event: this event, Move Away from Hero **make sure to check the "ignore impossible moves" box. <>Branch: Hero Up Facing __<>Variable Oper: [XXXX:boulderY]+, 1 **shows that the boulder is moving closer to the target on the Y-axis __<>Move Event: this event, Move Away from Hero **make sure to check the "ignore impossible moves" box. <>Branch: Hero Left Facing __<>Variable Oper: [XXXX:boulderY]-, 1 **shows that the boulder is moving away from the target on the X-axis __<>Move Event: this event, Move Away from Hero **make sure to check the "ignore impossible moves" box. Copy this to the first page, and that's all the coding for the "Boulder" Now go into common events. make a branch statement within another branch statement, with no "Else" statements. Make it a "Parallel Process" and the trigger switch is the "puzzleon" switch we made a few seconds ago. <>Branch: Var [XXXX:boulderX] is V[XXXX:targetX] Equal **signals when the two events are on top of each other on the X-axis __<>Branch: Var [XXXX:boulderY] is V[XXXX:targetY] Equal **signals when the two events are on top of each other on the y-axis ____<>Message: The puzzle is now working **completes the test ____<>Switch Operation: [XXXX:puzzleon] OFF **keeps the puzzle from looping And that's how it's done! It should work, but you can't make it go off the target and back to make it work. If you want to do that, then add a: <>Switch Operation: [XXXX:puzzleon] ON to the second page of the "Boulder". ::xtremedrummerguy:: ::xtremedrummerguy@hotmail.com:: |
|
|||||||||||||
|
©2002-2008 blade2k.net - parsed in 0.002 seconds - view active users
[15976 members][newest member: Onisan666]
Active Users (0)
|
||||||||||||||