本文整理汇总了Golang中github.com/awesomegroupidunno/game-server/state.Vehicle.StoredPowerup方法的典型用法代码示例。如果您正苦于以下问题:Golang Vehicle.StoredPowerup方法的具体用法?Golang Vehicle.StoredPowerup怎么用?Golang Vehicle.StoredPowerup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/awesomegroupidunno/game-server/state.Vehicle
的用法示例。
在下文中一共展示了Vehicle.StoredPowerup方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: placeWell
func (t *PowerupCommandProcessor) placeWell(v *state.Vehicle, g *state.GameState) {
v.StoredPowerup = NO_POWERUP
r := state.GravityWell{
Point: state.NewPoint(v.X, v.Y),
Sized: state.NewSized(10, 10),
Owner: v.Owner,
Expires: time.Now().Add(5 * time.Second),
}
g.GravityWells = append(g.GravityWells, &r)
}
示例2: fireRocket
func (t *PowerupCommandProcessor) fireRocket(v *state.Vehicle, g *state.GameState) {
v.StoredPowerup = NO_POWERUP
targetedVehicle := targetVehicle(v, g)
r := state.Rocket{
Point: state.NewPoint(v.X, v.Y),
Sized: state.NewSized(t.Physics.BulletWidth*3, t.Physics.BulletWidth*1.25),
Target: targetedVehicle,
Velocity: t.Physics.BulletVelocity * .75,
}
g.Rockets = append(g.Rockets, &r)
}
示例3: RespawnVehicle
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
}
示例4: applySpeedPowerUp
func (t *PowerupCommandProcessor) applySpeedPowerUp(v *state.Vehicle) {
v.ActivePowerup = SPEEDUP
v.StoredPowerup = NO_POWERUP
v.OverRideSpeedTill = time.Now().Add(10 * time.Second)
}
示例5: healVehicle
func (t *PowerupCommandProcessor) healVehicle(v *state.Vehicle) {
v.CurrentHealth = v.MaxHealth
v.StoredPowerup = NO_POWERUP
}
示例6: PickupPowerUp
func (p *Physics) PickupPowerUp(v1 *state.Vehicle, power *state.Powerup) {
if v1.IsAlive && !power.ShouldRemove {
power.ShouldRemove = true
v1.StoredPowerup = power.PowerupType
}
}