webOS Nation Forums >  Homebrew >  webOS Homebrew Apps > Craps v1.0.0 [was v0.9.1](7/24) Now w/ Shake support
Craps v1.0.0 [was v0.9.1](7/24) Now w/ Shake support
  Reply
 
Thread Tools Display Modes
Old 07/17/2009, 05:46 AM   #1 (permalink)
Member

 
Posts: 6,869
http://www.precentral.net/homebrew-apps/craps

So, this is my first time writing an application from scratch, go easy on me.

It's a very simple craps game, with only the two most basic bets: pass, and don't pass.

I just released 1.0, and I'd say barring any bugs this might be my last version. It does the main stuff very well now, and the only thing to add would be more bets. I did some initial planning of the logic that would be involved with all of that and I'd say at least for the time being, it's too much for me.

Source code is attached here, ipk in the Homebrew App link above.

Anyway, if you play this game a lot, donations are welcomed. I did spend a little bit more time on this than I expected when I started it on a whim to learn Javascript because I couldn't sleep, but donations aren't a requirement or anything. The link is in the app menu, but if it's easier on the PC, it's here as well for anyone who wants it.

If someone wants to contact the people who are doing that webOS-internals repository too, then it can definitely be included there as well.

Also, if anyone is curious about the very preliminary planning work I started doing for additional versions past 1.0 (still probably not happening): Craps Application. Maybe it'll show why I decided against it. (And I have no idea why it's showing as dotted lines in the uploaded version, for the record.)

1.0.0: Changed up Help scene to fit better. Added description for slider.
0.9.1: Fixed a bug where the shake function was still be listened for while in help-scene. (Forgot to add it to the Assistant.prototype.deactivate function.)
0.9.0: Accelerometer/ shake support! Shake to roll implemented thanks to boydell for his eight-ball app for helping me realize that shakeend works, just not shakestart. Make sure you hold onto your Pre tightly while shaking, there's some tactile feedback as well. I'm not responsible if it slips out of your hand.
v0.8.8: Working on accelerometer stuff but the two commands I need don't seem to be working. Wanted to get out GUI fixes from last two updates. Accelerometer stuff is commented out and therefore not present in this release.
v0.8.7: (Unreleased) Changed from text boxes to just palm-body-text. Looks much cleaner that way, and I was able to consolidate Bet & Money to the same line, which gives more room in case of notifications. A ton of behind the scenes changes had to happen for this.
v0.8.6: (Unreleased) The bet slider is a little too touchy for my liking, so I decided to round to the nearest 5. Sort of like a minimum bet at a casino, and it makes it much easier to select the number you want.
v0.8.5: Fixed game logic and help scene- a 12 on initial roll with don't pass bet is actually a draw / push.
v0.8.0: Adds data storage support via a cookie and a reset button in the menu, as well as polls the slider every 0.1 seconds to aid in selecting a bet. Also made help scene fit on one page without needing to scroll.
v0.7.0: Reworked help scene. Fixed bug mentioned below in v0.6.0. Reorganized functions to better prepare for when we finally get the accelerometer support. Disabled Roll button while in the process of rolling.
v0.6.0: Work on prettying it up. Better dice graphics and added a function to make it seem like you're actually rolling dice rather than getting a number instantly. Bug- after the first roll, it's now possible to change the radiobutton mid-game. The disabling function doesn't kick in until the second roll. Working on that now.
v0.5.0: Added a slider for the bet instead of having to type the number, Made text boxes read-only, Added Error if you try to bet more money than you have.
v0.4.5: (Unreleased) Figured out why Radio button was off center.
v0.4.0: Added How to Play and About to AppMenu.
v0.3.0: Figured out how to conditionally disable the radio button depending on whether a game is in progress or not.
v0.2.5: Changed Roll Dice color to stand out more.
v0.2.0: Added Don't Pass mode, changed app ID. If you installed a previous version to this, delete before installing.
v0.1.0: Removed Error Dialogs.
v0.0.3: Added Betting.
v0.0.2: Placeholder GUI.
v0.0.1: Proof of Concept App.
Attached Files
File Type: zip craps1.0source.zip (26.6 KB, 115 views) Email Attachment

Last edited by jhoff80; 08/05/2009 at 05:46 PM.
jhoff80 is offline   Reply With Quote
Old 07/18/2009, 12:10 PM   #2 (permalink)
Homebrew Developer
 
milominderbinde's Avatar
 
Posts: 4,491
It looks great. I can't wait to see where you take this!

- Craig
__________________
- Milo
Getting StartedRingtonesVideos/MoviesPatches/ThemesMusic Player(Remix)
Battery LifeBackup/SyncingGreat Signal-AiraveiPhone ThemeForum Guidelines
milominderbinde is offline   Reply With Quote
Old 07/18/2009, 06:57 PM   #3 (permalink)
Member
 
TMed_ATL's Avatar
 
Posts: 410
loves it. Now i dont have to look for a piece of cardboard to throw my dice on. Just shake my pre! (in future app that is)
__________________
SCK Manager
TMed_ATL is offline   Reply With Quote
Old 07/18/2009, 08:00 PM   #4 (permalink)
Homebrew Developer
 
milominderbinde's Avatar
 
Posts: 4,491
Would you update your OP with your most recent ipk? That is the convention in Homebrew because not everyone will go through looking to see if there is an update.

- Craig
__________________
- Milo
Getting StartedRingtonesVideos/MoviesPatches/ThemesMusic Player(Remix)
Battery LifeBackup/SyncingGreat Signal-AiraveiPhone ThemeForum Guidelines

Last edited by Milominderbinder; 07/18/2009 at 08:05 PM.
milominderbinde is offline   Reply With Quote
Old 07/18/2009, 08:45 PM   #5 (permalink)
Member
 
Colonel Kernel's Avatar
 
Posts: 775
Quote:
Originally Posted by milominderbinde View Post
Would you update your OP with your most recent ipk? That is the convention in Homebrew because not everyone will go through looking to see if there is an update.

- Craig
Ditto. To update the thread title, PM Darth Pooh with the old and new version numbers and whether your app requires rooting or not. I know yours doesn't, but with the [NRR] at the end of the post, it's easier to know what's what.
Colonel Kernel is offline   Reply With Quote
Old 07/18/2009, 08:58 PM   #6 (permalink)
Member

 
Posts: 6,869
Yeah, this got moved on its own to homebrew apps, it was originally in webOS development, which is why it was set up like that.

I've now cleaned everything up in the first post so it should be easier for everyone.

Last edited by jhoff80; 07/18/2009 at 09:13 PM.
jhoff80 is offline   Reply With Quote
Old 07/18/2009, 11:59 PM   #7 (permalink)
Member

 
Posts: 6,869
Just uploaded a small update, 0.4.0. If you already know how to play craps, it's not a huge update. I'd been trying for a while tonight to get the cookie storage to work so that the money you've won remains between sessions, but couldn't get it to work so I'll return to that later.
jhoff80 is offline   Reply With Quote
Old 07/19/2009, 03:07 AM   #8 (permalink)
Member

 
Posts: 6,869
Updated to v0.5.0, see first post for details.
jhoff80 is offline   Reply With Quote
Old 07/19/2009, 11:18 AM   #9 (permalink)
Member

 
Posts: 6,869
v0.6.0 is done. There's a bug with the disable/enable function so you'll probably have some issues with the radio button with this version, but I am aware of that and working on it.
jhoff80 is offline   Reply With Quote
Old 07/19/2009, 11:31 AM   #10 (permalink)
Member
 
Colonel Kernel's Avatar
 
Posts: 775
Thanx for the How to Play scene, but I don't understand the Don't Pass bet. There is too much going on to know what is opposite or how it would work.

Thanx for your work.

Storing information in cookies has worked for other HB Devs.
Colonel Kernel is offline   Reply With Quote
Old 07/19/2009, 11:43 AM   #11 (permalink)
Member
 
limoman's Avatar
 
Posts: 273
Tried installing version 0.6.0 but it doesn't appear in the launcher.
limoman is offline   Reply With Quote
Old 07/19/2009, 11:54 AM   #12 (permalink)
Member
 
Colonel Kernel's Avatar
 
Posts: 775
Quote:
Originally Posted by limoman View Post
Tried installing version 0.6.0 but it doesn't appear in the launcher.
Are you able to install or update other apps? I've had this problem twice already. Try deleting some apps --Homebrew and App Cat -- and then try installing again. I have no idea what the problem is or how that fixes it, but that fixes it for me.
Colonel Kernel is offline   Reply With Quote
Old 07/19/2009, 12:37 PM   #13 (permalink)
Member
 
limoman's Avatar
 
Posts: 273
Quote:
Originally Posted by Colonel Kernel View Post
Are you able to install or update other apps? I've had this problem twice already. Try deleting some apps --Homebrew and App Cat -- and then try installing again. I have no idea what the problem is or how that fixes it, but that fixes it for me.
I've not had a problem installing other Homebrew apps. I thought that perhaps it was an issue with the updated version 0.6.0. I was even able to install other Homebrew apps since trying the install of 0.6.0.
limoman is offline   Reply With Quote
Old 07/19/2009, 01:14 PM   #14 (permalink)
Member

 
Posts: 6,869
Quote:
Originally Posted by Colonel Kernel View Post
Thanx for the How to Play scene, but I don't understand the Don't Pass bet. There is too much going on to know what is opposite or how it would work.
Basically every bet is the exact opposite. I need to figure out a way to make the descriptions more concise and then I do plan on giving a description of how don't pass works. Do you think maybe a bulleted list would help?

Quote:
Originally Posted by Colonel Kernel View Post
Storing information in cookies has worked for other HB Devs.
Yeah, I'm sure it will work eventually, I'm just still trying to figure it out. As I said in my first post, this is the first time I've ever used Javascript, and the last time I made a website was before CSS was even around.

I probably won't have time today to get that taken care of, but I'm hoping to do that tomorrow or the next day (unless of course the update that enables accelerometer APIs comes out before then, that's too cool to just not try immediately. )

Quote:
Originally Posted by limoman View Post
Tried installing version 0.6.0 but it doesn't appear in the launcher.
Can't say I've had that problem, but I've repackaged the ipk and reuploaded it to the first post, so you might want to download again, delete any old versions, and try reinstalling it.

Last edited by jhoff80; 07/19/2009 at 06:01 PM.
jhoff80 is offline   Reply With Quote
Old 07/19/2009, 06:07 PM   #15 (permalink)
Member

 
Posts: 6,869
v0.7.0 up now. If anyone has any visual suggestions for the application, please, let me know.

All that really remains other than the visual stuff (which I'm pretty much running out of ideas for improving that) is the Cookie support and Accelerometer support.
jhoff80 is offline   Reply With Quote
Old 07/19/2009, 11:03 PM   #16 (permalink)
Member

 
Posts: 6,869
Quote:
Originally Posted by jhoff80 View Post
I probably won't have time today to get that taken care of, but I'm hoping to do that tomorrow or the next day
I guess I lied. v0.8.0 was just finished, adds data storage support via a cookie and a reset button in the menu, as well as polls the slider every 0.1 seconds to aid in selecting a bet.

To reiterate now, if anyone has any ideas for how I can improve how the app looks, let me know, because I'm running out of ideas to make it look nicer. (I'll figure out the code, just tell me how you think it can be improved.)
jhoff80 is offline   Reply With Quote
Old 07/19/2009, 11:23 PM   #17 (permalink)
Member
 
Bigchris's Avatar
 
Posts: 627
Great job on the app as well as the detailed updates too...
__________________
Remember, this is my opinion ! We all have a right to our own.....

Treo's 650-800..NOW,
Palm Pre
Bigchris is offline   Reply With Quote
Old 07/20/2009, 12:01 AM   #18 (permalink)
Member

 
Posts: 6,869
Quote:
Originally Posted by Bigchris View Post
Great job on the app as well as the detailed updates too...
Thanks... and yeah, one of my peeves is when an app gets updated and I can't figure out what the difference is (happens a lot in the App Catalog), so I figured I'd be as detailed as I could remember to.
jhoff80 is offline   Reply With Quote
Old 07/20/2009, 01:18 AM   #19 (permalink)
Member
 
Posts: 15
Thanks... this is a pretty clean and neat game
Chewbacca23 is offline   Reply With Quote
Old 07/20/2009, 11:41 AM   #20 (permalink)
Homebrew Developer
 
Posts: 73
Well done. This should make teaching people craps a lot easier

If you want any ideas for future updates you could try to add complexity and implement "come bets" and the ability to add odds when betting on specific numbers. I know that's a lot of logic to program but if you need something to keep you busy it's perfect ;-)
I think this craps game would be a great free app while the other one could be a welcome upgrade for a few bucks in the official app store. Just an idea of course.
jnk5y is offline   Reply With Quote
Reply

 

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0