Switch to full style
Share your games and programs with the community.
Post a reply

Asterocks v2 with Sound!

Thu Aug 07, 2014 5:02 pm

I just finished another classic game in a fully ported version: Asterocks aka Asteroids.

Here's a screenshot:

Image

It features up to 32 asteroids on screen, rotating spaceship and thrust + hyperspace (use with caution!), plus the large and small saucers that shoot at you. Each level has more asterocks and meaner saucers. Be a bit patient when you die, it may take a while before you re-appear, because you only appear when there's enough space around you. Since the screen is small, it may take a few seconds.

Biggest problem in programming was the 4k limit of ram. Since the rocks move in different angles and speeds, it basically needed to be floating point variables in a 32 sized array, which means: x, y, xspeed, yspeed each times 32 = 128 times 4 bytes per value = already 512 bytes of ram. Since I started with up to 64 rocks on screen (only later I read that the original arcade game has even less than 32 on screen at a time!), it was 1024 bytes -> much too much. So I had to come up with a solution to "simulate" floating point without using it. What I did is to handle the action on a virtual screen that is 8 times the size and at drawing-time divide positions by 8. The result is that I can use integer values for speed and positions. Get it? If not, doesn't matter. Just enjoy the game.

Latest Update: Real sounds added! Enjoy the game.

If you like it, I'd be happy to recieve some comments and donations on Paypal to yoda@yodasvideoarcade.com
Last edited by yodasvideoarcade on Sun Sep 07, 2014 12:32 am, edited 2 times in total.

Re: Asterocks

Thu Aug 07, 2014 5:28 pm

I forgot the controls:

A - shot
B - thrust
left/right - rotate
down - hyperspace (be careful, you may appear in an asteroid, use only in emergency)

To prevent discussions: Yes, I'm aware that ripper already did a version of the game. I found that a lot of things (ufo, lives, levels etc.) are missing in that one. Also I never wrote an Asteroids-game and since it's my favourite arcade-machine I was quite interested in coding it as a learning-piece and also wanted to play it on the gamebuino.

Enjoy the game!

Btw, it's quite hard!

Re: Asterocks

Thu Aug 07, 2014 6:12 pm

How do you bring out these masterpieces so quickly?
Do you already have them programmed for another platform and just work some magic on the code?

Love your work :D

Re: Asterocks

Fri Aug 08, 2014 9:10 am

Thank you for your praise!

I code them from scratch, including graphics and everything. I don't have them on another system.

I'm working on a game about 2 hours per day.

I'm quite experienced in game-programming, maybe that's why it's going quite fast. But still there are some bugs costing me a lot of time and frustration. Yesterday the saucer-routine was not working and I searched for more than 1 hour to find the bug. It was a =! instead of != typo. Aaargh! I really would appreciate a gamebuino emulator for Mac, so I don't have to upload the game to the board every time I want to test.

I made a lot of games for Atari 8-Bit systems years ago. At the moment I'm creating Yoda's Video Arcade, a website where you can play old-school retro-style games I made, online play of course, no download. My goal is to get that website to make some money so I can focus on gamedesign full-time.

Re: Asterocks

Wed Aug 13, 2014 1:32 am

Hey. Nice game.

It works great but I think it's too fast. Everything is too sensitive. Could you make it match the original more, or open your source so I could tweak it? Thanks!

Re: Asterocks

Wed Aug 13, 2014 12:34 pm

qubist wrote:Hey. Nice game.

It works great but I think it's too fast. Everything is too sensitive. Could you make it match the original more, or open your source so I could tweak it? Thanks!

The source is in the zip file included.
http://www.yodasvideoarcade.com/gamebuino.php

Re: Asterocks

Wed Aug 13, 2014 2:57 pm

You can simply change the frame-rate, that makes the game slower.

Re: Asterocks v2 with Sound!

Wed Aug 13, 2014 3:43 pm

Changed the frame-rate a bit lower. And added real sounds! More fun now!

Re: Asterocks v2 with Sound!

Wed Aug 13, 2014 3:51 pm

I would play this, but 2 things hold me from doing so:
1. Can't compile the emulator!!!!
2. Don't have a Gamebuino (just yet!)

Re: Asterocks v2 with Sound!

Wed Aug 13, 2014 4:01 pm

You can run the emulator in wine, just install wine and prepend wine to the emulator command.
Post a reply