black screen

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
goose™
Prole
Posts: 1
Joined: Sun Aug 23, 2020 2:27 am

black screen

Post by goose™ »

ok so im trying to make a game and when i try to draw the hotbar it just gives me a black screen please help my code is just ingnore the rest exept for hb its for hot bar

Code: Select all



wf = require('windfield')
world = wf.newWorld(0, 0, true)
world:setGravity(0, 0)

bread = love.graphics.newImage("Resourse/Item/bred.png")
require('Script/Player')
require('Script/Title')
require('Script/Camera')
require('Script/Map')
require('Script/DrawMap')
require('Script/inventory')
require('Script/Itemlist')
require('Script/hotbar')
hb = love.graphics.newImage("Resourse/inventory/hotbar.png")

local inventoryofthebaronthegalaxy = love.graphics.newImage("Resourse/inventory/inventory.png")



  	

  love.graphics.translate((-player.x * 2.5)+360, (-player.y * 2.5)+250)
   love.graphics.scale(1 / camera.scaleX, 1 / camera.scaleY)

    draw_map()
    player.draw(player)
	    if inv == 1 then
love.graphics.draw(inventoryofthebaronthegalaxy,player.x-110,player.y+50,0,0.6,0.6)
for i = 0, 9 do
love.graphics.rectangle("fill", player.x-100+(23*i), player.y+55, 20, 20 )
end
for i = 0, 9 do
love.graphics.rectangle("fill", player.x-100+(23*i), player.y+80, 20, 20 )
end
if invslot1_ID ~= 0 then
love.graphics.draw(bread,player.x-100+(23*0),player.y+55,0,0.3,0.3)
end
if invslot2_ID ~= 0 then
love.graphics.draw(bread,player.x-100+(23*1),player.y+55,0,0.3,0.3)
end
if invslot3_ID ~= 0 then
love.graphics.draw(bread,player.x-100+(23*2),player.y+55,0,0.3,0.3)
end
if invslot4_ID ~= 0 then
love.graphics.draw(bread,player.x-100+(23*3),player.y+55,0,0.3,0.3)
end
if invslot5_ID ~= 0 then
love.graphics.draw(bread,player.x-100+(23*4),player.y+55,0,0.3,0.3)
end
if invslot6_ID ~= 0 then
love.graphics.draw(bread,player.x-100+(23*5),player.y+55,0,0.3,0.3)
end
if invslot7_ID ~= 0 then
love.graphics.draw(bread,player.x-100+(23*6),player.y+55,0,0.3,0.3)
end
if invslot8_ID ~= 0 then
love.graphics.draw(bread,player.x-100+(23*7),player.y+55,0,0.3,0.3)
end
if invslot9_ID ~= 0 then
love.graphics.draw(bread,player.x-100+(23*8),player.y+55,0,0.3,0.3)
end
if invslot10_ID ~= 0 then
love.graphics.draw(bread,player.x-100+(23*9),player.y+55,0,0.3,0.3)
end
if invslot11_ID ~= 0 then
love.graphics.draw(bread,player.x-100+(23*0),player.y+80,0,0.3,0.3)
end
if invslot12_ID ~= 0 then
love.graphics.draw(bread,player.x-100+(23*1),player.y+80,0,0.3,0.3)
end
if invslot13_ID ~= 0 then
love.graphics.draw(bread,player.x-100+(23*2),player.y+80,0,0.3,0.3)
end
if invslot14_ID ~= 0 then
love.graphics.draw(bread,player.x-100+(23*3),player.y+80,0,0.3,0.3)
end
if invslot15_ID ~= 0 then
love.graphics.draw(bread,player.x-100+(23*4),player.y+80,0,0.3,0.3)
end
if invslot16_ID ~= 0 then
love.graphics.draw(bread,player.x-100+(23*5),player.y+80,0,0.3,0.3)
end
if invslot17_ID ~= 0 then
love.graphics.draw(bread,player.x-100+(23*6),player.y+80,0,0.3,0.3)
end
if invslot18_ID ~= 0 then
love.graphics.draw(bread,player.x-100+(23*7),player.y+80,0,0.3,0.3)
end
if invslot19_ID ~= 0 then
love.graphics.draw(bread,player.x-100+(23*8),player.y+80,0,0.3,0.3)
end
if invslot11_ID ~= 0 then
love.graphics.draw(bread,player.x-100+(23*9),player.y+80,0,0.3,0.3)
end

end


love.graphics.draw(hb, 0, 0)
 love.graphics.scale( 0.4, 0.4 )





function love.update(dt)
   player:update(dt)
   world:update(dt)
  
end
 


User avatar
siberian
Prole
Posts: 21
Joined: Sat Apr 06, 2019 1:42 pm

Re: black screen

Post by siberian »

Where is love.draw() function?
User avatar
zorg
Party member
Posts: 3465
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: black screen

Post by zorg »

Nowhere, that may be the problem :3
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 6 guests