Shop OBEX P1 Docs P2 Docs Learn Events
CARD/GAME: Christmas Catch updated V1.1 — Parallax Forums

CARD/GAME: Christmas Catch updated V1.1

Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
edited 2009-12-04 09:28 in Propeller 1
I wanted to make a little animated Christmas card last year and simply didn't get
around to it. This year I thought I'd take the idea one step further with a little game.


Christmas Catch 2009 : Let me be the first to wish all my forum & expo friends
: A Very Merry Christmas!

Catch the falling toys with Santa's Sleigh. Consistent catches will increase your rank.

New version includes background music without the need for an connected SD card.

Thanks to:

Trodoss for the fine character converter. (Could have only been better on the prop itself. [noparse]:)[/noparse]
Potatohead for the new 8x8 driver! A lot of potential gaming fun in 20 columns!
Andy for the GM_Synth.

OBC

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?

Visit the: The Propeller Pages @ Warranty Void.

Post Edited (Oldbitcollector) : 12/4/2009 5:44:10 PM GMT

Comments

  • WBA ConsultingWBA Consulting Posts: 2,935
    edited 2009-12-02 04:59
    Jeff, any advice on where to start if I get no video on my Hydra with this? I loaded a couple other Hydra games and everything worked, but no video with this code. I started looking into the code, but got lost in the auto-detect sections. help!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Andrew Williams
    WBA Consulting
    WBA-TH1M Sensirion SHT11 Module
    Special Olympics Polar Bear Plunge, Mar 20, 2010
  • potatoheadpotatohead Posts: 10,261
    edited 2009-12-02 07:07
    Is there anything not stock with your HYDRA, such as a plug in card, or something?

    My HYDRA board is cooked at the moment. Never did test the HYDRA auto detect.

    If you want to make sure it's configuring for HYDRA, comment out all but this

    %01 : clkset( %01110110, 80_000_000 )                          ' Hydra        80MHz (10MHz PLLx8)
              ivcfg := %0_11_1_0_1_000_00000000000_001_0_01110000      ' %0_10_1_0_1_000_00000000000_011_0_00000111      ' Hydra & Hybrid
              ifrqa := $16E8_BA2F                                      ' (7,159,090.9Hz/80MHz)<<32 NTSC demoboard & Hydra 
              idira := $0700_0000
    
    



    Or, set the value of HWPins, instead of reading the state of them with the INA expression. Just change that to

    HWPins := 01

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Wiki: Share the coolness!
    Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
    Safety Tip: Life is as good as YOU think it is!
  • WBA ConsultingWBA Consulting Posts: 2,935
    edited 2009-12-02 17:44
    As of right now, my Hydra is stock. I tried with and without the expansion card EEPROM, thinking that may have been an issue, but no change (other games work fine either way). The VGA enable is off and Hydranet is off. With various demos from the Hydra CD, I can get composite video, keyboard, mouse, and gamepad 0 to function properly. Haven't tried VGA or Gamepad 1 to verify that my Hydra is "fully" functional.

    I thought about commenting that section like you suggest, but couldn't grasp the code well enough to know if that would lock in the Hydra setup. (in SPIN years, I am only 5 months old) I will try that tonight.

    thanks!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Andrew Williams
    WBA Consulting
    WBA-TH1M Sensirion SHT11 Module
    Special Olympics Polar Bear Plunge, Mar 20, 2010
  • potatoheadpotatohead Posts: 10,261
    edited 2009-12-02 19:15
    Cool. Also try it with nothing at all connected to the HYDRA, but the video, USB to program it, and power. Maybe there is a glitch in the autodetect. We've been using it for a while though.

    No worries on SPIN age. Heck, I'm struggling with some really basic stuff myself. (FREEWAY related) Think I've got it licked, but variable scope and pointers ended killing me for a good long time. Probably all of us have areas of skill, and then those other areas...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Wiki: Share the coolness!
    Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
    Safety Tip: Life is as good as YOU think it is!

    Post Edited (potatohead) : 12/2/2009 7:37:55 PM GMT
  • WBA ConsultingWBA Consulting Posts: 2,935
    edited 2009-12-03 08:17
    WOOHOO!!! I figured something out!

    I still had no luck with commenting or anything so I started looking at what the following section of code was actually doing by digging into the Propeller Manual.

    Original Code at line 93 in "Potato_Text_Start_RC3a.spin":
       %01 : clkset( %01110110, 80_000_000 )                          ' Hydra        80MHz (10MHz PLLx8)
              ivcfg := %0_11_1_0_1_000_00000000000_001_0_01110000      ' %0_10_1_0_1_000_00000000000_011_0_00000111      ' Hydra & Hybrid
              ifrqa := $16E8_BA2F                                      ' (7,159,090.9Hz/80MHz)<<32 NTSC demoboard & Hydra 
              idira := $0700_0000                                      ' Hydra & Hybrid
    
    
    



    First thing I found was that the ivcfg value was different between the actual value and the commented one, so I changed it to match the comment.
    Next, since the clkset value was unique for the Hydra, I figured it would be worth checking. I pulled out the Propeller manual to look through the clkset command and the definition of the bits in the CLK register to see what it should be. Sure enough, there it was. It should be 01101110, not 01110110 (pages 28-30 in the manual). Game works now with the aforementioned section of code changed to what follows:

        %01 : clkset( %01101110, 80_000_000 )                          ' Hydra        80MHz (10MHz PLLx8)
              ivcfg := %0_10_1_0_1_000_00000000000_011_0_00000111      ' %0_10_1_0_1_000_00000000000_011_0_00000111      ' Hydra & Hybrid
              ifrqa := $16E8_BA2F                                      ' (7,159,090.9Hz/80MHz)<<32 NTSC demoboard & Hydra 
              idira := $0700_0000                                      ' Hydra & Hybrid
      
    
    



    Feels good to know I can still comprehend things I read...........

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Andrew Williams
    WBA Consulting
    WBA-TH1M Sensirion SHT11 Module
    Special Olympics Polar Bear Plunge, Mar 20, 2010

    Post Edited (WBA Consulting) : 12/3/2009 8:36:59 AM GMT
  • WBA ConsultingWBA Consulting Posts: 2,935
    edited 2009-12-03 08:30
    OBC, Great game. I played it for about 5 minutes before I came back to finish my previous post. I love it's simplicity because it makes for a great demo, good kids game, and a Christmas treat.

    In case you were looking for feedback:
    You can't make it all the way across between gifts if a far right gift falls after a far left gift. (might be intentional?)
    Gifts fall a little fast for my daughter (3 1/2). Any easy way to slow down the gift falling speed?
    Your rank seems to increase slowly even when standing still. (while typing this post, I have made it to Santa level)

    Overall, love it. Can't wait to figure out how to slow it down so my daughter can try it. I don't have SD on my Hydra, so can't try the music.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Andrew Williams
    WBA Consulting
    WBA-TH1M Sensirion SHT11 Module
    Special Olympics Polar Bear Plunge, Mar 20, 2010

    Post Edited (WBA Consulting) : 12/3/2009 8:39:06 AM GMT
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-12-03 13:18
    5 mins is about the intended time for this being a simple Christmas card game. [noparse]:)[/noparse]

    The game itself was created over a period of two days, a record compared to my other projects.
    The neat part was how easy it is to adapt Potatohead's 8x8 driver to simple games.

    I'm not sure what is causing that right-left issue, I did fight a bit with the collision detection.
    Perhaps it's acting up a bit. As for the speed, try increasing the wait time on the delay
    at the end of the main loop.

    Line 240:
    waitcnt(cnt + 5_000_000) ''delay to slow the game a little

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
  • potatoheadpotatohead Posts: 10,261
    edited 2009-12-03 15:43
    Nice catch!

    I'll make the edits to the next release of the 8x8 driver. Thanks for being the Hydra tester! (mine needs new regulators, and we are just not gonna talk about why [noparse]:)[/noparse] I just carried code forward from another project. I'll let them know as well.

    Thanks for this fun little diversion OBC.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Wiki: Share the coolness!
    Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
    Safety Tip: Life is as good as YOU think it is!
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-12-03 17:52
    Thanks potatohead!

    Thanks to Andy in the Propeller section, I'll upload a version soon that does NOT require SD and supports the music.

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
  • WBA ConsultingWBA Consulting Posts: 2,935
    edited 2009-12-03 18:12
    OBC, Not sure about the 5 minute limit, because I played it for about 10 minutes after my posts. blush.gif Congrats on being able to make it so quickly, I wish I could do the same as my daughter loves to play with anything from my Parallax boxes. One of my goals is to have a few games that she is able to play on an SD card and let her pick a game from a menu. I wish there was a "game foundation" code made by someone that would be something like what you have done here, but the sections that would make the game different would be laid out in a manner that even a newbie like me could change it. For example, I wonder how long it would take me to change your game into a "catch the fruit with the basket" game?

    I wouldn't really call the left-right feedback an issue. Mainly, the speed of the sleigh movement is not fast enough to move all the way across the screen in the time it takes for a gift to fall from top to bottom. (that or my hand to eye coordination is a little slow). I thought maybe it was intentional so that you couldn't grab 100% of the gifts even if you were a pinball wizard. I'll try the delay and have my daughter try it tonight.

    potatohead, thanks. If I had my Hydra setup in a manner where it was not put away in a box everytime I finished using it, I would gladly load up anything to test on it. I would like to make a case for mine (that will also contain my PSOne display) because I am worried about the bare board and ESD especially if my daughter starts using it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Andrew Williams
    WBA Consulting
    WBA-TH1M Sensirion SHT11 Module
    Special Olympics Polar Bear Plunge, Mar 20, 2010
  • trodosstrodoss Posts: 577
    edited 2009-12-03 21:06
    WBA Consulting said...
    could change it. For example, I wonder how long it would take me to change your game into a "catch the fruit with the basket" game?
    What you would need to do is download the FontGenerator app (http://forums.parallax.com/showthread.php?p=833043).· I just updated this so that it will output in Potato_Text format.· Since OBC didn't post his .bmp that he used to generate the game, you would have to edit the one included with FontGenerator.·

    Then you would replace his cfont.spin with the new grapics and... Voila!· Falling Fruit!

    As far as a "kit" that would be one of OBC's other projects.

    --Trodoss
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-12-03 22:50
    Update posted!

    Music now included in the game with thanks to Andy. No need for SD now.

    I've also included the pre-converted font graphic for WBA's consideration.
    Feel free to grab code and go crazy. [noparse]:)[/noparse]

    A game kit is exactly the direction I'm heading. I think we could get folks to
    do all kinds of fun stuff if we can remove some the learning curve barriers to entry.

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
  • WBA ConsultingWBA Consulting Posts: 2,935
    edited 2009-12-04 09:28
    Nice! works great. Slowed it down a bit so my daughter can play it tomorrow (well, later today).

    FYI: Another Hydra tweak.... Changed Left audio to P7 for Hydra Mono Audio Out and sent Right audio onto an unused pin (P17).

    Looking forward to playing with the font generator and converting this to something else just to learn more about game programming.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Andrew Williams
    WBA Consulting
    WBA-TH1M Sensirion SHT11 Module
    Special Olympics Polar Bear Plunge, Mar 20, 2010
Sign In or Register to comment.