how would I go about making weapons cycle when the player hits TAB?
this is much faster in a 4 weapon game like Terra Trooper.
cycle options
- Agentarrow
- Posts: 1346
- Joined: Thu Jun 28, 2007 4:34 pm
- Location: Kyiv, Ukraine
- Contact:
cycle options
AgentArrow Home
The greater good is but a point of view...
The greater good is but a point of view...
Re: cycle options
Check if TAB is pressed. Check if the last weapon (the one with the index 3) is armed and if so, change to the first weapon (with index 0). Otherwise change to the next weapon (current weapon + 1):
Code: Select all
if(IsKeyDown(13))
{
if(player_weapon = 3)
{
SetPlayerWeapon(0);
}
else
{
SetPlayerWeapon(player_weapon + 1);
}
}
Pain is only psychological.