Arduino BITNINJA 09/09/2018
This is my first game for VGAX the VGA library that i have developed for Arduino.
TLDR: Video of BITNINJA first test
The game
This game is a small platform game, like Super Mario Bros, designed by me. After my nomination in the IOCCC 2014 Contest, i have ported some of the logic of the SMB Engine that i have developed for the Contest.
BITNINJA implements these features:
- input controller LEFT+RIGHT+JUMP with three buttons
- cutscene for splash screen, credits, introduction and epilogue
- background music for cutscene
- 5 playable levels
- collision detections
- 6 max enemies in each level
RAM Optimizations
Becouse VGAX uses 1800 bytes of RAM and the Arduino UNO ATMEGA328 MCU has only 2048 bytes of RAM, the game is optimized to use only 41 bytes of global RAM. All the images, sprites, songs and level definitions are stored in the MCU FLASH ROM. Doing the math: 2048-1800-41=207 bytes are "free", used for the MCU STACK where local variables and parameters are stored.
The 41 bytes required for BITNINJA to run are subdivided like this:
- 11 bytes for player movement and game cutscene
- 24 bytes for 6 enemies (4 byte for each enemy)
- 6 bytes for music
Sourcecode
Here you can download the BITNINJA source code !
Hardware
The hardware required is pretty cheap:
- a DSUB15 male connector (VGA)
- 2 68ohm resistors
- 2 470ohm resistors
- 2 22pf capacitors
- 1 16Mhz oscillator
- 3 passive buttons
- 1 audio buzzer
- 1 microusb female connector
The wiring and soldering is documented inside VGAX library documentation, except for the wiring of the standalone ATMEGA328 MCU but you can easily find online How to run ATMEGA328 standalone.
Here you can see a video of BITNINJA testing running on the Arduino UNO, before the standalone board creation. The level you see in the video is a test. The 5 levels inside the final version are different than the one in the video.
This is the final board, with a piece of plexi on the bottom:
I am planning to take a video of all 5 levels, running on the final standalone board. When i will do the video i will post it here!
Have FUN!
1981 The Game 02/09/2018
This is a SciFi text game, written by me. A text game is like the old "Libro Game" that i read in my childhood (80s). You can read the story and choose how the story must continue.
1981 is short, you can complete the story in 15 minutes but warning: there are more than one ending!! :-)
Here you can play 1981 The Game. NOTE: The game is written in italian! There is no translation in any other languages!
1981 was written in Javascript, PHP and CSS3!
I am planning to upgrade the 1981 website to be Responsive and Mobile Friendly but i don't know when i can do this.. in the future, sure.
Some years ago i have started to porting this game to an Arduino projects... but i never complete the project.. yet!
This game was originally published on the ASSEZETA.COM website, created by me and my old friend Marco Baudino.
MINICHIP The Game 02/09/2018
A little platform game programmed in Javascript. This was the origin for the development of my future IOCCC Super Mario Bros Platform Engine. All the graphics (in pixelart) and sounds are created by me. This game has also a simple Level Editor i have used to design all levels of the game.
This game was originally hosted on ASSEZETA.COM, years ago.
Here you can open the MINICHIP Homepage.
Following are some of the sprites used inside the game:
Have FUN!
IOCCC 2014 Winning entries 02/09/2018
Long time ago (2014), in a galaxy far far away, i have won two nominations at the Internatonal Obfuscated Code Contest. I remember when I discovered the IOCCC, back in 2003, thanks to EFFEOTTO ... I would have never thought to participate and win something .. but in a single year i have won two times! Incredible :-)
Homage to a classic game
This is the source code of the first winning entry:
The program is not only a Super Mario Bros partial implementation but also a generic Engine for Platform Games. It can be used to create games like Super Mario Bros. The contest entry was released with two example games level: one level of Super Mario Bros and one level of Giana the Sister (an SMB-like game for Amiga).
These are two screenshots of the two playable levels:
The Engine implements all the needed stuff:
- Rendering with vertical and horizontal scrolling
- Player animations and control via keyboard
- Collision detection
- Gravity
- Enemies with walking animations and death animation
- Power up (Giana become a PUNK and Mario become BIG)
- Background music
These are the IOCCC Selected Judges Remarks about this program:
"A classic for a particular generation. Like all good programs, being data driven means you can do fun things in small spaces."
Here you can download the obfuscated sourcecode. If you open the file with and see some ugly alignment, set the TAB WIDTH of your text editor equal to 4. :-)
Here you can download the not obfuscated sourcecode. The code is already unreadable due to the shrink in sizes and due to the multiple rewrite steps (needed to simplify all the internal logic of the Engine).
Here you can read the official IOCCC winning entry description.
Most tweetable entry
The second winning entry is very little. This is the program full sourcecode:
d=80,e,j;g(){j+=getchar();}main(a,b)char**b;{for(;;){j=0;g();if(j<0)break;g(g());putchar(b[1][j/3*strlen(b[1])>>8]);if(!(++e%d))puts("");}}
There is also a shortest version of the same program, with a simplified logic:
d=80,e,j;g(){j+=getchar();}main(){for(;;){j=0;g();if(j<0)break;g(g());putchar(" .:#@"[j/3*5>>8]);if(!(++e%d))puts("");}}
What the hell do the program do?
The program convert the image given in input to an ASCII ART!
These are the IOCCC Selected Judges Remarks about this program:
"On the face of it :-) given what this program one might wonder what makes this winner special. But when you realize the source is small enough to tweet on twitter you understand.
Who will be the first to tweet this source? How many re-tweets will such tweet get? And how many people will really understand the tweet?"
Here you can read the official IOCCC winning entry description.
...
Now... Really... How much is insanely NERD all of this?