Page 1 of 1
Help with setup
Posted: Fri Jan 27, 2017 2:43 am
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
Re: Help with setup
Posted: Fri Jan 27, 2017 4:28 am
by Ikroth
Your image is in the graphics directory. Adjust your path like this:
Code: Select all
hamster = love.graphics.newImage("graphics/hamster.png")
Re: Help with setup
Posted: Sat Jan 28, 2017 4:00 am
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
Re: Help with setup
Posted: Sat Jan 28, 2017 5:05 am
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.
Re: Help with setup
Posted: Sat Jan 28, 2017 4:17 pm
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
Re: Help with setup
Posted: Sat Jan 28, 2017 4:32 pm
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.