improvement: use the new mini emblem on minigames

Fix #21
This commit is contained in:
Kazhnuz 2020-08-03 09:44:25 +02:00
parent cfbe2f4b90
commit 11e40da8af
4 changed files with 40 additions and 7 deletions

View file

@ -0,0 +1,31 @@
return {
["sprites"] = {
{"cursorground", "assets/gui/cursor/ground"}
},
["textures"] = {
{"menucursor", "assets/gui/cursor-menulist.png"},
{"statusbar", "assets/gui/status_bar.png"},
{"cursorpeak", "assets/gui/cursor/peak.png"},
{"e_speedster", "assets/gui/emblem_speedster.png"},
{"e_technic", "assets/gui/emblem_technic.png"},
{"e_power", "assets/gui/emblem_power.png"},
{"m_speedster", "assets/gui/emblem_speedster_mask.png"},
{"m_technic", "assets/gui/emblem_technic_mask.png"},
{"m_power", "assets/gui/emblem_power_mask.png"},
},
["fonts"] = {
{"small", "assets/gui/fonts/PixelOperator.ttf", 16}
},
["imagefonts"] = {
{"hudnbrs", "assets/gui/fonts/hudnumbers"},
{"hudnbrs_small", "assets/gui/fonts/hudsmallnumbers"},
},
["sfx"] = {
{"mBack", "assets/sfx/menus/back.wav"},
{"mBeep", "assets/sfx/menus/beep.wav"},
{"mSelect", "assets/sfx/menus/select.wav"},
{"mError", "assets/sfx/menus/error.wav"},
}
}

View file

@ -2,18 +2,19 @@ local cwd = (...):gsub('%.player$', '') .. "."
local Parent = require(cwd .. "parent")
local Player = Parent:extend()
local Emblem = require "game.modules.gui.emblem"
function Player:new(world, x, y, z, id)
Player.super.new(self, world, "player", x, y, 0, 16, 12, 24, true)
self:setGravity(480*2)
self.charName = game.characters:getActiveCharacter()
self.assets:addSprite("player", "datas/gamedata/characters/" .. self.charName .. "/sprites")
self:setSprite("player", 8, 10)
self.assets:addSprite(self.charName, "datas/gamedata/characters/" .. self.charName .. "/sprites")
self:setSprite(self.charName, 8, 10)
self:cloneSprite()
self.guiborder = game.gui.newBorder(424, 20, 6)
self.emblem = love.graphics.newImage("assets/gui/emblem_speedster.png")
self.status = love.graphics.newImage("assets/gui/status_bar.png")
self.emblem = Emblem(game.characters:getActiveCharacterData(), self.scene)
self.action = "normal"
end
@ -93,9 +94,8 @@ function Player:draw()
end
function Player:drawHUD(id)
love.graphics.draw(self.guiborder, 424, 20, 0, -1, -1)
love.graphics.draw(self.emblem, 8, 8, 0)
love.graphics.draw(self.status, 24, 16, 0)
love.graphics.draw(self.guiborder, 0, 20, 0, 1, -1)
self.emblem:draw(424 - 40, 12)
end
return Player

View file

@ -29,6 +29,7 @@ local World = require "game.modules.world"
function MovePlayer:new(map)
MovePlayer.super.new(self)
self.assets:batchImport("game.modules.gui.assets")
self.assets:batchImport("scenes.test_scene.assets")
World(self, "battle", map)

View file

@ -31,6 +31,7 @@ function MovePlayer:new(playerNumber, cameraMode)
local cameraMode = cameraMode or "split"
MovePlayer.super.new(self)
self.assets:batchImport("game.modules.gui.assets")
self.assets:batchImport("scenes.test_scene.assets")
World(self, "shoot", "forest")