Original Post

Since I made an Ants for the Atari 2600 and I’m busy with Ants for the Odyssey^2, I thought to myself, why not make an Ants for the Virtual Boy? So, here’s the beginning. It wasn’t really a very fun game to begin with, more like a programming exercise, but I’d like to make a version of it for every system I know how to make homebrew games on. Since I know a little on how to do the Virtual Boy, I thought I’d do this. Note that this is a beginning, not the final product, and I hope to have stuff like walls and a timer (and if there’s a timer, there should be lives, too) before I finish it. The premise is simple: Touch the ants. To start a game, press A. I know this game doesn’t have to be 512k, so if someone can please tell me how to make the game smaller in size, I forgot how to do that.

Attachments:
10 Replies

VirtualChris wrote:
I know this game doesn’t have to be 512k, so if someone can please tell me how to make the game smaller in size, I forgot how to do that.

http://www.planetvb.com/modules/news/article.php?storyid=297

But just zipping the ROM would at least shrink the download quite a bit. 7-zip has excellent context menu support to make this super fast.

I don’t have time to try Ants now, but I’m glad you continue to polish your VB (and other console) dev skills! :thumpup:

I’ve run into a little problem: If you get above 99 ants, the counter goes crazy. Is there any way to stop this?

Attachments:

You can use the PrintStr function from Soviet Union 2010 to print numbers over 99.

I use dasi’s posprintf() port. It wouldn’t be hard to cludge another digit into your existing cludge, though…

.
.
.
char ants_str[4]; // Should probably be initialized
.
.
.
// TODO: put some range checking here
ants_str[0]=(antc/100)+'0';
ants_str[1]=(antc/10)+'0';
ants_str[2]=(antc%10)+'0';
.
.
.
  • This reply was modified 13 years, 3 months ago by RunnerPack.

As with both suggestions, I keep getting an error message that says the following:
“passing arg # of ‘posprintf’ makes pointer from integer without a cast.”
Replace the # with a number from 1-3 and you get my error messages.

You don’t pass the number as the string to be printed, you pass a “formatting string” and the number as an argument.

posprintf(ants_str, "%d", antc);

Or, to limit it to three digits:

posprintf(ants_str, "%03d", antc);

Just search for a printf tutorial.

OK, I tried what you did on the edited post, and I got a number that said 1A0 when it got to 110.

RunnerPack wrote:

ants_str[0]=(antc/100)+'0';
ants_str[1]=(antc/10)+'0';
ants_str[2]=(antc%10)+'0';

This wouldn’t work. What if ‘antc’ is, for example, 110? Then ‘antc/10’ would be 11.

EDIT: VirtualChris already caught it.

It was just a quick example to point in the right direction. I think printf is the way to go, but here’s the right cludge, for posterity:

.
.
.
char ants_str[4]; // Should probably be initialized
.
.
.
// TODO: put some range checking here
ants_str[0]=(antc/100)+'0';
ants_str[1]=((antc%100)/10)+'0';
ants_str[2]=((antc%100)%10)+'0';
.
.
.

Now with SFX!

Attachments:

 

Write a reply

You must be logged in to reply to this topic.