This may seem stupidly basic but it has taken me so long, I was really struggling with the hitTest for multiple blocks but it seems to be working! Now I've got to make it so blocks can be walked on as well making the bottom character move simeltaniously (which I had problems with, hence it falling off the stage as soon as the game begins.
2D 05-02-08 7.swf
Free file hosting from File Den
versions, changes and problems
0.001 - detect keypress, trace output
0.01 - map left and right arrow keys to move the character
0.012 - map space bar to jump
0.2 - Wall and floor collision
I didn't really come across anything much until the wall and floor collision. I found the chanracter was walking through the walls before the hitTest was able to work. After a lot of changing of code I decided to start the code for the left and right movement from scratch and managed to get it working pretty well, as far as I can tell anyway, by simply giving a margin to the x value in the hit test. (see the file above to view).
I am currently struggling getting the bottom character to behave the same as the top, although the code is pretty much identicle so I'm not quite sure whats wrong there yet.
1 comment:
I got a pretty good forward jump going on there, would be nice to have a tinker with a few more platforms…etc., just to test out the physics N stuff.
Post a Comment