Game Development Reference
In-Depth Information
Figure 7-49. Registering the Touch X value
Create a new rule with the condition ''Actor receives event'' ''touch'' is
''released.'' Then drag and drop a Change Attribute behavior in the rule and
change game.ReleaseX to devices.Mouse.Position.X, as shown in Figure 7-50.
Figure 7-50. Registering the Release X value
Next, create a rule that will check when Touch is release if the x positions are
the same and if the level is unlocked.
Create a new rule with the conditions of:
''All''
''Actor receives event'' ''touch'' is ''released''
''Attribute'' ''game.ReleaseX'' ''='' ''game.TouchX''
''Attribute'' ''BoxLevel.Level'' ''≤ ''game.MaxLevel''
Then drag and drop a Change Attribute behavior into the rule and change
game.WhatLevel to BoxLevel.Level. Last, drag and drop a Change Scene
behavior and change the settings to ''Go to Scene:'' ''Initial Scene,'' as per
Figure 7-51.
Search WWH ::




Custom Search