collision

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2016 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package collision will take 2 image.Image and determine if any of their active pixes are colliding.

This handles offsets for if the pixels are on a Cartesian coordinate system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsColliding

func IsColliding(hb1, hb2 *Hitbox) bool

IsColliding checks if 2 hitboxs are colliding

func IsCollidingMultiple

func IsCollidingMultiple(hb *Hitbox, boxes []*Hitbox) bool

IsCollidingMultiple checks if multiple hitboxes are colliding with the first

Types

type Coord

type Coord interface {
	X() int
	Y() int
}

type Hitbox

type Hitbox struct {
	Image image.Image

	Center Coord
	// contains filtered or unexported fields
}

Hitbox is an image with a center on a Cartesian coordinate system.

Jump to

Keyboard shortcuts

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