[Game]Armageddon

You have been tasked with the defense of six cities from the incoming nuclear apocalypse. You have only two launchers to shoot down incoming missiles. Survive as long as you can to delay the inevitable end of the world.


Jonne says:
A Missile Command game by our very own @wuuff, originally for the Gamebuino!
Ported quickly by Jonne, perhaps Wuuff will make a more high-res version :grin:
EDIT: I changed the ownership of this page to Wuuff


Update from wuuff:
New version added. Increases the resolution to 110x88, adds more colors, improves explosion effect, adds new title screen, fixes several bugs.

Old Version:

Pokitto binary

New version with highscore enabled

ageddon.bin (58.9 KB)

Source code on mbed community page

https://os.mbed.com/teams/Pokitto-Community-Team/code/Armageddon/

Highscores

  1. Rakkachi 10695
  2. wuuff 10630
  3. Pharap 9495
  4. Wandi 8095
  5. jonne 7145
6 Likes

Thanks for posting this. I had been busy with other things, so I hadnā€™t had time to work on porting Armageddon to Pokitto. I also wasnā€™t really planning to unless somebody asked for it, but Iā€™m definitely up for polishing the port up and maybe adding a couple new features. Does anyone have any requests for potential improvements?

1 Like

Source code and binary added

Nice gameplay. Just a minor suggestion: switch A and B button to fire relative turret. Now B fire from rightmost tower and A fire from left most, thatā€™s reversed against Pokitto buttons position.

1 Like

Dude: its open source. Just switch them!

Iā€™m kinda hoping someone turns it into a high res game with slow phosphor radar screen effect.

No seriously, I am making the whole system open and easy to edit for a reason.

I also made article a wiki. you can change/link an improved bin to the first post

2 Likes

Is pokitto fast enough to do that in hi-res?

Yup! Just made some changes and pushed to the repo.
Didnā€™t get the game was ā€œgroupwareā€. I thought it was owned by @wuuff.
BTW you could add a small article on repository management (fork/push/merge etc) at the bottom of your TODO list :smile:

Iā€™m sure it can handle without problem.

3 Likes

Well, I made the original game, but @jonne made the port to Pokitto and uploaded the port. I made the game open source so that people could make changes if they wanted. The original license file should be added to the repository, actually. Iā€™ll do that myself if I make any changes to it soon.

The launcher buttons were swapped because the Pokittoā€™s A and B buttons are reversed from the Gamebuinoā€™s. Thanks for changing them!

By the way, I noticed that the file had been automatically processed by a tool called PokittoParser that you wrote, @jonne. Have you uploaded this tool somewhere?

1 Like

Nope. Thanks for reminding me. Its a Python script that repairs the broken C source code Arduino calls ā€œSketchesā€ back to compilable C++. I will upload it here

2 Likes

Sound working now!

2 Likes

New version posted! Now that I have gotten my Pokitto, I thought a good first exercise would be to polish up this port. The details of the changes are in the first post, but I also wanted to post a list of observations I had while working on this.

  • The default font for Pokittoā€™s Gamebuino compatibility lib is 5x7, but I think the default is 3x5, which is why all the text in the original version of the port overlapped and was off-center. I have changed most of the code to now refer to a #define for font width and height when placing the cursor so that changes in font size will have a smaller effect.

  • The display.print function seems to have different behavior when printing out uint8_t than on Gamebuino, as it seems to be treating it like a character instead of a number.

  • It seems like the drawFastVLine function somehow drew one pixel too long? This is why the targeting cursor was taller than it was wide.

  • For Gamebuino mode, the screen scaling causes inconsistent widths (and heights? I couldnā€™t tell.) for the original pixels.

  • Is maxVal for the provided version of random(maxVal) inclusive or exclusive? I seem to be getting values equal to maxVal, which differs from the behavior of Arduinoā€™s random library function.

  • It seems like I get no sound at all unless I crank the volume around 60 or so, and even then I donā€™t get ingame sound (just the gamebuino title screen sound) unless itā€™s above 80! Itā€™s a bit different for headphones. No audio plays up through about 23, but if I increase to 26 or so the volume seems quite loud. No matter what volume I increase it above that seems equally loud. There is also a lot of background hum (in headphones) that changes depending on whatā€™s on screen, but only starts after the volume settings screen.

  • One of the autogenerated function signatures (by PokittoParser?) didnā€™t match the original function. It seemed to have changed void saveHighscore(uint32_t, char*) to just void saveHighscore(char).

1 Like

Iā€™ll take a look at that. Thanks for making a better version.

EDIT: care to update the .gif and binaries as well ?

1 Like

Binary is already updated. I havenā€™t actually run it in the simulator yet and I was using the online editor, so I still need to import it into Code::Blocks. Iā€™ll try to do that shortly.

Also, I forgot to mention, but is there EEPROM support yet? I noticed that all the EEPROM functions had been commented out, so currently highscores are lost on reset.

EEPROM has been reinstated in the PokittoLib and the API is 1:1 compatible with Arduino/Gamebuino.

So you could just take out the commenting and see what happens.

I had tried uncommenting them, but the functions canā€™t be found. What file should I #include? EEPROM.h doesnā€™t seem to exist, and I couldnā€™t find a mention of EEPROM in the docs.

PokittoEEPROM.h in POKITTO_HW directory. I am checking if it is included by default or not

Edit: yes, included by default in Pokitto.h in HW compilation

Yep, you should be able to call EEPROM with a global instance called EEPROM, just as in Arduino.

I have tested it it works offline at least. I need to check if it works in online mbed as well.

Edit: yes, it is also included in the online PokittoLib

https://os.mbed.com/users/Pokitto/code/PokittoLib/docs/tip/PokittoEEPROM_8h_source.html

Yep, looks like it works great. Saves the highscores exactly as expected. Iā€™ll make an update with that change in a few minutes.

I have the game working in the simulator. Is the process for recording from the simulator still the same as it was back in this post? How do you usually convert to a gif? The ways I have done it in the past were time-consuming.

I am relieved that someone for once says something like that instead of ā€œJonne, it doesnā€™t work!ā€ :grimacing:

2 Likes

On the positive side, a lot of people have started to use the PokittoLib :slight_smile:

1 Like