coding a Jet pack
by Anthony Rosenbaum · in Technical Issues · 01/11/2002 (3:18 pm) · 2 replies
Actually I am hoping to create a function that will act like a jet pack. Example: to increace the verticle location of player/vehicle as long as button is pressed.
However I have no clue where to start. My experience tells me that a C++ type code like this, should work
Anthony
However I have no clue where to start. My experience tells me that a C++ type code like this, should work
void jetUP(button_being_pressed)
{
player.verticalLocation++;
}ok that is VERY rutamentary stuff cause I have no clue of if I should be working in the hard code or if this can be scripted? Could someone point me in the right direction? Anthony
About the author
Andy "Code" Cook
//This code is kinda bad because i think it won't allow jetting and moving
switch (Player.JetPack.Status)
{
case ON
{
PlayGraphic(Player.JetPackOn.dts); //made up function
// for humorous ending.. read on
if (Player.temp < 100)
Player.temp++ ;
else
Player.JetPack.Status = OVERHEAT;
Player.Ypos = Player.Ypos(1 + JetPack.strength) nice little "raise the player eqaution
}break;
case OFF
{
PlayGraphics(Player.JetPackOff.dts);
if (Player.temp < 0)
Player.temp--
}break;
case OVERHEAT
{
PlayGraphic(Player.Explode.dts)
Player.status = dead;
PlaySound(LAUGHING.wav);
EndGame();
}
defaulr:break;
}
Heh, he exploded haha... sorry probably didn't help but I had fun writing this story in C++