Friday, October 24, 2008

FBJS Animation Library

I completed more work on FBJS migration, but there is still a persistent issue where it seems the event handlers for bet clicking stop functioning after the first roll--it is really frustrating. Anyway, I also implemented animation effects for opacity and background color using Facebook's Animation library which uses jQuery-style function chaining.

Sunday, October 19, 2008

FBJS Blarg!

I've spent the better part of three hours trying to migrate the Javascript code I have to use the FBJS libraries. Although I'm disappointed it has taken so long, the task is beginning to bear fruit as I have almost eliminated all the bugs, and learned a great deal more about FBJS in the process. I am sure the next time I write some new FBJS code, I will be much quicker!

Still left to fix:
  • Integrating Fb:js-string identifiers to render FBML or using the beta FBJS function setInnerXHTML
  • Making sure payout hints render correctly/perhaps using the FBJS Animation libraries to perform the fading
Once that is done, there are still some key features to implement including Facebook user registration, but this should be much quicker than the time I took to implement it with the Thirteen Card Game application.

Saturday, October 18, 2008

Further Smarty-rization and Internationalization

Tonight I moved more code implement via templates, including separate Smarty templates for css, html, and ajax responses. Additionally, I implemented an database-driven internationalization engine, for easy localization in the future. The text shown to the user will be based on language code. I added tables to maintain text constants, languages, and text strings by language.

Smarty, Ajax Updating, DB backend

Today I completed integration of the Smarty Template engine and incorporated Ajax updating. I plan to tighten up the client-side code and work on Facebook support next.

Additionally, greater integration with database support has been added, storing someone's bank in the database, as well as loading payout rates from a database. This will facilitate gaming-locales which I plan to implement later, as well as group-tables, where multiple individuals will be able to bet at the same time.

Todo
  • FBJS support
  • FB Ajax support
  • PHPUnit Tests
Current Screenshot:

Tuesday, October 14, 2008

Layout, Interface Progress, Revision 7

I finished the initial version of the basic html interface which uses basic Javascript and should downgrade gracefully without Javascript. Without CSS is another matter, as it requires at least CSS level 1.



In addition to completing the basic interface, I have started to implement the code that will control rolling and display of the board. This will help a great deal later when I swap in the Smarty Template engine and build subsequent interfaces. I plan a more advanced Flash interface and a mobile-friendly interface as well.

Prior Facebook application building has given me some good ideas about how to build from the ground-up, and I have designed so that it will be easy to implement the Facebook Ajax API once I have registered my application.

Sunday, October 12, 2008

Roll Analysis

I've completed the code (it was oh so simple) for roll analysis and event determination. I decided that each of the betting possibilities would be represented by a constant, and I would use the roll outcome to create an array of valid events. For example, if a 4, 4, 6 were rolled, several event outcomes would be generated including an outcome for each of the die values:
  • DICEEVENT_4
  • DICEEVENT_4
  • DICEEVENT_6
  • DICEEVENT_SPECDOUB4AND6
  • DICEEVENT_BIG
  • DICEEVENT_SUM14
You get the idea. This simple way of representing outcomes allows a basic engine in under half-an-hour, and yet allows the determination of other possible events not represented on the initial board I have in mind like the ODD/EVEN outcomes.

Project Initiation

I've started working on a webapp version of Sic Bo, a.k.a. Big Small, which is a Asian dice-game. It's one of my wife's favorite games and I didn't see many options out there to play this game. It is a game like roulette or craps where you bet on the outcome of a roll of 3-dice. There are various options for betting. Wikipedia has an excellent description and sample board.

I has a road map in mind for development, but I really want to push a very simple nuts-and-bolts version within the next couple weeks. For development, I will be making extensive use of the PEAR libraries, especially DB_DataObject, which is one of my favorite data object libraries out there.

I am thinking about making a really glitzy interface in Flash, as that's half the fun of casino games, but I definitely want to have an option of interfaces, as this will be a good game to offer mobile users.