[javascript]Luv.js
Re: [javascript]Luv.js
Another question: can you loop music?
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
personal page and a raycaster
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: [javascript]Luv.js
Yes, you should be able to play music in a loop. Assuming that you have the music ogg file loaded in a variable called music, you can do:
If you are not doing anything weird with the music (like playing it simultaneously with different offsets/volumes) you should be able to later stop the music with:
If you are doing something more complex with sound instances you will have to stop each instance independently. If you don't know what a sound instance is, you can probably disregard this paragraph.
Full disclosure: While the API exists and the tests pass, I still have not tested them completely - I have not used them in a game/demo yet. loop is one of the options I have not tested yet. It should work, but if it doesn't please let me know. Pretty please with a cherry on top.
Code: Select all
music.play({loop: true});
Code: Select all
music.stop();
Full disclosure: While the API exists and the tests pass, I still have not tested them completely - I have not used them in a game/demo yet. loop is one of the options I have not tested yet. It should work, but if it doesn't please let me know. Pretty please with a cherry on top.
When I write def I mean function.
Re: [javascript]Luv.js
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
personal page and a raycaster
Re: [javascript]Luv.js
This should be moved to the "Ports" section of the forum.
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
personal page and a raycaster
Re: [javascript]Luv.js
Is it really a port though? I see luv.js more like a standalone, albeit very LÖVE-inspired, javascirpt game framework. But perhaps the difference doesn't matter much. If HÖVE counts as a port, so should luv.js I guess (since they both use different languages with a LÖVE-like API),Davidobot wrote:This should be moved to the "Ports" section of the forum.
My game called Hat Cat and the Obvious Crimes Against the Fundamental Laws of Physics is out now!
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: [javascript]Luv.js
I don't consider Luv.js a port at all, but If people want to move the post here, I'm ok with it (it is actually easier to find here )
When I write def I mean function.
Who is online
Users browsing this forum: No registered users and 2 guests