Oh yeah, well what you'd do is just script it so that when you press the L button, Link's upwards acceleration is set to 1 for a few frames, then leave it for the game to set it untill he hits the floor.
It's probably what C- did, and it's much simpler than any of that 'trying to make him use the Roc's Feather' nonsense.
Jump with button script...
Started by
ElLibertador
, Jan 21 2008 01:27 AM
19 replies to this topic
#16
Posted 24 January 2008 - 04:57 PM
#17
Posted 24 January 2008 - 04:58 PM
Shows how little I know about scripting.
#18
Posted 24 January 2008 - 05:00 PM
Heh
No-one knows anything about anything before they start learning, I knew nothing in september of scripting.
No-one knows anything about anything before they start learning, I knew nothing in september of scripting.
Edited by Joe123, 24 January 2008 - 05:00 PM.
#19
Posted 24 January 2008 - 05:36 PM
Thanks anyway. I don't really like C's script because it doesn't fit Mario. I'll just live with an equipable jump.
Edited by LinkMystro, 24 January 2008 - 05:37 PM.
#20
Posted 27 January 2008 - 10:25 AM
Is it really that hard to do? You only need 1 line of code to make Link jump. Then just a few more to make sure Link can't Jump in midair.
This would be the whole script:
This would be the whole script:
CODE
global script Jump {
void run() {
//This variable you from jumping constantly from holding L down.
bool noJumpRep = false;
while(true) {
//this part checks solidity and button presses
if(Link->InputL && (isSolid(Link->X+4,Link->Y+16) || isSolid(Link->X+12,Link->Y+16)) && !noJumpRep) {
Link->Jump = 3; //a jumping power of 3 should get about 2-1/2 tiles
Game->PlaySound(45);
noJumpRep = true;
} else if(Link->InputL) {
//this prevents you from jumping constantly from holding L down.
noJumpRep = true;
}
//This allows Link to jump again
if(noJumpRep && !(Link->InputL))
noJumpRep = false;
}
}
}
void run() {
//This variable you from jumping constantly from holding L down.
bool noJumpRep = false;
while(true) {
//this part checks solidity and button presses
if(Link->InputL && (isSolid(Link->X+4,Link->Y+16) || isSolid(Link->X+12,Link->Y+16)) && !noJumpRep) {
Link->Jump = 3; //a jumping power of 3 should get about 2-1/2 tiles
Game->PlaySound(45);
noJumpRep = true;
} else if(Link->InputL) {
//this prevents you from jumping constantly from holding L down.
noJumpRep = true;
}
//This allows Link to jump again
if(noJumpRep && !(Link->InputL))
noJumpRep = false;
}
}
}
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users