Falling Block Game
by Lawrence Benedicto · in Torque Game Builder · 08/17/2007 (7:09 pm) · 2 replies
Hey guys-- I'm looking into making a Tetris Clone for myself, and the tile system looks like it'd be a great way to do.
Unfortunately, I don't really understand it too much. Is there a way, in code, to 'move' a tile to a new position?
I'm sure there's a way to paint tiles in, as you can do it from within the editor? Still, I don't know the commands And the reference isn't helping much.
Eh, yeah so this is sort of a noob question regarding the tiles, I know, but gimme a hand! :D.
Unfortunately, I don't really understand it too much. Is there a way, in code, to 'move' a tile to a new position?
I'm sure there's a way to paint tiles in, as you can do it from within the editor? Still, I don't know the commands And the reference isn't helping much.
Eh, yeah so this is sort of a noob question regarding the tiles, I know, but gimme a hand! :D.
About the author
#2
Moves to a position and sets the position target.
(positionTargetX / positionTargetY, linearSpeed, [autoStop?], [callback?], [snap?], [targetMargin])
"%obj.moveTo("30 20", 10, true, true, true, 0.01))"
positionTargetX/Y - Sets the target position in the world.
linearSpeed - Speed to move to position-target (world-unit/sec).
autoStop - Whether to reset any linear-velocity when the target is reached. The default is true.
callback - Whether to callback "onPositionTarget()" when the target is reached. The default is false.
snap - Whether to position the object exactly to the position-target when it is reached. The default is true.
targetMargin - Specfies a margin (proximity) to the target position that is allowed to qualify as reaching the target position. The default is "0.1".
NOTE:- This call calculates/sets the linear velocity required to move to the specified position at the selected speed. It additionally sets a target-position for the specified position (see "setPositionTarget()"). It is important to note that if the movement is interrupted by a collision, the target is still set! If the object (at some point in the future) occupies the target area then the object move is completed as normal. Essentially, the object is not forced to the target, only sent.
10/13/2008 (12:10 pm)
T2dSceneObject.moveTo();Moves to a position and sets the position target.
(positionTargetX / positionTargetY, linearSpeed, [autoStop?], [callback?], [snap?], [targetMargin])
"%obj.moveTo("30 20", 10, true, true, true, 0.01))"
positionTargetX/Y - Sets the target position in the world.
linearSpeed - Speed to move to position-target (world-unit/sec).
autoStop - Whether to reset any linear-velocity when the target is reached. The default is true.
callback - Whether to callback "onPositionTarget()" when the target is reached. The default is false.
snap - Whether to position the object exactly to the position-target when it is reached. The default is true.
targetMargin - Specfies a margin (proximity) to the target position that is allowed to qualify as reaching the target position. The default is "0.1".
NOTE:- This call calculates/sets the linear velocity required to move to the specified position at the selected speed. It additionally sets a target-position for the specified position (see "setPositionTarget()"). It is important to note that if the movement is interrupted by a collision, the target is still set! If the object (at some point in the future) occupies the target area then the object move is completed as normal. Essentially, the object is not forced to the target, only sent.
Torque Owner Lawrence Benedicto
Commands are:
t2dTileLayer.setStaticTile("x y", imageMap); // To create a tile and... t2dTileLayer.clearTile("x y"); // To clear one, obviously.Kind of thinking about how I'm going to approach the whole thing still, but I think those are the basic tools :P.