diff --git a/cmd/krampus19/game.go b/cmd/krampus19/game.go index 570a32d..9a1877c 100644 --- a/cmd/krampus19/game.go +++ b/cmd/krampus19/game.go @@ -149,9 +149,9 @@ func (g *game) loadSprites(names ...string) error { func (g *game) loadAssets() error { log.Println("Loading textures...") err := g.loadTextures(map[string]string{ - "entity_brick.png": "brick", - "entity_dragon.png": "dragon", - "entity_villain.png": "villain", + "entity_brick.png": "brick", + "entity_dragon.png": "dragon", + "entity_egg.png": "egg", "tile_lava_brick.png": "lava_brick", "tile_magma.png": "magma", @@ -179,7 +179,7 @@ func (g *game) loadAssets() error { log.Printf("Loaded %d fonts.\n", g.ui.Fonts().Len()) log.Println("Loading sprites") - err = g.loadSprites("brick", "dragon", "lava_brick", "magma", "particles", "ui", "villain") + err = g.loadSprites("brick", "dragon", "egg", "lava_brick", "magma", "particles", "ui") if err != nil { return err } diff --git a/cmd/krampus19/level.go b/cmd/krampus19/level.go index 928b814..efc37e3 100644 --- a/cmd/krampus19/level.go +++ b/cmd/krampus19/level.go @@ -15,7 +15,7 @@ const ( entityTypeInvalid entityType = entityType(0) entityTypeNone = '_' entityTypeCharacter = '@' - entityTypeVillain = 'X' + entityTypeEgg = 'X' entityTypeBrick = 'B' ) @@ -23,7 +23,7 @@ func (e entityType) IsValid() bool { switch e { case entityTypeNone: case entityTypeCharacter: - case entityTypeVillain: + case entityTypeEgg: case entityTypeBrick: default: return false diff --git a/cmd/krampus19/playlevel.go b/cmd/krampus19/playlevel.go index c70113a..7fa9c99 100644 --- a/cmd/krampus19/playlevel.go +++ b/cmd/krampus19/playlevel.go @@ -230,8 +230,8 @@ func (l *playLevel) Render(ctx *alui.Context, bounds geom.RectangleF32) { l.drawSprite("brick", "brick", e.scr) case entityTypeCharacter: l.drawSprite("dragon", "dragon", e.scr) - case entityTypeVillain: - l.drawSprite("villain", "villain", e.scr) + case entityTypeEgg: + l.drawSprite("egg", "egg", e.scr) } } diff --git a/cmd/krampus19/playlevelstate.go b/cmd/krampus19/playlevelstate.go index 4ad04c4..c47c61e 100644 --- a/cmd/krampus19/playlevelstate.go +++ b/cmd/krampus19/playlevelstate.go @@ -12,13 +12,13 @@ import ( type playLevelState struct { ctx *Context - pack levelPack - level level - player *entity - villain *entity - bricks entityList - sunken entityList - splash map[geom.Point]*splashAnimation + pack levelPack + level level + player *entity + egg *entity + bricks entityList + sunken entityList + splash map[geom.Point]*splashAnimation steps int complete bool @@ -31,7 +31,7 @@ type playLevelState struct { func (s *playLevelState) Entities() entityList { var entities entityList - return entities.Add(s.player).Add(s.villain).AddList(s.bricks) + return entities.Add(s.player).Add(s.egg).AddList(s.bricks) } func (s *playLevelState) Particles(at geom.Point) []particle { @@ -72,8 +72,8 @@ func (s *playLevelState) Init(ctx *Context, pack, level string, onComplete func( s.bricks = append(s.bricks, newEntity(e, s.level.idxToPos(i))) case entityTypeCharacter: s.player = newEntity(e, s.level.idxToPos(i)) - case entityTypeVillain: - s.villain = newEntity(e, s.level.idxToPos(i)) + case entityTypeEgg: + s.egg = newEntity(e, s.level.idxToPos(i)) } } s.keysDown = keyPressedState{} @@ -111,7 +111,7 @@ func (s *playLevelState) TryPlayerMove(dir geom.Point, key allg5.Key) { log.Printf("Moving player to %s", to) s.ani.StartFn(s.ctx.Tick, newMoveAnimation(s.player, to), func() { log.Printf("Player movement finished") - if s.player.pos == s.villain.pos { + if s.player.pos == s.egg.pos { s.complete = true if onComplete := s.onComplete; onComplete != nil { onComplete() diff --git a/cmd/krampus19/res/entity_dragon.png b/cmd/krampus19/res/entity_dragon.png index 1ba2b59..689b414 100644 Binary files a/cmd/krampus19/res/entity_dragon.png and b/cmd/krampus19/res/entity_dragon.png differ diff --git a/cmd/krampus19/res/entity_egg.png b/cmd/krampus19/res/entity_egg.png new file mode 100644 index 0000000..38abb30 Binary files /dev/null and b/cmd/krampus19/res/entity_egg.png differ diff --git a/cmd/krampus19/res/entity_villain.png b/cmd/krampus19/res/entity_villain.png deleted file mode 100644 index 4e6a836..0000000 Binary files a/cmd/krampus19/res/entity_villain.png and /dev/null differ diff --git a/cmd/krampus19/res/sprites/dragon.txt b/cmd/krampus19/res/sprites/dragon.txt index ca12d9c..d9c13d9 100644 --- a/cmd/krampus19/res/sprites/dragon.txt +++ b/cmd/krampus19/res/sprites/dragon.txt @@ -3,9 +3,9 @@ texture: dragon part: name: dragon -sub_texture: 0,0,200,400 -anchor: 100,350 -scale: 2 +sub_texture: 0,0,1140,1980 +anchor: 570,1920 +scale: 5 :part :sprite \ No newline at end of file diff --git a/cmd/krampus19/res/sprites/egg.txt b/cmd/krampus19/res/sprites/egg.txt new file mode 100644 index 0000000..0a983b6 --- /dev/null +++ b/cmd/krampus19/res/sprites/egg.txt @@ -0,0 +1,11 @@ +sprite: +texture: egg + +part: +name: egg +sub_texture: 0,0,1140,1980 +anchor: 570,1860 +scale: 6 +:part + +:sprite \ No newline at end of file diff --git a/cmd/krampus19/res/sprites/villain.txt b/cmd/krampus19/res/sprites/villain.txt deleted file mode 100644 index f319284..0000000 --- a/cmd/krampus19/res/sprites/villain.txt +++ /dev/null @@ -1,11 +0,0 @@ -sprite: -texture: villain - -part: -name: villain -sub_texture: 0,0,200,400 -anchor: 100,350 -scale: 2 -:part - -:sprite \ No newline at end of file