Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Catch Santa
#1
Ok. I know. I know. It's February! "Why Santa?"

Trying to get a handle on N7 and I figured that I would give the old naalaa Santa game a bash...

Couple of things I have learned... I know. Unbelievable, right? lol   The game functions without including the speed and keycodes libraries...  That was by accident! I actually forgot to include them... Who knew? Not me... Took me a while to figure the change from arrays to tables... Thankfully the original arrays were 'single'... Other than that, there wasn't much else to convert...

I would appreciate it if someone could go over the game with a fine toothed comb... be gentle on listing any bugs? Nah. List them. I need to learn...


.zip   santa.zip (Size: 4.59 KB / Downloads: 9)

Instructions: Move left or right using arrow keys. Collect the presents. Game speed starts off slow and picks up... Moo ha ha!!
May your journey be free of incident.
Live long and prosper.
Reply
#2
Runs fine with me Johnno - no glitches found at this time. I love the graphics - really retro.....
Personally, I found the pace a little tame, but changing the fwait value from 30 to 60 sorted that out - pretty manic at that pace.
Reply
#3
I had it on 60 to start with... Yikes! My reaction times are not so fast... lol Switched to 30. A bit slow but it picked up as the game went on. Perhaps somewhere in between?

By the way... I found an old naalaa 5? listing of "1945". It took almost an hour to get it working. Again, I had to modify the 'arrays' and some of the "wait" commands needed tweaking. It ran SO fast with N7! Added simple retro sounds. Have not found a music track yet. (up for suggestions) I still need to add a "pause" and "game over" screen.

As well as scoring, the game includes an "accuracy" readout... The old naalaa used "set decimal 1" - N7 kicked up a fuss so I left it out... Now the accuracy readout displays up to about 6 decimal places. I could not find any reference to formatting numbers/text. I may have to resort to using integers...

Time for a cup of tea...
May your journey be free of incident.
Live long and prosper.
Reply
#4
Johnno - if you are just looking for a way to change a number with lots of decimal places to just two or three, this may help:
Code:
number = 1.22345678654
rounded_number =int(number *1000)/1000

The variable rounded_number will have the value 1.223. If you want it to 2 decimal places change the 1000 to 100, and so on....
Reply
#5
Cool... Thanks for the tip..!
May your journey be free of incident.
Live long and prosper.
Reply
#6
int(humber * 10) / 10 did the trick... Cool...
May your journey be free of incident.
Live long and prosper.
Reply
#7
Great work porting n6 games to n7!

Sorry, forgot all about the 'set decimal' command. If I remember correctly, it could also be used to format the integer part so that you could output 42 as 00042. But I think I'll just change the 'str' function so that it takes an optional parameter for the wanted (or ... max?) number of fractional digits:

str(value[, max_frac_digits])

a = 15.12345
pln str(a) ' outputs 15.12345
pln str(a, 2) ' outputs 15.12
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)