Using switches and moving tiles

Knowledgebase / Using switches and moving tiles

moving-tile switch

Moving tiles from the Gamefroot Classic Pack have a Moving Tiles script attached to them. This script makes the moving tile move to a location set in its instance properties, and it will continue to move back and forth between that point and its starting location. The switch object can be used to start and stop the moving tile.
To change its properties, right-click on it and select Instance Properties.
moving-tile-properties
These are the properties you can change on a moving tile:
  • Active: Set this to true to make it move as soon at the level starts.
  • My tag: this is the tag that a switch can use to identify the moving tile it will turn on or off.
  • Speed: how fast the moving tile travels.
  • End Location: the position that the moving tile will move towards.
Switches from the Gamefroot Classic Pack have a Switch script attached to them. This script makes a moving tile start or stop moving when the player character interacts with it by pressing spacebar.
To change its properties, right-click on it and select Instance Properties.
switch-properties
These are the properties you can change on a switch:
  • Player tag: The switch can only be activated by an object that has this tag (default is player).
  • Moving tile tag: The switch will only activate the moving tiles that have this tag (default is moving-tile).