Help with setup

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
Casual_Keldeo
Prole
Posts: 3
Joined: Fri Jan 27, 2017 2:40 am

Help with setup

Post by Casual_Keldeo »

I am trying to test the 'newImage' function, to start out. BUT, the script isn't reading the .png image that I set. Did I set up something wrong? What can I do to resolve the issue? Take a look at the screenshot provided: http://prntscr.com/e0v6ok
User avatar
Ikroth
Citizen
Posts: 79
Joined: Thu Jul 18, 2013 4:44 am

Re: Help with setup

Post by Ikroth »

Your image is in the graphics directory. Adjust your path like this:

Code: Select all

hamster = love.graphics.newImage("graphics/hamster.png")
User avatar
Casual_Keldeo
Prole
Posts: 3
Joined: Fri Jan 27, 2017 2:40 am

Re: Help with setup

Post by Casual_Keldeo »

Ikroth wrote:Your image is in the graphics directory. Adjust your path like this:

Code: Select all

hamster = love.graphics.newImage("graphics/hamster.png")
Thank you very much. I now have an issue with loading sounds. I adjusted the sourcecode provided by the website to access the audio directory (if thats even a thing), but no luck. Whats the issue here?

Screenshot of code + layout: http://prntscr.com/e1bd0q
MrFariator
Party member
Posts: 548
Joined: Wed Oct 05, 2016 11:53 am

Re: Help with setup

Post by MrFariator »

In your code you have "bullet_fire.ogg", when the actual filename is "bulletfire.ogg".

Also, should it ever become an issue, be aware that you should write the file paths as exact. ie. use same casing style as in the path.
User avatar
Casual_Keldeo
Prole
Posts: 3
Joined: Fri Jan 27, 2017 2:40 am

Re: Help with setup

Post by Casual_Keldeo »

MrFariator wrote:In your code you have "bullet_fire.ogg", when the actual filename is "bulletfire.ogg".

Also, should it ever become an issue, be aware that you should write the file paths as exact. ie. use same casing style as in the path.
Thanks for pointing out the silly error, but after adjusting, its still not loading in. Whats the issue here, am I loading in the sound at the incorrect time? I want the sound to play when the player fires a bullet.

Screenshot: http://prntscr.com/e1h27v
User avatar
zorg
Party member
Posts: 3465
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Help with setup

Post by zorg »

You shouldn't put love.load inside love.draw; move it out of that function. (Also i hope you only have one love.load)
Also, you'll need more than one source if you need to sound more than one bullet simultaneously.
Thankfully, creating a source once, then cloning it with [wiki]Source:clone[/wiki] is easy. :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: Ahrefs [Bot], Google [Bot], Majestic-12 [Bot] and 2 guests