Lua Verge Demo: Biggses Jukebox and Menu and Renderloop demo.
Displaying 1-5 of 5 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
mcgrue

Click here to download Bigg's Jukebox demo

I was a bit miffed that we didn't have many good example pieces of v3 running in lua mode. Biggs stepped up and provided this little tech demo, showing off a few fundamentals in this box-rendering jukebox demonstration.

His readme text follows:


Biggs's Demo's Readme!

Hi, y'all. I wrote a simple jukebox in Verge. It is very basic, but if you study the code, I show off some of the things that can be done with Lua. It's sweet!

Features it shows off are:

  • engineStep(func) and engineLoop(func) for hiding the implementation details of the game loop
    • see system.lua
  • managed resource lists for not having to keep track of loading/freeing resources in code all over the place (sounds, images, etc., but only currently used for modules and fonts in the demo)
    • see ui.lua for fonts usage and system.lua for implementation of the list.
  • a declarative, album information "language" to showcase how XML is not needed with Lua--create your own data!
    • see music.lua
  • programmatically (automatically) generated menus from the album info.
    • see appMenus.lua
  • coroutines for a sweet multithreading demonstration (and makes coding sprites much easier too!)
    • see sprites.lua for coding, appMenus.lua for usage,and system.lua for implementation

I recommend that anyone trying to understand the code will read through every single Lua file until they see how each part of the demo works together.

I have commented some files, but not others.

Notes

You might notice a lag whenever a song is selected to play.

This is because each coroutine will block all other coroutines until it is finished drawing itself. Since loading a song is both a blocking/synchronous call and takes a while to load, all other coroutines will wait on the coroutine that is loading the song. There is no way around this, unless one could break the loading functions down into baby steps and execute a step at a time inside the coroutine. The coroutine that is loading, would then slow down, but no other coroutines would.

Posted on 2007-10-21 13:49:34 (last edited on 2007-10-21 15:07:01)

zeromus

Thanks for making lua codes! I hope you enjoyed it!

Posted on 2007-10-22 18:20:41

mcgrue

There are a few Lua demos in the pipes, but Biggs was the first to ask me to post his.

Biggs wins!

Posted on 2007-10-22 19:10:09

Biggs

It was fun! Lua is liberating from the languages I am used to using (C++, Pascal). In fact, I will never code a game engine, sprite engine, map engine, or strip-animations using OOP ever again!

Posted on 2007-10-23 11:52:13

zeromus

eghhh I know what you mean about OO. I'm tired of it. But still I prefer intellisense and strong typing.

Posted on 2007-10-23 18:27:58


Displaying 1-5 of 5 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.