Return of the Memory Game

For questions about using Classic.

Post » Thu Oct 07, 2010 1:28 am

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!!!!!
B
28
S
8
G
8
Posts: 530
Reputation: 7,154

Post » Thu Oct 07, 2010 5:42 am

[quote="Guyon":juz35nei]
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?[/quote:juz35nei]
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.

[quote="Guyon":juz35nei]
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
[/quote:juz35nei]

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?
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Thu Oct 07, 2010 10:05 am

[quote="Guyon":1rxkwgw8]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[/quote:1rxkwgw8]

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.

[quote="Guyon":1rxkwgw8]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?[/quote:1rxkwgw8]

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.



[quote="madster":1rxkwgw8] 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?[/quote:1rxkwgw8]

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

[quote="Guyon":1rxkwgw8]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![/quote:1rxkwgw8]

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. :)
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Thu Oct 07, 2010 11:28 am

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.
B
22
S
3
G
6
Posts: 1,356
Reputation: 7,141

Post » Thu Oct 07, 2010 2:46 pm

[quote="PixelRebirth":2pfbam77]
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.
[/quote:2pfbam77]

That got me back on track TY PixelRebirth!

[quote="madster":2pfbam77]
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?[/quote:2pfbam77]

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!!!!!!!!
B
28
S
8
G
8
Posts: 530
Reputation: 7,154

Post » Fri Oct 08, 2010 5:13 am

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.
[code:z37563ln]
+ 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:
[list:z37563ln]
[*:z37563ln]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[/*:z37563ln][*:z37563ln]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.[/*:z37563ln]
[*:z37563ln]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.[/*:z37563ln]
[*:z37563ln]The INI file has 5 groups, each one with items "score" and "name". They're always ordered so that highest score is at [1].[/*:z37563ln]
[/list:u:z37563ln]

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.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Thu Nov 04, 2010 10:09 pm

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!!!!!
B
28
S
8
G
8
Posts: 530
Reputation: 7,154

Post » Fri Nov 05, 2010 12:10 pm

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.

[url:e7giquga]http://dl.dropbox.com/u/2306601/Spiderman_high5.rar[/url:e7giquga]

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. :)
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Fri Nov 05, 2010 12:20 pm

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 :D . It all connects!
B
10
S
5
G
8
Posts: 203
Reputation: 4,395

Post » Fri Nov 05, 2010 2:12 pm

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!
B
28
S
8
G
8
Posts: 530
Reputation: 7,154

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests