physics

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2025 License: BSD-2-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewObject

func NewObject() *object

Types

type Object

type Object interface {
	Update() error

	GetPosition() rl.Vector2
	GetVelocity() rl.Vector2
	GetAcceleration() rl.Vector2
	GetBaseAcceleration() rl.Vector2

	SetPosition(pos rl.Vector2)
	SetVelocity(vel rl.Vector2)
	SetAcceleration(acc rl.Vector2)
	SetBaseAcceleration(base rl.Vector2)
}

Object defines the interface for physical objects.

This is defined here in the object.go file because after passing an 'object' to an 'entity' (e.g. 'penguin'), then to a 'player', as well as the main function, we needed almost all of the functions for the whole interface defined in each place.

Jump to

Keyboard shortcuts

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