![]() |
![]() |
#11 | |
it's monkey twice!
Join Date: Dec 2007
Posts: 175
|
Re: TF Flash Game
Quote:
Also, that's a raccoon >_> @Tolka (Not gonna quote that whole thing) It's always hard pushing new code into a working project, so help me figure out what's going on with your code as it replaces this: if (_root.ground.hitTest(this._x, this._y, true) && falling) { jump = 13; jumping = false; falling = false; } Falling is a boolean that just turns on when the "jump" hits its peak. Jump is the value used for height. It subtracts a little at a time in the "on keyPress up" section. Jumping is just another boolean that turns on when up is pressed, and it prevents double jumps. if (Key.isDown(Key.UP) && !jumping) { jumping = true; } Self-explanatory. if (jumping) { this.gotoAndStop("jump"); this._y -= jump; jump -= .88; if (jump<0) { falling = true; } if (jump<-15) { jump = -15; } } This is what isn't working when I implement your code into the Ground hit detection. As soon as I press Up, she falls through the floor. Left and right work, but not up. The gotoandStop just goes to the char frame called jump. If I had an actual picture of a jump, it would be a jump. As it is, it's just one of the walk frames. Once again, Jump is 13 and these next two lines dictate how fast it decreases. Jump <0 is checking for the top of the jump so it can start the fall. Jump <-15... to be honest I have no idea what this does. I just know without it, it doesn't work. In case it weren't obvious, my experience in coding isn't with Flash. It's with Java. I'll attach the code. All of this code is on the char movieclip. |
|
![]() |
![]() |
|
|