Game Development Community

Tetris Turtorial

by Eugene Schaeffer · in Torque Game Builder · 11/29/2007 (10:19 pm) · 4 replies

I am following the instructions as closely as possible but I think I might have over looked something. I am on the section before the Lateral movement. I went to test the block falling and nothing was falling, all the coding is right. (I think) here is what the console shows me:

Tetris/gameScripts/games.cs (77): Unable to find object:'WellTileMap' attempting to call function 'getTileCountY'

Here is the code:

//function sceneWindow2D::onUpdateScene(%this)<-- one did not give me the error but it still did not drop the block

function t2dSceneGraph::onUpdateScene(%this)
{
// current scene time in miliseconds
%curTime = %this.getSceneTime()*1000;

// time for a new update?
if(%curTime - $SCENE::LastUpdateTime > $GAME::SHAPES::MOVESPEED)
{
if( isValidMove("0 1", $GAME::CurrentShape) )
{
$GAME::CurrentShape.Erase(WellTileMap);
$GAME::CurrentShape.Move(0,1);
$GAME::CurrentShape.Draw(WellTileMap);
}
// else
// test for complete lines
// test for end of game
// move to next shape

$SCENE::LastUpdateTime = %curTime;
}
}
// is the shape allowed to be at %position? Returns true if the shape will
// not collide with the arena walls or another block

If in one has any ideas please let me know.
Thank you,
Rick

#1
11/29/2007 (11:26 pm)
In the console (when your game is running), type:

echo(isObject(WellTileMap));

I suspect that the object is not there, or your "WellTileMap" object is not the name of a Tile Map/Layer.
#2
11/30/2007 (5:24 pm)
I tried renaming the layer to WellTileMap and then check the setting with the echo and it still showed that there is no object found. The echo shows a 0 for False or no object found. Any other ideas?
Thank you.
#3
12/08/2007 (1:01 pm)
This may be dumb question, but when you select your WellTileMap in the level, underneath the Scripting rollout do you have WellTileMap in the name box?
#4
12/10/2007 (9:43 am)
That did it thanks. I am sure I will have more questions latter but for know that solve the problem.