level

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CollisionRound = float32(0.4921875)
View Source
var File_pkg_engine_level_level_proto protoreflect.FileDescriptor

Functions

func Collision

func Collision(x int, y int) bool

func CollisionF

func CollisionF(x float32, y float32) bool

func Height

func Height() int

func Height32

func Height32() int32

func InBounds

func InBounds(x int, y int) bool

func Set

func Set(level *Level)

func Width

func Width() int

func Width32

func Width32() int32

Types

type Level

type Level struct {
	Width           int32  `protobuf:"varint,1,opt,name=width,proto3" json:"width,omitempty"`
	Height          int32  `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"`
	Collision       []byte `protobuf:"bytes,3,opt,name=collision,proto3" json:"collision,omitempty"`
	FloorTextures   []byte `protobuf:"bytes,4,opt,name=floor_textures,json=floorTextures,proto3" json:"floor_textures,omitempty"`
	WallTextures    []byte `protobuf:"bytes,5,opt,name=wall_textures,json=wallTextures,proto3" json:"wall_textures,omitempty"`
	CeilingTextures []byte `protobuf:"bytes,6,opt,name=ceiling_textures,json=ceilingTextures,proto3" json:"ceiling_textures,omitempty"`
	// contains filtered or unexported fields
}

func Load

func Load(path string) (*Level, error)

func New

func New() *Level

func (*Level) Descriptor deprecated

func (*Level) Descriptor() ([]byte, []int)

Deprecated: Use Level.ProtoReflect.Descriptor instead.

func (*Level) Enlarge

func (self *Level) Enlarge(width int32, height int32)

Enlarge the level to the given width and height. If the level is already larger than the given width and height, this function does nothing. If the level is smaller than the given width and height, the level is enlarged to the given width and height. The new cells are filled with the value 0. The object is modified in place.

func (*Level) GetCeilingTextures

func (x *Level) GetCeilingTextures() []byte

func (*Level) GetCollision

func (x *Level) GetCollision() []byte

func (*Level) GetFloorTextures

func (x *Level) GetFloorTextures() []byte

func (*Level) GetHeight

func (x *Level) GetHeight() int32

func (*Level) GetWallTextures

func (x *Level) GetWallTextures() []byte

func (*Level) GetWidth

func (x *Level) GetWidth() int32

func (*Level) InBounds

func (self *Level) InBounds(x int, y int) bool

func (*Level) ProtoMessage

func (*Level) ProtoMessage()

func (*Level) ProtoReflect

func (x *Level) ProtoReflect() protoreflect.Message

func (*Level) Reset

func (x *Level) Reset()

func (*Level) Save

func (self *Level) Save(path string) error

func (*Level) SaveCollision

func (self *Level) SaveCollision(x int, y int) bool

func (*Level) SetCollision

func (self *Level) SetCollision(x int, y int, collision bool)

func (*Level) String

func (x *Level) String() string

Jump to

Keyboard shortcuts

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