当前位置: 首页>>代码示例>>Golang>>正文


Golang Vehicle.StoredPowerup方法代码示例

本文整理汇总了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)
}
开发者ID:awesomegroupidunno,项目名称:game-server,代码行数:11,代码来源:powerup.go

示例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)
}
开发者ID:awesomegroupidunno,项目名称:game-server,代码行数:12,代码来源:powerup.go

示例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
}
开发者ID:awesomegroupidunno,项目名称:game-server,代码行数:15,代码来源:physics.go

示例4: applySpeedPowerUp

func (t *PowerupCommandProcessor) applySpeedPowerUp(v *state.Vehicle) {
	v.ActivePowerup = SPEEDUP
	v.StoredPowerup = NO_POWERUP
	v.OverRideSpeedTill = time.Now().Add(10 * time.Second)
}
开发者ID:awesomegroupidunno,项目名称:game-server,代码行数:5,代码来源:powerup.go

示例5: healVehicle

func (t *PowerupCommandProcessor) healVehicle(v *state.Vehicle) {
	v.CurrentHealth = v.MaxHealth
	v.StoredPowerup = NO_POWERUP
}
开发者ID:awesomegroupidunno,项目名称:game-server,代码行数:4,代码来源:powerup.go

示例6: PickupPowerUp

func (p *Physics) PickupPowerUp(v1 *state.Vehicle, power *state.Powerup) {
	if v1.IsAlive && !power.ShouldRemove {
		power.ShouldRemove = true
		v1.StoredPowerup = power.PowerupType
	}
}
开发者ID:awesomegroupidunno,项目名称:game-server,代码行数:6,代码来源:physics.go


注:本文中的github.com/awesomegroupidunno/game-server/state.Vehicle.StoredPowerup方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。