Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: JWinslow23 on November 23, 2013, 01:42:16 pm

Title: Candy Wars
Post by: JWinslow23 on November 23, 2013, 01:42:16 pm
I made a quick Drug-Wars clone called Candy Wars.

I'm lazy, so I'll just copy-paste the readme:
Code: [Select]
   _____                _    __          __
  / ____|              | |   \ \        / /
 | |     __ _ _ __   __| |_   \ \  /\  / /_ _ _ __ ___
 | |    / _` | '_ \ / _` | | | \ \/  \/ / _` | '__/ __|
 | |___| (_| | | | | (_| | |_| |\  /\  / (_| | |  \__ \
  \_____\__,_|_| |_|\__,_|\__, | \/  \/ \__,_|_|  |___/
                           __/ |
                          |___/

                       by Josiah W.

##############
#Requirements#
##############

* 2,274 bytes of RAM for the game AND variable usage.
* (recommended, but not required)
No content in L1, L2, A, D, F, M, or X. These variables
are overwritten by CANDYWAR.8xp.

##############
#Installation#
##############

* Transfer CANDYWAR.8xp to your calculator. Then, run
it as a BASIC program on the homescreen.

#############
#How to Play#
#############

* Candy Wars is a Drug-Wars type game, with obvious
changes.
* Press ENTER to get past the title screen.
* Press UP and DOWN to go through menu options, and
ENTER to confirm your selection.
* You start with $10,000. Your goal is to buy and sell
candy to get over $50,000 to buy a new bike in as
little time as possible.
* These are the high and low values for candy prices.
+---------+-----------+
|Candy    |Price Range|
+---------+-----------+
|Gum      |$15-50     |
+---------+-----------+
|Lollipops|$50-100    |
+---------+-----------+
|Reeses   |$100-500   |
+---------+-----------+
|Kit Kat  |$500-1000  |
+---------+-----------+
|Twix     |$1000-5000 |
+---------+-----------+
|Hersheys |$5000-10000|
+---------------------+
* Be warned...health crazed parents might take some of
your candies at any time.
* Sometimes, you can get great deals on candies. Be on
the lookout for those kinds of deals!

#################
#Tips and Tricks#
#################

* Try to take advantage of as many deals as possible.
* Sell as many candies as you can, if you don't want to
get caught by health crazed parents.
* When in doubt, perhaps buy a Hersheys.

###################
#Legal Information#
###################

* This program is freeware, it shall be distributed
freely. Do not sell this game, or claim it as your own.
If you do distribute this program, credit me for it.

#########
#Credits#
#########

* Jonathan Maier for making the original TI-82 Drug Wars.
* gist.github.com/mattmanning/1002653 for having the
original TI-82 Drug Wars code.
* Ryan Bowen ([email protected]) for making an
excellent Candy Wars game, inspiring me to make mine.

#################
#Version History#
#################

v1.0: Initial release

The file is attached.

What do you think of the game? Might need optimization, but how good is the game?
Title: Re: Candy Wars
Post by: AssemblyBandit on November 23, 2013, 03:59:32 pm
I like it, it works for the +C! Maybe display the day in the main menu. And how do I lose over $3,000 outside!? Does it just fall out of my pocket! Maybe add a bully to take place of officer hardass! And you could buy brass knuckles or something to beat him up! :D (Or a shotgun to give it a nice american touch ;)) Good job on the game!
Title: Re: Candy Wars
Post by: JWinslow23 on November 23, 2013, 04:24:00 pm
I'm glad to get that kind of positive feedback from a programmer of your fame. Thank you.

I wouldn't know how to display the day in the main menu and make it look pretty. I mean, why don't you try to do that with the Menu( command? I don't think you can.

About losing money, that was my translation of "YOU WERE MUGGED IN THE SUBWAY" from the original. The loss formula was 2int(M/3), and I used that in the game.

Great idea about the bully, but I won't do the brass knuckles thing.

Once again, thanks for the feedback!
Title: Re: Candy Wars
Post by: AssemblyBandit on November 23, 2013, 06:37:08 pm
I couldn't find a way to convert real variables to strings without assembly :(

Here's what I got, it doesn't look pretty, I suck at BASIC, it uses 7 extra variables, but it does display up to 9,999,999 days in the menu:

Code: [Select]
Lbl C
"0123456789"->Str3
"DAYS"->Str1
D->E
0->B
":"->Str2
1000000->A
While A != .1
If iPart(E/A)=0 and B=0
Goto S
Str2+sub(Str3,iPart(E/A)+1,1)->Str2
1->B
E-iPart(E/A)*A->E
Lbl S
A/10->A
End
Str1+Str2->Str1
0
Menu("   CANDY WARS","SEE PRICES",0,"SEE YOUR CANDY",1,"BUY",2,"SELL"
,3,"EXIT",theta,Str1,C)

It looks like:

   CANDY WARS
1:SEE PRICES
2:SEE YOUR CANDY
3:BUY
4:SELL
5:EXIT
6:DAYS:123

You could do a better job than me optimizing it if you think it looks good enough.
Title: Re: Candy Wars
Post by: ClrDraw on November 23, 2013, 07:12:45 pm
I played the game and I like the idea, it's creative ;D also you should introduce yourself (http://www.omnimaga.org/index.php?board=10.0)!
Title: Re: Candy Wars
Post by: JWinslow23 on November 23, 2013, 08:54:34 pm
As for AssemblyBandit, there is a shorter way. It only uses Str1 and X.

Code: [Select]
"DAYS:
For(X,1+int(log(D)),1,-1
Ans+sub("0123456789",1+int(10fPart(D/10^(X))),1
End
Ans -> Str1

The Menu( command works the same, though. And I didn't know it worked like that!

As for ClrDraw, I just made a new thread introducing myself. Also, I am Josiah W on TI-Basic Developer, so check me there, too.
Title: Re: Candy Wars
Post by: AssemblyBandit on November 23, 2013, 09:46:23 pm
Wow, I really suck at BASIC!
Title: Re: Candy Wars
Post by: DJ Omnimaga on December 05, 2013, 11:00:40 pm
I like the idea. Drug Wars was a great classic, but sadly that kind of content is not allowed in most online calc archives anymore, so it's very hard to find. An alternate version with no drug reference is definitively good as well, I guess :)
Title: Re: Candy Wars
Post by: Phero on December 06, 2013, 12:12:46 am
Drug Wars was a great classic

And how. It was the first calc game that I played once I got my own calc, and I still play it from time to time. It still has a home as my dual-screen wallpaper (see spoiler).

Spoiler For Spoiler:
(http://ryanb.cc/DRUGWARS.png)
Title: Re: Candy Wars
Post by: DJ Omnimaga on December 06, 2013, 01:38:04 am
The picture is too small, I can't see anything D:
Title: Re: Candy Wars
Post by: JWinslow23 on December 06, 2013, 07:23:47 pm
Nice to see the creator of the website praise me for my work!  XD Thanks!