Esempio n. 1
0
func (p *Physics) RespawnVehicle(v *state.Vehicle, g state.GameState) bool {
	if !v.IsAlive {
		if time.Now().After(v.TimeDestroyed.Add(p.VehicleRespawn)) {
			v.IsAlive = true
			loc := p.findSpace(v.Sized, g)
			v.Y = loc.Y
			v.X = loc.X
			v.Angle = 0
			v.CurrentHealth = v.MaxHealth
			v.ActivePowerup = NO_POWERUP
			v.StoredPowerup = NO_POWERUP
		}
	}
	return false
}
Esempio n. 2
0
func (t *PowerupCommandProcessor) applySpeedPowerUp(v *state.Vehicle) {
	v.ActivePowerup = SPEEDUP
	v.StoredPowerup = NO_POWERUP
	v.OverRideSpeedTill = time.Now().Add(10 * time.Second)
}