// Henjin Bridge Demo // (c) 2008, Notequalsoft Games // http://www.notequalsoft.com/games/henjin/ // This demo demonstrates how to update the state of a map such that when the player's avatar // steps on specific locations, the ability to go "over" or "under" a bridge is changed. // setup system System.Size 640 480 System.CreateViewPort ViewPort 0 0 640 480 // create map canvas with initial setup to allow traffic under the bridge ViewPort.CreateMapCanvas MapCanvas 13 12 64 64 MapCanvas.Background "bridgedemo_background.gif" MapCanvas.RowMask 0 "*************" MapCanvas.RowMask 1 "* *" MapCanvas.RowMask 2 "* *" MapCanvas.RowMask 3 "* ** ** *" MapCanvas.RowMask 4 "* ** ** *" MapCanvas.RowMask 5 "* * * *" MapCanvas.RowMask 6 "* * * *" MapCanvas.RowMask 7 "* ** ** *" MapCanvas.RowMask 8 "* ** ** *" MapCanvas.RowMask 9 "* *" MapCanvas.RowMask 10 "* *" MapCanvas.RowMask 11 "*************" // create the user controlled avatar MapCanvas.CreateObject Avatar 6 9 72 97 "_still1.gif" Avatar.MobileDownImageSrc "_mobile1.gif" Avatar.MobileLeftImageSrc "_mobile1.gif" Avatar.MobileRightImageSrc "_mobile1.gif" Avatar.MobileUpImageSrc "_mobile1.gif" Avatar.Mobile true Avatar.MovementPixelsX 16 Avatar.MovementPixelsY 16 Avatar.VerticalOffset -16 Avatar.UserControlled true MapCanvas.Anchor Avatar // create the bridge and railing MapCanvas.CreateImage Bridge 256 288 320 160 "bridgedemo_bridge.gif" Bridge.ZOrder 1 MapCanvas.CreateImage Railing 256 416 320 96 "bridgedemo_railing.gif" Railing.ZOrder 3 // set up hot zones on either size of the bridge to switch to the appropriate bridge mode MapCanvas.CreateLocationEvent ChangeBridgeToOverLeft Avatar 3 5 CHANGETOOVER ChangeBridgeToOverLeft.SizeY 2 MapCanvas.CreateLocationEvent ChangeBridgeToOverRight Avatar 9 5 CHANGETOOVER ChangeBridgeToOverRight.SizeY 2 MapCanvas.CreateLocationEvent ChangeBridgeToUnderLeft Avatar 2 5 CHANGETOUNDER ChangeBridgeToUnderLeft.SizeY 2 MapCanvas.CreateLocationEvent ChangeBridgeToUnderRight Avatar 10 5 CHANGETOUNDER ChangeBridgeToUnderRight.SizeY 2 // start demo react // change map state to allow traffic over the bridge label CHANGETOOVER MapCanvas.RowMask 4 "* ******* *" // update map mask MapCanvas.RowMask 5 "* *" MapCanvas.RowMask 6 "* *" MapCanvas.RowMask 7 "* ******* *" Avatar.ZOrder 2 // update zorder so that the avatar goes over the bridge but remains behind the railing react // change map state to allow traffic under the bridge label CHANGETOUNDER MapCanvas.RowMask 4 "* ** ** *" // update map mask MapCanvas.RowMask 5 "* * * *" MapCanvas.RowMask 6 "* * * *" MapCanvas.RowMask 7 "* ** ** *" Avatar.ZOrder 0 // update zorder so that the avatar goes under both the bridge and the railing react