Web App: Vegas Blackjack

Discussion in 'Jailbreaks and iOS Hacks' started by cmaier, Oct 7, 2007.

  1. cmaier macrumors G4

    Jul 25, 2007
    Not as sexy as native apps, but I had a request in another thread, so I've released a web version of blackjack here:


    Enjoy, and let me know of problems/suggestions.
  2. CyberGeek macrumors member

    Jun 30, 2007
    Works pretty well, and it's fun. It would be nice if the "bust" message appeared after all cards finished moving, rather than as soon as the final card begins moving to its destination.

    Animating movement can be rather smooth on the iPhone as of 1.1.1 (check out the transitions on the Facebook iPhone site, for example). Looking at your animation function, I think your main performance bottleneck is centered around the number of parameters in your animation function, particularly that you build a string out of so many pieces in the setTimeout call.

    The way I handle animations is to have a global array of animation objects ('object' being just an associative array). These animation objects contain what would be all the parameters that you pass to this function. If you do that, the animation function itself no longer needs to take any parameters. Any time it is invoked, it increments all animations in the animation list, then sets a timeout to activate itself again if there are still animations that aren't done yet.

    I just figured I would say that in case you were interested. If you're satisfied with the performance of the animations, please just disregard what I said.

    I have to admit I'm kind of worried about the total lack of replies this thread has gotten since it was created. I hope it's not indicative that nobody cares about web-based games anymore, particularly because I'll be announcing one I've been working on soon, and it's no small game. I would hate for it to not be noticed at all.
  3. cmaier thread starter macrumors G4

    Jul 25, 2007
    Thanks for the feedback. I recently changed the "winner" announcement to happen after the cards finished moving, and was trying to decide whether i cared enough to deal with the "bust" (I probably do :)

    As for the animation, I do it your way (global sprite list) for more complicated games, but I figured the card movement is smooth enough (considering how short the travel distance is and how fast it happens). I may play around with it a bit and try to smooth it out some more. Not sure. I am a C++ programmer, so I'm not familiar with javascript optimization.

    As for your other point: yes, there is a definite lack of interest in web-based games, which is why I stopped working on them for awhile. I did this one only because someone requested it, and I figured if a few hours of my time makes someone happy, good enough.

Share This Page