Added copyright. Background generation cleanup. Audio tweaks.
This commit is contained in:
BIN
assets/magic.wav
BIN
assets/magic.wav
Binary file not shown.
@@ -16,6 +16,7 @@ const (
|
|||||||
FontSizeStandard = 16
|
FontSizeStandard = 16
|
||||||
FontSizeLarge = 24
|
FontSizeLarge = 24
|
||||||
FontSizeBig = 60
|
FontSizeBig = 60
|
||||||
|
FontSizeArcadeSmall = 8
|
||||||
FontSizeArcade = 12
|
FontSizeArcade = 12
|
||||||
FontSizeArcadeBig = 40
|
FontSizeArcadeBig = 40
|
||||||
FontSizeArcadeHuge = 80
|
FontSizeArcadeHuge = 80
|
||||||
@@ -29,6 +30,7 @@ type FontStruct struct {
|
|||||||
Arcade font.Face
|
Arcade font.Face
|
||||||
ArcadeLarge font.Face
|
ArcadeLarge font.Face
|
||||||
ArcadeHuge font.Face
|
ArcadeHuge font.Face
|
||||||
|
ArcadeSmall font.Face
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -82,4 +84,5 @@ func init() {
|
|||||||
SurviveFont.Arcade = GetFaceFatal(fnt3, FontDPI, FontSizeArcade)
|
SurviveFont.Arcade = GetFaceFatal(fnt3, FontDPI, FontSizeArcade)
|
||||||
SurviveFont.ArcadeLarge = GetFaceFatal(fnt3, FontDPI, FontSizeArcadeBig)
|
SurviveFont.ArcadeLarge = GetFaceFatal(fnt3, FontDPI, FontSizeArcadeBig)
|
||||||
SurviveFont.ArcadeHuge = GetFaceFatal(fnt3, FontDPI, FontSizeArcadeHuge)
|
SurviveFont.ArcadeHuge = GetFaceFatal(fnt3, FontDPI, FontSizeArcadeHuge)
|
||||||
|
SurviveFont.ArcadeSmall = GetFaceFatal(fnt3, FontDPI, FontSizeArcadeSmall)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ func NewManager() Manager {
|
|||||||
return Manager{
|
return Manager{
|
||||||
Info: gamedata.GameInfo{
|
Info: gamedata.GameInfo{
|
||||||
Name: "survive",
|
Name: "survive",
|
||||||
Version: "0.16",
|
Version: "0.18",
|
||||||
Dimensions: gamedata.Area{
|
Dimensions: gamedata.Area{
|
||||||
Width: defaultWidth,
|
Width: defaultWidth,
|
||||||
Height: defaultHeight,
|
Height: defaultHeight,
|
||||||
|
|||||||
@@ -505,7 +505,7 @@ func (g *Game) HandleInput() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//account for controller sensitivity
|
//account for controller sensitivity
|
||||||
if !g.gameover {
|
if !g.gameover && !g.Paused {
|
||||||
xaxis := ebiten.StandardGamepadAxisValue(0, ebiten.StandardGamepadAxisRightStickHorizontal)
|
xaxis := ebiten.StandardGamepadAxisValue(0, ebiten.StandardGamepadAxisRightStickHorizontal)
|
||||||
yaxis := ebiten.StandardGamepadAxisValue(0, ebiten.StandardGamepadAxisRightStickVertical)
|
yaxis := ebiten.StandardGamepadAxisValue(0, ebiten.StandardGamepadAxisRightStickVertical)
|
||||||
|
|
||||||
@@ -544,8 +544,8 @@ func (g *Game) ConstructBackground() {
|
|||||||
g.background = ebiten.NewImage(g.dimensions.Width, g.dimensions.Height)
|
g.background = ebiten.NewImage(g.dimensions.Width, g.dimensions.Height)
|
||||||
BLOCK_SIZE := 32
|
BLOCK_SIZE := 32
|
||||||
|
|
||||||
for i := 0; i < 640/16; i++ {
|
for i := 0; i < 640/BLOCK_SIZE; i++ {
|
||||||
for j := 0; j < 480/16; j++ {
|
for j := 0; j < 480/BLOCK_SIZE; j++ {
|
||||||
|
|
||||||
//select random tile in x and y from tileset
|
//select random tile in x and y from tileset
|
||||||
idx_y := rand.IntN(256 / BLOCK_SIZE)
|
idx_y := rand.IntN(256 / BLOCK_SIZE)
|
||||||
@@ -558,7 +558,7 @@ func (g *Game) ConstructBackground() {
|
|||||||
|
|
||||||
//translate for grid element we're painting
|
//translate for grid element we're painting
|
||||||
op := &ebiten.DrawImageOptions{}
|
op := &ebiten.DrawImageOptions{}
|
||||||
op.GeoM.Translate(float64(i)*16, float64(j)*16)
|
op.GeoM.Translate(float64(i*BLOCK_SIZE), float64(j*BLOCK_SIZE))
|
||||||
g.background.DrawImage(assets.ImageBank[assets.TileSet].SubImage(image.Rect(x0, y0, x1, y1)).(*ebiten.Image), op)
|
g.background.DrawImage(assets.ImageBank[assets.TileSet].SubImage(image.Rect(x0, y0, x1, y1)).(*ebiten.Image), op)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,6 +70,8 @@ func (s *StartScreen) Draw(screen *ebiten.Image) {
|
|||||||
text.Draw(screen, "press start", fonts.SurviveFont.Arcade, 640/2-25, 300, color.White)
|
text.Draw(screen, "press start", fonts.SurviveFont.Arcade, 640/2-25, 300, color.White)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
text.Draw(screen, "©bsoft games", fonts.SurviveFont.ArcadeSmall, 640/2+25, 180, color.White)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *StartScreen) SetEventHandler(e ScreenManagerEvent, f func()) {
|
func (s *StartScreen) SetEventHandler(e ScreenManagerEvent, f func()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user