|
Post by johnno56 on Apr 23, 2020 16:29:18 GMT -6
Ok. I now have a working hiscore table... kind of...
After MUCH research into high score tables (very few in Basic!) I then realised that sdlbasic has a high score library... So I stole (borrowed) three of its subroutines and modified them for RC... Then I had to work out how to use them... All this "thinking" is having a "serious" drain on my coffee supply!!!
This is what I finally figured out... If the hiscore file exists then load into the arrays or else initialise the file, create a new file then load into arrays.
Using myself as a "hard coded player name", I have played (tested) the game many times and the name and current score is added to the table - in the right place! Replaying the game, and assuming that I have the highest score, my hiscore appears on screen. Deliberately deleted the file. Re-ran. A new "default" file is created. Continued testing and my name was added...
At the moment, the hiscore table, contains the top 10 players... Most tables default to 10... But I may reduce it to 5. All I have to do is get the player's name when added to the table then design a "High Score" or "Top Scores" screen.
Question: Do you think that it would be better to display the top scores when then player loses or have the option to display the table at the Main Menu? Until I hear, I'm going to go with the "Menu" option....
I am not sure when these changes will be finished. Hopefully it will not be too long... If it works, I will release an update...
At last there seems to be light at the end of the tunnel... I'm hoping it's not an on-coming train... lol
|
|
|
Post by kennn on Apr 23, 2020 19:37:35 GMT -6
Ok. I now have a working hiscore table... kind of... Question: Do you think that it would be better to display the top scores when then player loses or have the option to display the table at the Main Menu? I choose "have the option to display the table at the Main Menu"! By the way, I have some opinions of power-up: make several types of power-ups if you still have time before the competition deadline. Power-ups will make your game more perfect. However, complicated power-ups are not suitable as there are only 16 days left.
|
|
|
Post by johnno56 on Apr 23, 2020 22:14:31 GMT -6
Ok. Here is the next release. It now includes a high score table (accessible via the menu...) but is still NOT complete... This release is to gauge opinions as to the concept. www.dropbox.com/s/csxjtu2jgibn83g/alpha09_7.zip?dl=0To do: Figure out how to enter the name and score of either a new top or high score... At the moment, it's hard coded, for my name... Moo ha ha... Note: I have deliberately left out the actual hiscore.txt file. I need to make sure that the file will be created on your machine... There is a glitch with the table... Try this and see if you can repeat the error.... When the game starts, all table names will have a score of 100. (Option #3 on the menu) Play the game. After a while, stop shooting - remember your score - then allow a rock to hit you. Choose to play again. But THIS time, score LESS than the tables minimum score of 100, allow a rock to hit you... You will get a 'congratulations' message - even though you scored less than minimum... Then reply with a "Y"... then let me know what happens? This is the message I received.... terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc Aborted (core dumped) ------------------ (program exited with code: 134) RC does not point to where the glitch occurred, so I have no idea, as to where to look.
|
|
|
Post by johnno56 on Apr 23, 2020 22:43:57 GMT -6
Ok. Gave it some more thought - yeah, who knew! Replace the main file with this one... I had the checking for below minimum table score in the wrong place. Hopefully this should fix it... alpha09_7.bas (27.25 KB)
|
|
|
Post by tbird on Apr 24, 2020 8:56:10 GMT -6
Sorry johnno you've been asking questions and not many responses, I should be checking on here more often.
Here is a simple name entry system, modify as you see fit to meet your needs.
|
|
|
Post by kennn on Apr 24, 2020 9:49:58 GMT -6
Play the game. After a while, stop shooting - remember your score - then allow a rock to hit you. Choose to play again. But THIS time, score LESS than the tables minimum score of 100, allow a rock to hit you... You will get a 'congratulations' message - even though you scored less than minimum... Then reply with a "Y"... then let me know what happens? terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc Aborted (core dumped) ------------------ (program exited with code: 134) This error did not occur.
|
|
|
Post by johnno56 on Apr 24, 2020 10:38:31 GMT -6
Thanks, Kennn. By the way. Did you use the full program from the latest zip file? or did you install the zip file then replace the main 'bas' file that I upload recently?
Tbird,
Thank you for the example... Your meaning of "simple" differs greatly from mine... lol N00b had sent a sample some time ago, that I have not tried yet, but I will test both... as soon as I get some sleep. It's after 2:30am... *yawn*
|
|
|
Post by tbird on Apr 24, 2020 12:16:31 GMT -6
I see n00bs now, it's basically the same without the fluff, I added a blinker and a safety so it wouldn't detect a double press of the return key. Also I didn't add the ReadInput_Stop() in mine...my bad.
|
|
|
Post by johnno56 on Apr 24, 2020 15:17:22 GMT -6
I suppose I could be diplomatic about this... So as not to 'offend' either of you, I could patch together a program using both your examples, and give both of you the credit...
Now that I have had my mandatory 4.5 hours of sleep, I will test both of your examples, then see where we go from there.
Now then you two, I want you both to return to your respective corners. When the bell rings, I expect a clean fight or I'll disqualify both of you.... lol... Never been a fan of pugilism.
Back to coding...
|
|
|
Post by johnno56 on Apr 24, 2020 16:42:14 GMT -6
Ok. I have been testing n00bs routine, within the program, and it kind of works...
n00bs routine has a smaller footprint and it backspaces... and this is it's strength and source of concern.
The routine relies on the clearcanvas/update so as to display the backspacing effect. Which it does without flaw... However, within the game when the routine is called, clearcanvas does exactly as it is intended. Everything, except for the routine, is cleared away....
"Why not just remove the clearcanvas from the loop?"... That solved the problem of everything disappearing, but the backspace effect is no longer visible (backspace still works and the text is deleted... you just can't see it.)
The routine sits within the "congratulations" sub routine on line #601. As there is no change to assets I will just post the main file. Try it out.
In the meantime I will add Tbird's routine...
|
|
|
Post by johnno56 on Apr 24, 2020 16:48:45 GMT -6
Update:
I did not have to load Tbird's routine. As Tbird said, his routine is basically the same as n00b's, but has more "fluff". It too has the same clearcanvas/update loop...
|
|
|
Post by tbird on Apr 24, 2020 18:45:21 GMT -6
Well now I'm insulted....I guess I will find a corner to weep in....
Happy coding!
|
|
|
Post by johnno56 on Apr 24, 2020 20:51:19 GMT -6
Don't get me wrong... I like 'fluffy'... No insult was intended... Weeping? I would offer you a handkerchief, but I think the cost of postage, would probably make 'me' weep... lol
If n00b's routine can be fixed, then I cannot see any reason why a certain degree of 'fluffiness', would not be added.... lol
|
|
|
Post by kennn on Apr 25, 2020 3:52:27 GMT -6
Did you use the full program from the latest zip file? or did you install the zip file then replace the main 'bas' file that I upload recently? Hello, Should be "install the zip file then replace the main 'bas' file that I upload recently". I can imagine that your mood is very cheeful now. Just like a hardworking secondary school student preparing for an important examination: the GCE A-level examination. Moreover, the university life of this student will start soon. I will try version alpha09_8 later.
|
|
|
Post by kennn on Apr 25, 2020 4:25:02 GMT -6
In version alpha09_8, when I press spacebar, so many bullets come out from the spaceship. This effect is really excellent and interesting but too powerful.
My suggestion: if you have time and decide to make several types of power-ups, this effect should be one type of power-up.
|
|