Back to

Package collision

Latest Go to latest

The latest major version is .

Published: Feb 2, 2020 | License: MIT | Module:



var (
	SoccerBallImage *ebiten.Image
	// Screen Resolution
	ScreenWidth  = 1600
	ScreenHeight = 900
	// Starting velocity for balls
	MinV0 float64 = -50
	MaxV0 float64 = 50

Simulation variables

func DrawScenery

func DrawScenery(screen *ebiten.Image)

DrawScenery is a helper function to draw background

func Edge

func Edge(b *ball.Ball)

Edge checks if ball reached the boundary

func Goal

func Goal(b *ball.Ball)

Goal checks if ball reached a goal

func StartValues

func StartValues(nballs int) error

StartValues set starting position and velocity for a slice of balls Positions spread in a square and velocity is random

func Timestep

func Timestep(b *ball.Ball)

Timestep is a helper function to perform a timestep with position and velocity updates

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier