Browse Source

added basic assets

master
NCLanceman 8 months ago
parent
commit
7b17419391
  1. BIN
      assets/enemy/e-fighter.png
  2. BIN
      assets/player/player01.png
  3. BIN
      assets/player/player02.png
  4. BIN
      assets/player/player03.png
  5. BIN
      assets/player/player04.png
  6. 5
      entities/enemy.lua
  7. 11
      entities/player.lua
  8. 8
      scripts/weapon.lua

BIN
assets/enemy/e-fighter.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 590 B

BIN
assets/player/player01.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 485 B

BIN
assets/player/player02.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 623 B

BIN
assets/player/player03.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 745 B

BIN
assets/player/player04.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 825 B

5
entities/enemy.lua

@ -20,7 +20,10 @@ end
function Enemy:draw() function Enemy:draw()
--draw stuff --draw stuff
love.graphics.rectangle("line", self.x, self.y, self.width, self.height) --love.graphics.rectangle("line", self.x, self.y, self.width, self.height)
local fighter = love.graphics.newImage("/assets/enemy/e-fighter.png")
love.graphics.draw(fighter, self.x, self.y, 0, -1)
for _, v in ipairs(listOfBullets) do for _, v in ipairs(listOfBullets) do
love.graphics.circle("fill", v.x, v.y, v.radius) love.graphics.circle("fill", v.x, v.y, v.radius)

11
entities/player.lua

@ -35,13 +35,20 @@ function Player:update(dt)
end end
function Player:draw() function Player:draw()
local vert = { self.x, self.y, (self.x - 70), (self.y + 70), (self.x + 70), (self.y + 70) } --local vert = { self.x, self.y, (self.x - 70), (self.y + 70), (self.x + 70), (self.y + 70) }
love.graphics.polygon("fill", vert) --love.graphics.polygon("fill", vert)
local fullHealth = love.graphics.newImage("/assets/player/player01.png")
local damaged = love.graphics.newImage("/assets/player/player02.png")
local halfHealth = love.graphics.newImage("/assets/player/player03.png")
local nearDeath = love.graphics.newImage("/assets/player/player04.png")
love.graphics.draw(fullHealth, self.x, self.y)
for _, v in ipairs(listOfBullets) do for _, v in ipairs(listOfBullets) do
--love.graphics.setColor(v.color) --love.graphics.setColor(v.color)
love.graphics.circle("fill", v.x, v.y, v.radius) love.graphics.circle("fill", v.x, v.y, v.radius)
end end
--love.graphics.setColor(1, 1, 1)
end end
function Player:keyPressed(key) function Player:keyPressed(key)

8
scripts/weapon.lua

@ -0,0 +1,8 @@
require(scripts.classic)
--a weapon is a script / entity that can be attached to a player
--or enemy
--this generic script can fire a projectile up the screen (if player) or
--down the screen (if enemy).
--projectile types should be adjustable
--TODO: Find ways to make a draw function work on the object itself.
Loading…
Cancel
Save