objects

package
v0.0.0-...-ce26905 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Copyright 2014 loolgame Author. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2014 loolgame Author. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Coins

type Coins struct {
	Id   int
	X    float64
	Y    float64
	Wid  int
	Type int
}

type Player

type Player struct {
	Session         gate.Session
	Rid             string //角色ID  userid
	SitDown         bool   //是否已坐下 ,如果网络断开会设置为false,当网络连接成功以后需要重新坐下
	NetBroken       int64  //网络中断时间,超过60秒就踢出房间或者做其他处理 单位/秒
	LastRequestDate int64  //玩家最后一次请求时间	单位纳秒
	X               float64
	Y               float64
	Wid             int
	XSpeed          float64
	YSpeed          float64
	RotateDirection int // rotate direction: 1-clockwise, 2-counterclockwise
	BallRadius      float64
	Angle           float64
	Power           float64

	RotateSpeed int
	DegToRad    float64
	MinPower    float64
	MaxPower    float64
}

func (*Player) Fire

func (self *Player) Fire(X float64, Y float64, angle float64, power float64)

func (*Player) Move

func (self *Player) Move(friction float64)

func (*Player) OnNetBroken

func (self *Player) OnNetBroken()

func (*Player) OnRequest

func (self *Player) OnRequest(session gate.Session)

* 玩家主动发请求时间

func (*Player) OnSitDown

func (self *Player) OnSitDown()

func (*Player) OnSitUp

func (self *Player) OnSitUp()

func (*Player) Rotate

func (self *Player) Rotate()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL