package main

import (
	twodee "../libs/twodee"
)

const (
	UpLayer twodee.GameEventType = iota
	DownLayer
	UpWaterLevel
	DownWaterLevel
	PlayerMove
	GameIsClosing
	PlayExploreMusic
	PauseMusic
	ResumeMusic
	PlayerPickedUpItem
	sentinel
)

const (
	NumGameEventTypes = int(sentinel)
)

type MoveDirection byte

const (
	None  MoveDirection = iota
	North MoveDirection = 1 << (iota - 1)
	East
	South
	West
)

type PlayerMoveEvent struct {
	*twodee.BasicGameEvent
	Dir MoveDirection
}

func NewPlayerMoveEvent(direction MoveDirection) (e *PlayerMoveEvent) {
	e = &PlayerMoveEvent{
		twodee.NewBasicGameEvent(PlayerMove),
		direction,
	}
	return
}

type PlayerPickedUpItemEvent struct {
	*twodee.BasicGameEvent
	Item *Item
}

func NewPlayerPickedUpItemEvent(i *Item) (e *PlayerPickedUpItemEvent) {
	e = &PlayerPickedUpItemEvent{
		twodee.NewBasicGameEvent(PlayerPickedUpItem),
		i,
	}
	return
}

package main

import (
	twodee "../libs/twodee"
)

const (
	UpLayer twodee.GameEventType = iota
	DownLayer
	UpWaterLevel
	DownWaterLevel
	PlayerMove
	GameIsClosing
	PlayExploreMusic
	PauseMusic
	ResumeMusic
	PlayerPickedUpItem
	sentinel
)

const (
	NumGameEventTypes = int(sentinel)
)

type MoveDirection int

const (
	North MoveDirection = iota
	East
	South
	West
	None
)

type PlayerMoveEvent struct {
	*twodee.BasicGameEvent
	Dir MoveDirection
}

func NewPlayerMoveEvent(direction MoveDirection) (e *PlayerMoveEvent) {
	e = &PlayerMoveEvent{
		twodee.NewBasicGameEvent(PlayerMove),
		direction,
	}
	return
}

type PlayerPickedUpItemEvent struct {
	*twodee.BasicGameEvent
	Item *Item
}

func NewPlayerPickedUpItemEvent(i *Item) (e *PlayerPickedUpItemEvent) {
	e = &PlayerPickedUpItemEvent{
		twodee.NewBasicGameEvent(PlayerPickedUpItem),
		i,
	}
	return
}

--- 
+++ 
@@ -22,14 +22,14 @@
 	NumGameEventTypes = int(sentinel)
 )
 
-type MoveDirection int
+type MoveDirection byte
 
 const (
-	North MoveDirection = iota
+	None  MoveDirection = iota
+	North MoveDirection = 1 << (iota - 1)
 	East
 	South
 	West
-	None
 )
 
 type PlayerMoveEvent struct {
Make MoveDirections each a byte.
