bounce

package
v0.0.0-...-da99c14 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

Functions

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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