I havent used matrixes much lately but I vaguely remember having to do what is called ātranslationā both before, and after, what I actually want to do. For example
// create the matrix, this is called an 'identity' matrix when no args are supplied on instantiation.
// think of it as a blank slate. and everything you want to do is to be done in steps.
// As you perform each step on the matrix, its inner numbers are adjusted and when you finally
// apply it, it should come out the way you wanted it to. This way debugging is easier as you can apply
// the matrix each step of the way to see if it is working up to that point as you want it to.
// before writing your next step into it
var mSkewx:Matrix = new Matrix();
// this line effectively moves the āorigin pointā from the top left of the image, to the center
// (but I like to think of it more as moving the image itself)
mSkewx.translate(-(s3.width/2), -(s3.height/2));
// then you do what you wanna do to it, for skews you can manipulate the b (x axis skewing - left to right)
// and c (y axis skewing - up and down) values directly
mSkewx.b = 0;
mSkewx.c = -10/15;
// I assume this is the desired value you were putting in for ācā parameter in Matrix(a,b,c,d,tx,ty)
// then you put the image āoriginā point back to the top left corner
// Unless, of course, you want the origin point to be at the ācenterā of the image that you see,
// which does have its perks but also drawbacks if you forget that you did that to it
mSkewx.translate(s3.width/2, s3.height/2);
// now you give it the final coordinates that you want it to end up at on the screen,
// or display object container, or bitmapdata, etc.
// mSkewx.translate(s3.worldX), s3.worldY); //commented out so your code still works
//finally applying it
s3.transform.matrix = mSkewx;
// alternatively, if you had a bitmapData canvas or something, and you wanted to draw an entity
// onto that using a matrix, it would be the 2nd parameter of the bitmapData.draw(1param, 2param, ā¦)
// canvasBitmapData.draw(s3, mSkewx);
Hope that helps / sheds some light on whats up with matrixes (they were confusing to me too at first).
- Disclaimer here for any incorrect aspects, like I said I havent used them in awhile xD if anyone sees something wrong please correct me!
All that said, for a racing game like that you probably want the smoothest experience possible, and for that copyPixels() and bitmapData.draw() are your friends for flash target. For other targets (I see you are hitting neko?) having recently played around with TileSheet.drawTiles() myself, I can attest to its speed on windows target at the very least (beating copypixels) but I dont know if the blendmodes (subtract, multply, lighten, hardlight etc) are working yet - they are def coming in the future, so to switch to using it would serve you well should you move onto more advanced aspects of display and special effects etc. And they got scaling (not sure about skewing)