Game Development Community

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
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

#1
02/09/2002 (10:33 pm)
Ok this may not help you at all. But making my own jet pack for my game sounds kinda fun when you bring it up so I am just going to post my thoughts on how I would hard code it... granted I am a newbie to this game programming stuff:
//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++
#2
02/09/2002 (10:38 pm)
LOL