forked from Happy-Ferret/djavul
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.go
26 lines (23 loc) · 753 Bytes
/
action.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package main
import (
"github.com/faiface/pixel/pixelgl"
"github.com/sanctuary/djavul/internal/proto"
)
// buttonPressed returns an action for the Diablo 1 game engine, based on the
// button pressed window event.
func buttonPressed(win *pixelgl.Window, e ButtonPressedEvent) proto.ButtonPressedAction {
return proto.ButtonPressedAction{
Button: int32(e.Button),
X: int32(e.Pos.X),
Y: int32(e.Pos.Y),
}
}
// buttonReleased returns an action for the Diablo 1 game engine, based on the
// button released window event.
func buttonReleased(win *pixelgl.Window, e ButtonReleasedEvent) proto.ButtonReleasedAction {
return proto.ButtonReleasedAction{
Button: int32(e.Button),
X: int32(e.Pos.X),
Y: int32(e.Pos.Y),
}
}