parent
cfbe2f4b90
commit
11e40da8af
4 changed files with 40 additions and 7 deletions
31
sonic-radiance.love/game/modules/gui/assets.lua
Normal file
31
sonic-radiance.love/game/modules/gui/assets.lua
Normal 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"},
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,18 +2,19 @@ local cwd = (...):gsub('%.player$', '') .. "."
|
||||||
local Parent = require(cwd .. "parent")
|
local Parent = require(cwd .. "parent")
|
||||||
local Player = Parent:extend()
|
local Player = Parent:extend()
|
||||||
|
|
||||||
|
local Emblem = require "game.modules.gui.emblem"
|
||||||
|
|
||||||
function Player:new(world, x, y, z, id)
|
function Player:new(world, x, y, z, id)
|
||||||
Player.super.new(self, world, "player", x, y, 0, 16, 12, 24, true)
|
Player.super.new(self, world, "player", x, y, 0, 16, 12, 24, true)
|
||||||
self:setGravity(480*2)
|
self:setGravity(480*2)
|
||||||
|
|
||||||
self.charName = game.characters:getActiveCharacter()
|
self.charName = game.characters:getActiveCharacter()
|
||||||
self.assets:addSprite("player", "datas/gamedata/characters/" .. self.charName .. "/sprites")
|
self.assets:addSprite(self.charName, "datas/gamedata/characters/" .. self.charName .. "/sprites")
|
||||||
self:setSprite("player", 8, 10)
|
self:setSprite(self.charName, 8, 10)
|
||||||
self:cloneSprite()
|
self:cloneSprite()
|
||||||
|
|
||||||
self.guiborder = game.gui.newBorder(424, 20, 6)
|
self.guiborder = game.gui.newBorder(424, 20, 6)
|
||||||
self.emblem = love.graphics.newImage("assets/gui/emblem_speedster.png")
|
self.emblem = Emblem(game.characters:getActiveCharacterData(), self.scene)
|
||||||
self.status = love.graphics.newImage("assets/gui/status_bar.png")
|
|
||||||
|
|
||||||
self.action = "normal"
|
self.action = "normal"
|
||||||
end
|
end
|
||||||
|
@ -93,9 +94,8 @@ function Player:draw()
|
||||||
end
|
end
|
||||||
|
|
||||||
function Player:drawHUD(id)
|
function Player:drawHUD(id)
|
||||||
love.graphics.draw(self.guiborder, 424, 20, 0, -1, -1)
|
love.graphics.draw(self.guiborder, 0, 20, 0, 1, -1)
|
||||||
love.graphics.draw(self.emblem, 8, 8, 0)
|
self.emblem:draw(424 - 40, 12)
|
||||||
love.graphics.draw(self.status, 24, 16, 0)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return Player
|
return Player
|
||||||
|
|
|
@ -29,6 +29,7 @@ local World = require "game.modules.world"
|
||||||
function MovePlayer:new(map)
|
function MovePlayer:new(map)
|
||||||
|
|
||||||
MovePlayer.super.new(self)
|
MovePlayer.super.new(self)
|
||||||
|
self.assets:batchImport("game.modules.gui.assets")
|
||||||
self.assets:batchImport("scenes.test_scene.assets")
|
self.assets:batchImport("scenes.test_scene.assets")
|
||||||
|
|
||||||
World(self, "battle", map)
|
World(self, "battle", map)
|
||||||
|
|
|
@ -31,6 +31,7 @@ function MovePlayer:new(playerNumber, cameraMode)
|
||||||
local cameraMode = cameraMode or "split"
|
local cameraMode = cameraMode or "split"
|
||||||
|
|
||||||
MovePlayer.super.new(self)
|
MovePlayer.super.new(self)
|
||||||
|
self.assets:batchImport("game.modules.gui.assets")
|
||||||
self.assets:batchImport("scenes.test_scene.assets")
|
self.assets:batchImport("scenes.test_scene.assets")
|
||||||
|
|
||||||
World(self, "shoot", "forest")
|
World(self, "shoot", "forest")
|
||||||
|
|
Loading…
Reference in a new issue