Skip to content

Commit 2669bd1

Browse files
committed
something
1 parent c6c8043 commit 2669bd1

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

pkg/scenes/racebattle2/scene.go

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,31 @@
11
package racebattle2
22

3-
type Scene struct{}
3+
import (
4+
"github.com/applejag/epic-wizard-firefly-gladiators/assets"
5+
"github.com/applejag/epic-wizard-firefly-gladiators/pkg/util"
6+
"github.com/firefly-zero/firefly-go/firefly"
7+
)
8+
9+
const FireflyAnimationFPS = 10.0
10+
11+
type Scene struct {
12+
fireflySprite util.AnimatedSheet
13+
}
414

515
func (s *Scene) Boot() {
16+
s.fireflySprite = util.NewAnimatedSheet(assets.FireflySheet, FireflyAnimationFPS)
617
}
718

819
func (s *Scene) Update() {
20+
s.fireflySprite.Update()
921
}
1022

1123
func (s *Scene) Render() {
24+
firefly.ClearScreen(firefly.ColorGreen)
25+
// sky
26+
firefly.DrawRect(firefly.P(0, 0), firefly.S(firefly.Width, 60), firefly.Solid(firefly.ColorCyan))
27+
28+
s.fireflySprite.Draw(firefly.P(50, 80))
1229
}
1330

1431
func (s *Scene) OnSceneEnter() {

0 commit comments

Comments
 (0)