Register To Post



 Bottom   Previous Topic   Next Topic

#1
Ants for Virtual Boy
Posted on: 2011/3/24 11:49
PVB Elite
Joined 2008/4/26
USA
526 Posts
CoderContributorLong Time User (5 Years)Top10 PosterHOTY09 3rdPVBCC 2010 Entry
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.

Attach file:


vb an.VB Size: 512.00 KB; Hits: 32
Top

#2
Re: Ants for Virtual Boy
Posted on: 2011/3/24 19:53
PVB Elite
Joined 2003/7/26
USA
967 Posts
PVBCC EntryCoderContributorSpecial AchievementTop10 PosterHOTY09 EntryLong Time User (9 Years) App Coder20+ Game Ratings
Quote:

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!
Top

#3
Re: Ants for Virtual Boy
Posted on: 2011/3/24 20:22
PVB Elite
Joined 2008/4/26
USA
526 Posts
CoderContributorLong Time User (5 Years)Top10 PosterHOTY09 3rdPVBCC 2010 Entry
I've run into a little problem: If you get above 99 ants, the counter goes crazy. Is there any way to stop this?

Attach file:


zip ants.zip Size: 6.43 KB; Hits: 37
Top

#4
Re: Ants for Virtual Boy
Posted on: 2011/3/24 21:36
VUE(xpert)
Joined 2008/12/28
Slovenia
445 Posts
Highscore Top ScoreCoderContributorTop10 Poster10+ Game RatingsLong Time User (4 Years) App CoderPVBCC 2010 Entry
You can use the PrintStr function from Soviet Union 2010 to print numbers over 99.
Top

#5
Re: Ants for Virtual Boy
Posted on: 2011/3/24 22:06
PVB Elite
Joined 2003/7/26
USA
967 Posts
PVBCC EntryCoderContributorSpecial AchievementTop10 PosterHOTY09 EntryLong Time User (9 Years) App Coder20+ Game Ratings
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';
.
.
.
Edited by RunnerPack on 2011/3/24 22:33
Top

#6
Re: Ants for Virtual Boy
Posted on: 2011/3/24 22:32
PVB Elite
Joined 2008/4/26
USA
526 Posts
CoderContributorLong Time User (5 Years)Top10 PosterHOTY09 3rdPVBCC 2010 Entry
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.
Top

#7
Re: Ants for Virtual Boy
Posted on: 2011/3/24 22:36
PVB Elite
Joined 2003/7/26
USA
967 Posts
PVBCC EntryCoderContributorSpecial AchievementTop10 PosterHOTY09 EntryLong Time User (9 Years) App Coder20+ Game Ratings
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.
Top

#8
Re: Ants for Virtual Boy
Posted on: 2011/3/24 22:41
PVB Elite
Joined 2008/4/26
USA
526 Posts
CoderContributorLong Time User (5 Years)Top10 PosterHOTY09 3rdPVBCC 2010 Entry
OK, I tried what you did on the edited post, and I got a number that said 1A0 when it got to 110.
Top

#9
Re: Ants for Virtual Boy
Posted on: 2011/3/24 22:42
VUE(xpert)
Joined 2008/12/28
Slovenia
445 Posts
Highscore Top ScoreCoderContributorTop10 Poster10+ Game RatingsLong Time User (4 Years) App CoderPVBCC 2010 Entry
Quote:

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.
Top

#10
Re: Ants for Virtual Boy
Posted on: 2011/3/24 23:44
PVB Elite
Joined 2003/7/26
USA
967 Posts
PVBCC EntryCoderContributorSpecial AchievementTop10 PosterHOTY09 EntryLong Time User (9 Years) App Coder20+ Game Ratings
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';
.
.
.
Top

 Top   Previous Topic   Next Topic


Register To Post

You are not logged in.
Lost Password?
Register Resend Activation