Back to godoc.org

Package bounce

v0.0.0-...-da99c14
Latest Go to latest

The latest major version is .

Published: Feb 2, 2020 | License: MIT | Module: github.com/Aoana/ball-sim-go

Index

Variables

var (
	BallImage *ebiten.Image
	// Screen Resolution
	ScreenWidth  = 1600
	ScreenHeight = 900
	// Starting values for balls
	X0            = float64(ScreenWidth) / 2
	Y0            = float64(ScreenHeight) / 10
	MinV0 float64 = -50
	MaxV0 float64 = 50
)

Simulation variables

func DrawScenery

func DrawScenery(screen *ebiten.Image)

DrawScenery is a helper function to draw background and walls

func OutOfBound

func OutOfBound(b *ball.Ball)

OutOfBound is a helper function to set the right boundary The values are simply set to fit the scenery

func StartValues

func StartValues(nballs int) error

StartValues set starting position and velocity for a slice of balls Fixed starting position 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