component

package
v0.0.0-...-0446daa Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Square

type Square struct {
	IsRun bool

	Image *ebiten.Image
	Opts  *ebiten.DrawImageOptions
	// contains filtered or unexported fields
}

func NewSquare

func NewSquare(bgc color.RGBA, h, w int, x, y, step float64) *Square

func (*Square) CollisionDetection

func (s *Square) CollisionDetection(w, h float64)

func (*Square) CollisionDetection2

func (s *Square) CollisionDetection2(w, h float64, board *Square)

func (*Square) CollisionDetection3

func (s *Square) CollisionDetection3(w, h float64, board *Square)

game.ball = component.NewSquare(define.Red, 5, 5, 300, 390, 3) game.board = component.NewSquare(define.White, 5, 40, 285, 400, 0)

func (*Square) GetScore

func (s *Square) GetScore() string

func (*Square) HitDetection

func (s *Square) HitDetection(awards *[]*Square)

HitDetection 碰撞检测,是否撞击到奖励。撞击到奖励后,奖励消失,分数增加

func (*Square) IsAlive

func (s *Square) IsAlive() bool

func (*Square) Move

func (s *Square) Move(w int, step float64, ball *Square)

Move board 的移动逻辑,在未开球的时候,小球也跟着board移动

Jump to

Keyboard shortcuts

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