Removed unused cube textures.
This commit is contained in:
parent
f120de375b
commit
9bf56c1386
@ -18,7 +18,7 @@ type levelController struct {
|
|||||||
Scale float32
|
Scale float32
|
||||||
Level *tins2021.Level
|
Level *tins2021.Level
|
||||||
|
|
||||||
Cubes map[string]cubeTexture
|
Cubes cubeTexture
|
||||||
Animations map[string]*tins2021.Animations
|
Animations map[string]*tins2021.Animations
|
||||||
|
|
||||||
MonsterTextureNames map[tins2021.MonsterType]string
|
MonsterTextureNames map[tins2021.MonsterType]string
|
||||||
@ -31,11 +31,7 @@ type levelController struct {
|
|||||||
func newLevelControl(ctx ui.Context, level *tins2021.Level) *levelController {
|
func newLevelControl(ctx ui.Context, level *tins2021.Level) *levelController {
|
||||||
control := &levelController{Level: level, Scale: .6}
|
control := &levelController{Level: level, Scale: .6}
|
||||||
textures := ctx.Textures()
|
textures := ctx.Textures()
|
||||||
control.Cubes = map[string]cubeTexture{
|
control.Cubes = newCubeTexture(textures, tins2021.Orange)
|
||||||
"regular": newCubeTexture(textures, tins2021.Orange),
|
|
||||||
"blocked": newCubeTexture(textures, tins2021.Purple),
|
|
||||||
"colored": newCubeTexture(textures, tins2021.Blue),
|
|
||||||
}
|
|
||||||
newAnimatedTexture(ctx, "star", "resources/images/star.png", func() image.Image {
|
newAnimatedTexture(ctx, "star", "resources/images/star.png", func() image.Image {
|
||||||
return tins2021.AnimatePolygon(tins2021.CreateStar(5), tins2021.Yellow, tins2021.NewRotateAnimation(defaultAnimationFrames))
|
return tins2021.AnimatePolygon(tins2021.CreateStar(5), tins2021.Yellow, tins2021.NewRotateAnimation(defaultAnimationFrames))
|
||||||
})
|
})
|
||||||
@ -167,12 +163,10 @@ func (r levelController) Render(ctx ui.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
textures := ctx.Textures()
|
textures := ctx.Textures()
|
||||||
regular := r.Cubes["regular"].Scaled(textures, scale)
|
cubes := r.Cubes.Scaled(textures, scale)
|
||||||
// blocked := r.Cubes["blocked"].Scaled(textures, scale)
|
|
||||||
// colors := r.Cubes["colored"].Scaled(textures, scale)
|
|
||||||
|
|
||||||
cubeWidth := float32(regular.Normal.Width())
|
cubeWidth := float32(cubes.Normal.Width())
|
||||||
cubeHeight := float32(regular.Normal.Height())
|
cubeHeight := float32(cubes.Normal.Height())
|
||||||
|
|
||||||
player := ctx.Textures().ScaledByName("dwarf", scale*.6)
|
player := ctx.Textures().ScaledByName("dwarf", scale*.6)
|
||||||
star := tins2021.NewAnimatedTexture(ctx.Textures().ScaledByName("star", scale*.4), defaultAnimationFrames)
|
star := tins2021.NewAnimatedTexture(ctx.Textures().ScaledByName("star", scale*.4), defaultAnimationFrames)
|
||||||
@ -201,9 +195,9 @@ func (r levelController) Render(ctx ui.Context) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
screenPos, platformPos := positionOfTile(pos, tile)
|
screenPos, platformPos := positionOfTile(pos, tile)
|
||||||
tileTexture := regular.Normal.Texture
|
tileTexture := cubes.Normal.Texture
|
||||||
if tile.Inversed {
|
if tile.Inversed {
|
||||||
tileTexture = regular.Inversed.Texture
|
tileTexture = cubes.Inversed.Texture
|
||||||
}
|
}
|
||||||
renderer.DrawTexturePoint(tileTexture, screenPos)
|
renderer.DrawTexturePoint(tileTexture, screenPos)
|
||||||
r.SmallFont.TextAlign(renderer, platformPos, color.Black, strconv.Itoa(distances[pos]), ui.AlignCenter)
|
r.SmallFont.TextAlign(renderer, platformPos, color.Black, strconv.Itoa(distances[pos]), ui.AlignCenter)
|
||||||
|
Loading…
Reference in New Issue
Block a user