Return of the Memory Game

This forum is currently in read-only mode.
From the Asset Store
Match the similar cards with each other and free all animals!
  • History:

    My daughter has been sick in the hospital for a year now, and we met a nice family that as a has a child that is mildly Autistic. Since he likes spider-man I thought I could punch out a quck game for him.

    Enter PixelRebirth with his memory demo game. WOW this was just what we needed Pixel!

    Problems:

    I am making it into a full featured game but have these problems

    INI:

    I can not seem to get my INI form my Rules page to the Game layout. My Best Time and Best Player Variables are reset to zero when I hit the Start Game button

    Debug Error:

    The game seems to work great, but when I hit the Start Game button (in Debug) I get errors but the game still runs fine. Why the errors?

    Instruction Button:

    When I toggle the Instruction Button I have to hide and show a lot of things. Can these be put in to a container to make hiding and showing easier in the game?

    High Score baord:

    I can make a simple high score with the INI but do not have the time since I am at the hospital alot to make a full featured high score with the top 5 lowest times. Does anyone want to pitch for that part? I am sure the boy will love it as it is but I thought that would add an extra element

    Game:

    http://www.box.net/shared/1lixv3mv35

    Thank you!!!!!

  • Instruction Button:

    When I toggle the Instruction Button I have to hide and show a lot of things. Can these be put in to a container to make hiding and showing easier in the game?

    I believe families would help you there. Make a HELP family and add all the help objects there, then just set visibility on the whole family.

    High Score baord:

    I can make a simple high score with the INI but do not have the time since I am at the hospital alot to make a full featured high score with the top 5 lowest times. Does anyone want to pitch for that part? I am sure the boy will love it as it is but I thought that would add an extra element

    I have a top5 score that stores in an ini file in the windows user profile folder. It's in my Dark Asteroids game. I could copy those events and paste as text here, then it should be easy to add them to your game. Does that work for you?

  • INI:

    I can not seem to get my INI form my Rules page to the Game layout. My Best Time and Best Player Variables are reset to zero when I hit the Start Game button

    One problem is that the INI object doesn't exist in your Game layout. Therefore the according events would do nothing. Making your INI object global should fix that issue.

    Debug Error:

    The game seems to work great, but when I hit the Start Game button (in Debug) I get errors but the game still runs fine. Why the errors?

    A couple of the errors are because of what I stated above. The other errors come up because there are no Card objects from the beginning, yet there are events that feature them. This is a quirk of the debugger and doesn't point to an actual error in the game. It can be annoying, but you can simply ignore it.

    Guyon wrote:High Score baord:

    I can make a simple high score with the INI but do not have the time since I am at the hospital alot to make a full featured high score with the top 5 lowest times. Does anyone want to pitch for that part? I am sure the boy will love it as it is but I thought that would add an extra element

    I have a top5 score that stores in an ini file in the windows user profile folder. It's in my Dark Asteroids game. I could copy those events and paste as text here, then it should be easy to add them to your game. Does that work for you?

    Madster's offer sounds good. If it doesn't work out for some reason I'd gladly help you to create a highscore table.

    History:

    My daughter has been sick in the hospital for a year now, and we met a nice family that as a has a child that is mildly Autistic. Since he likes spider-man I thought I could punch out a quck game for him.

    Enter PixelRebirth with his memory demo game. WOW this was just what we needed Pixel!

    Sorry to hear about your daugther. I wish you all the best and hope for a quick recovery!

    And good to know somebody is making noble use of my memory example.

  • Yes PixelRebirth is the best.Pixel you should create a post with more of your awesome tutorial games.Sorry to hear about your child Guyon.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • One problem is that the INI object doesn't exist in your Game layout. Therefore the according events would do nothing. Making your INI object global should fix that issue.

    That got me back on track TY PixelRebirth!

    I have a top5 score that stores in an ini file in the windows user profile folder. It's in my Dark Asteroids game. I could copy those events and paste as text here, then it should be easy to add them to your game. Does that work for you?

    Yes please, or you can email them to me *PM Sent* either is fine.

    *****

    Thank you all for your warm wishes though I am emotionally spent. My wife just spent the previous year battling a base of tong cancer with only only a 15% survival rate. Strangely enough she had a horrible care of shingles in her mouth that as the cancer quietly grew made intense pain and gave us an early warning and an 80% survival probability. So I guess shingles saved her life?

    Than you for you help everyone!!!!!!!!

  • Best wishes to you, your wife and your daughter. I hope your family's health will improve from now on.

    Here's the code, indented by repeating the + and - symbols.

    Code for showing top 5.

    + Registry: Key "Volatile Environment" in root HKEY_CURRENT_USER exists
    -> Registry: Open key "Volatile Environment" under root HKEY_CURRENT_USER
    ++ File: [negated] Directory Registry.ReadString("LOCALAPPDATA")&"\darkasteroids" exists
    --> File: Create directory Registry.ReadString("LOCALAPPDATA")&"\darkasteroids"
    ++ System: Always (every tick)
    --> INI: Set INI file to Registry.ReadString("LOCALAPPDATA")&"\darkasteroids\hiscores.ini"
    + System: Always (every tick)
    -> SpriteFont2: Show Text INI.ItemString("1", "name")&newline&INI.ItemString("2", "name")&newline&INI.ItemString("3", "name")&newline&INI.ItemString("4", "name")&newline&INI.ItemString("5", "name")
    + RecordEntrySpritefont: Value 'ID' Equal to 3
    -> RecordEntrySpritefont: Show Text INI.ItemValue("1", "score")&newline&INI.ItemValue("2", "score")&newline&INI.ItemValue("3", "score")&newline&INI.ItemValue("4", "score")&newline&INI.ItemValue("5", "score")
    [/code:z37563ln]
    Notes:
    [ul]
    [li]First we find out if the user has the INI file in the decided LOCALAPPDATA subfolder (Windows User profile), and if not, create it. Here I'm using darkasteroids/hiscores.ini[/li][li]RecodEntrySpritefont is a Spritefont object with a private variable called ID. This is so I can put several instances of the same Spritefont in the layout and pick the correct one by its ID. So ID=3 is the one that holds the high scores. I've ommited titles and such.[/li]
    [li]SpriteFont2 is another Spritefont object. Back at the time there was a bug involving picking the right Spritefont object, so I have a mixed approach here. This object holds the player names.[/li]
    [li]The INI file has 5 groups, each one with items "score" and "name". They're always ordered so that highest score is at [1].[/li]
    [/ul]
    
    The next code shows how to add a new score.
    
    [code:z37563ln]
    + TiledBackground: On timer "hiscore"
    -> System: Set global variable 'hiscore_slot' to 0
    ++ System: For "scoresloop" from 1 to 5
    +++ System: INI.ItemValue(str(6-LoopIndex),"score") Lower or equal global('score')
    ---> System: Set global variable 'hiscore_slot' to 6-LoopIndex
    
    + System: Is global variable 'hiscore_slot' Greater than 0
    + RecordEntrySpritefont: Value 'ID' Equal to 3
    + System: Trigger once
    -> XAudio2: Autoplay resource "hiscore.wav" (No loop)
    -> RecordEntrySpritefont: Write Text "you rank "&str(global('hiscore_slot'))&newline&"best scoring player"&newline&"your score is "&str(global('score'))&newline&newline&"enter your name" at 100 millisecond per letter
    + System: Is global variable 'hiscore_slot' Greater than 0
    + System: Trigger once
    + RecordEntrySpritefont: Value 'ID' Equal to 1
    -> RecordEntrySpritefont: Start Edit Box
    + RecordEntrySpritefont: On Edit Box Character Typed
    -> XAudio2: Autoplay resource "shooting.wav" (No loop)
    + RecordEntrySpritefont: On EditBox Ended
    -> XAudio2: Autoplay resource "explode.wav" (No loop)
    -> System: Set global variable 'hiscore_name' to RecordEntrySpritefont.CurrentText
    ++ System: For "scoresloop" from global('hiscore_slot') to 5
    --> System: Set global variable 'tempA' to INI.ItemValue(str(LoopIndex), "score")
    --> System: Set global variable 'tempC' to INI.ItemString(str(LoopIndex), "name")
    --> INI: Write value global('score') to item "score" in group str(LoopIndex)
    --> INI: Write string global('hiscore_name') to item "name" in group str(LoopIndex)
    --> System: Set global variable 'score' to global('tempA')
    --> System: Set global variable 'hiscore_name' to global('tempC')
    --> System: Go to layout "Hiscore" with transition "None" lasting 0 MS
    [/code:z37563ln]
    
    Notes: The first block finds where your score should be inserted
    In the second block hi-score slot == 0 means your score doesn't make it into the list.
    Afterwards there's a loop that pushes scores down until the last one is dropped out.
  • Done? Sort of.

    http://www.box.net/shared/j8m3m41mux

    For those not following this post I took PixelRebirth's great Contraction game and added some replay-ability to it with a scoring system algorithm and save. It was created for a wonderful, but mildly autistic child.

    While I have a single high score feature I do not have the time to insert madsters top 5 score, as I am at the hospital too much. So if anyone wants to be so kind to add that feature it would be greatly appreciated. I plan to give this to him soon, but would like to thank PixelRebirth for planting the seed to make a child happy! Oops, and Ashly and Dave for making the program (can't for get them).

    Thank you!!!!!

  • I added Top 5 highscore to the game. Had to make some changes to your INI, so be sure to use the new ini file for a testrun. It was a quick hack but seems to work perfectly.

    http://dl.dropbox.com/u/2306601/Spiderman_high5.rar

    It's a nice thing you're doing there Guyon bringing some joy to a kid that has been dealt a tough hand by life. Glad I could help you out there a bit.

  • It's kinda nice to hear that even fairly known programs (as of now) like Construct can make children happy. Its such a small world in the end . It all connects!

  • PixelRebirth you did it again. Many thanks.

    After I deliver the program to my little pal, I plan to offer it also to Children Hospital as part of there soft where library for all the brave kids there.

    http://www.chp.edu/CHP/Home

    Thank you and every one that make this happen!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)