Alpha2 ---> Mounted Camera + Force + Filter Pad
by Glenn Prince · in Torque Game Builder · 01/18/2006 (7:22 pm) · 2 replies
Hey guys,
Not sure if this is a bug or if it even is going to sound right but here goes. I have a "pixeled" sprited (eg Hand Pixeled not 3D so it's made to be drawn unblurred etc) and consequently I have set it up as a t2DAnimatedSprite with the filterpad=true variable set. This works all good and looks brilliant. Now the problem comes in with a mounted "camera" that I have set. When this camera has a force value attached to it of "0" I get no problem, but I like the idea of having the camera "look forward" when the player is facing left or right. So I change the force value to approx 2 - 3. Now when the camera moves to catch up to the player's position I get some weird, minute changes occuring that slighty distorts the sprite until the camera finally stops moving.
Now is there a way to set something up so that the camera will only ever move the pixels to the left / right without distorting them ? Thats the only way I can thing of that would stop it. I'll post my compiled project up tonight.
If you need more info please let me know.
Cheers,
Glenn
Not sure if this is a bug or if it even is going to sound right but here goes. I have a "pixeled" sprited (eg Hand Pixeled not 3D so it's made to be drawn unblurred etc) and consequently I have set it up as a t2DAnimatedSprite with the filterpad=true variable set. This works all good and looks brilliant. Now the problem comes in with a mounted "camera" that I have set. When this camera has a force value attached to it of "0" I get no problem, but I like the idea of having the camera "look forward" when the player is facing left or right. So I change the force value to approx 2 - 3. Now when the camera moves to catch up to the player's position I get some weird, minute changes occuring that slighty distorts the sprite until the camera finally stops moving.
Now is there a way to set something up so that the camera will only ever move the pixels to the left / right without distorting them ? Thats the only way I can thing of that would stop it. I'll post my compiled project up tonight.
If you need more info please let me know.
Cheers,
Glenn
#2
btw the game is looking cool, I really like the art style :D
*edit* i guess you could use mFloatLength( float, 0), mFloor( float ), mCeil( float ).. But I tried doing this and it doesn't give the results I'd expect, things will stop moving etc (if you're using numbers like 0.1 to increase stuff).
I'm kind of stumped, plus when you start using 1 as the smallest number things move and increase really fast... related to the FPS ? I'm new to T2D....
01/19/2006 (3:58 pm)
I think its mainly related to the camera moving with floating point numbers.. to get from 1 to 2, the camera will be using stuff like 1.235423 etc.. you could try rounding down or rounding up so the camera is always using integers maybe? i think you would use mfloor()btw the game is looking cool, I really like the art style :D
*edit* i guess you could use mFloatLength( float, 0), mFloor( float ), mCeil( float ).. But I tried doing this and it doesn't give the results I'd expect, things will stop moving etc (if you're using numbers like 0.1 to increase stuff).
I'm kind of stumped, plus when you start using 1 as the smallest number things move and increase really fast... related to the FPS ? I'm new to T2D....
Torque Owner Glenn Prince
members.optusnet.com.au/~gprince79/t2d/X-99%20Release.zip
Looking at the problem now, when you move then stop it's almost like the tiles shear or don't update properly. The code that controls this is basicly:
The datablock for the tiles is:
datablock t2dImageMapDatablock(level01_tiles) { imageName = "~/images/citytilesheet"; imageMode = cell; cellWidth = 16; cellHeight = 16; filterPad = True; filterMode = None; };And the data block for the players is:
datablock t2dImageMapDatablock(player_tiles) { imageName = "~/images/playersheet"; imageMode = cell; cellWidth = 40; cellHeight = 40; filterPad = True; filterMode = None; }; new t2dAnimationDatablock(player_idle_anim) { imageMap = player_tiles; animationFrames = "0 1 2 3 2 1"; animationTime = 1; animationCycle = false; randomStart = false; filterPad = True; filterMode = None; };Is there something I am missing ?