carpen

package
v0.0.0-...-607d35d Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bush

type Bush struct {
	Rotation float64
	Width,
	Height int

	Direction Direction
	Image     *ebiten.Image
}

func (*Bush) DrawBush

func (bush *Bush) DrawBush() image.Image

func (*Bush) Init

func (b *Bush) Init()

type Car

type Car struct {
	IsActive bool
	RotateLeft,
	RotateRight,
	Accelerate,
	Decelerate bool
	WheelWidth,
	WheelHeight,
	Width,
	Height int
	WheelRotationStep,
	WheelMaxAngle,
	WheelAngle,
	X,
	Y,
	Rotation,
	Speed,
	MaxSpeed,
	Acceleration float64
	Pivot          Pivot
	FrontPivot     FrontPivot
	RearPivot      RearPivot
	DirectionPivot DirectionPivot
	RearPivotAbs   RearPivotAbs
	Wheels         []Wheel
	Direction      Direction
	Image          *ebiten.Image
	Color          string
}

func (*Car) DrawCar

func (car *Car) DrawCar() image.Image

func (*Car) DrawWheels

func (car *Car) DrawWheels(dc *gg.Context) gg.Context

func (*Car) Init

func (c *Car) Init()

func (*Car) Move

func (car *Car) Move() error

func (*Car) UpdateDirection

func (c *Car) UpdateDirection()

type Direction

type Direction struct {
	X, Y float64
}

type DirectionPivot

type DirectionPivot struct {
	X, Y float64
}

type FrontPivot

type FrontPivot struct {
	X, Y float64
}

type Pivot

type Pivot struct {
	X, Y float64
}

type RearPivot

type RearPivot struct {
	X, Y float64
}

type RearPivotAbs

type RearPivotAbs struct {
	X, Y float64
}

type TempDirPivot

type TempDirPivot struct {
	X, Y float64
}

type Vector

type Vector struct {
	X, Y float64
}

func (*Vector) Length

func (v *Vector) Length() float64

func (*Vector) Normalize

func (norm *Vector) Normalize() Direction

type Wheel

type Wheel struct {
	X, Y float64
}

Jump to

Keyboard shortcuts

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