From 24ea7bbe53c984aff8d302935e1454ea32847e1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=B9i=20Th=C3=A0nh=20Nh=C3=A2n?= Date: Wed, 29 Jun 2022 00:48:56 +0700 Subject: [PATCH] debugging message --- main.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 4dcf045..ced738d 100644 --- a/main.go +++ b/main.go @@ -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 { @@ -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)