KyleHarrison
06-28-2007, 10:45 PM
Hey guys, ive ooked at the other threads for platformers and stuff but its nto quite answering my questions...
See i havent made a game in flash in.. well im going to say years. Last thing i touched to make a game was FlashMX. Anyways, back in the day i did all sorts of little games from platforming engines, to AI crowd simulations, and even attempting to make an FPS engine in flash. Glory days of lore. With years of being away i have ..REALLY lost my touch and im trying to get back into the swing of things. I use Flash CS3 but id liek to stick to AS2.0 and below as much as possible with this one.
..so i seem to have typed a little mini biography or somethign please ignore it if you dont care, haha.
So im trying to make a little game that resembles the Fusion Frenzy game "Twisted" in which a character is running at a constant speed, no control over this. The background is whats really moving. There are only 2 controls: Jump & Duck.
I have zero problems with the collision detection of objects and the ducking code, but i seem to be having a hell of a time getting jumping to work.
onClipEvent (load) {
var yPos = this._y;
}
onClipEvent (enterFrame) {
if (_root.jumping == false) {
if (Key.isDown(Key.UP)) {
this.gotoAndPlay("seqJumping");
/*
// This just plain doesn't work
while(this._y<(yPos-30)) {
this._y--;
}
*/
/*
// this jumps him up WAY too quickly all at once
for(i=0;i<30;i++) {
this._y--;
}
*/
/*
//hmm this only moves with keyboard interaction at all times...
if (this._y != yPos-30) {
this._y--;
}
*/
}
}
}
Id like to be able to have him jump up using purely code while his timeline plays his jumping action. My old method of doing this was making an AS file with something like
this._y--; and using the #IMPORT "jump.as" on every frame during his jumping sequence, but thats VERY hack and i dont want to use that. (i will if i have too lol)
Any ideas?
See i havent made a game in flash in.. well im going to say years. Last thing i touched to make a game was FlashMX. Anyways, back in the day i did all sorts of little games from platforming engines, to AI crowd simulations, and even attempting to make an FPS engine in flash. Glory days of lore. With years of being away i have ..REALLY lost my touch and im trying to get back into the swing of things. I use Flash CS3 but id liek to stick to AS2.0 and below as much as possible with this one.
..so i seem to have typed a little mini biography or somethign please ignore it if you dont care, haha.
So im trying to make a little game that resembles the Fusion Frenzy game "Twisted" in which a character is running at a constant speed, no control over this. The background is whats really moving. There are only 2 controls: Jump & Duck.
I have zero problems with the collision detection of objects and the ducking code, but i seem to be having a hell of a time getting jumping to work.
onClipEvent (load) {
var yPos = this._y;
}
onClipEvent (enterFrame) {
if (_root.jumping == false) {
if (Key.isDown(Key.UP)) {
this.gotoAndPlay("seqJumping");
/*
// This just plain doesn't work
while(this._y<(yPos-30)) {
this._y--;
}
*/
/*
// this jumps him up WAY too quickly all at once
for(i=0;i<30;i++) {
this._y--;
}
*/
/*
//hmm this only moves with keyboard interaction at all times...
if (this._y != yPos-30) {
this._y--;
}
*/
}
}
}
Id like to be able to have him jump up using purely code while his timeline plays his jumping action. My old method of doing this was making an AS file with something like
this._y--; and using the #IMPORT "jump.as" on every frame during his jumping sequence, but thats VERY hack and i dont want to use that. (i will if i have too lol)
Any ideas?