hockeygoalie5
In Runtime
- Messages
- 299
- Location
- United States
I'm kind of back and with more alliterations in my thread titles! Anyway, I'm getting back into ActionScript and I'm working on a platformer game. I've got it all down: the player, gravity, the objective, etc. but there's a problem. The platforms themselves are giving me a headache. Two problems: the way I made them (just a testing design) and actually programming them to work.
Okay, this is on the player:
For some explanation of what's going on, if the player hits the platform, it stops jumping and moving upward the same speed as the gravity is pushing down so it doesn't fall through. But this causes the character to move slowly up and then immediately come back down. This can be fixed by setting the player's y to on the platform. Two problems: because it is a hitTest it starts doing this as it's on the platform. That causes the character to bounce up and down quickly. And, if it walk up to the platform (even though it's on top of walls that prevent the character from walking on it) the design still makes you able to hit the platform and go up without jumping. So, in conclusion of this long explanation of my problem, I need a different way to detect the player on the platform without hitTest and using if(this._y == _root.platform._y) doesn't work. Thanks in advanced!
EDIT: Forgot to add another thing, any ideas on making the platform itself?
Okay, this is on the player:
Code:
if(this.hitTest(_root.platform)) {
mainJumping = false;
this._y = this._y - yspeed;
}
EDIT: Forgot to add another thing, any ideas on making the platform itself?