Skip to content

Commit

Permalink
debugging message
Browse files Browse the repository at this point in the history
  • Loading branch information
nhanb committed Jun 28, 2022
1 parent 0dc16de commit 24ea7bb
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,19 @@ func (g *Game) Draw(screen *ebiten.Image) {
),
)
*/
debugStr := ""
if ebiten.IsMouseButtonPressed(ebiten.MouseButtonLeft) {
debugStr += "Dragging\n"
}
if ebiten.IsMouseButtonPressed(ebiten.MouseButtonRight) {
debugStr += "Right click\n"
}
ebitenutil.DebugPrint(screen, debugStr)
screen.DrawImage(g.CurrentAnim.Frames[g.CurrentFrame], nil)
}

func (g *Game) Layout(outsideWidth, outsideHeight int) (w, h int) {
return outsideWidth / 2, outsideHeight / 2
return outsideWidth / 3, outsideHeight / 3
}

func NewAnim(sprites embed.FS, subdir string) *Anim {
Expand Down Expand Up @@ -141,7 +149,7 @@ func main() {
var game Game
game.CurrentAnim = Idle

ebiten.SetWindowSize(360, 360)
ebiten.SetWindowSize(500, 540)
ebiten.SetWindowTitle("Shark!")
ebiten.SetWindowDecorated(false)
ebiten.SetScreenTransparent(true)
Expand Down

0 comments on commit 24ea7bb

Please sign in to comment.