Changes

Jump to navigation Jump to search
1,993 bytes removed ,  13:48, 12 August 2011
Line 1: Line 1:  
{{TOCright}}
 
{{TOCright}}
 +
 +
[[File:ScreenshotCloudy.jpg|500px]]
 +
 
==Description==
 
==Description==
 
This is your basic "Lemonade Stand" style game, where the player manages a lemonade stand (or similar such store) and tries to make as much money as possible. The game is designed to incorporate money and fractional math skills to teach basic operations.  
 
This is your basic "Lemonade Stand" style game, where the player manages a lemonade stand (or similar such store) and tries to make as much money as possible. The game is designed to incorporate money and fractional math skills to teach basic operations.  
Line 6: Line 9:     
==Project Status==
 
==Project Status==
The project has just been re-written and should be a bit easier to localized in the future.
+
{{:Lemonade_Stand/status}}
   −
Any interest in helping can be directed towards project leader [[User:Qalthos|Nathaniel Case]] as well as the other listed members below, under contacts. Lemonade Stand is to be considered an open project, with updates varying based on availability.  Nathaniel will continue to have interest in the project and will continue to provide assistance and input as time allows.
+
Any interest in helping can be directed towards project leader [[User:Qalthos|Nathaniel Case]] as well as any of the other listed active members. Lemonade Stand is to be considered an open project, which is currently undoergoing active development for the RIT fall quarter 2010.  Nathaniel will continue to have interest in the project and will continue to provide assistance and input as time allows beyond this time.
    
==Releases==
 
==Releases==
Line 14: Line 17:  
* [http://gitorious.org/lemonade-stand-olpc/lemonade-stand-olpc/commit/aaf4186bf1403a6ee2892f9c606d676d78311f17 1.1.0](git tag): Updated game code.
 
* [http://gitorious.org/lemonade-stand-olpc/lemonade-stand-olpc/commit/aaf4186bf1403a6ee2892f9c606d676d78311f17 1.1.0](git tag): Updated game code.
 
* [http://activities.sugarlabs.org/en-US/sugar/addons/versions/4321#version-4 2.0, XO Release 4]: Game Rewrite
 
* [http://activities.sugarlabs.org/en-US/sugar/addons/versions/4321#version-4 2.0, XO Release 4]: Game Rewrite
 +
* [http://activities.sugarlabs.org/en-US/sugar/addons/versions/4321#version-5 2.1, XO Release 5]: Beautification Project
 +
 +
==Structure==
 +
For more detailed information on how to implement new things, please see the [[Lemonade_Stand/Developer_Documentation|Developer Documentation]]
 +
 +
The game's 'day' is split into 3 parts (Start of day, Day occurs, and End of day)
 +
 +
[[File:GameFlow2.jpg|550px]]
 +
 +
===Morning===
 +
Supplies are purchased and plans are made for the day.<br/>
 +
A recipe may be chosen if more than one is available.
 +
 +
===Day===
 +
Customers queue at the stand and buy lemonade.<br/>
 +
 +
===Evening===
 +
Profit is calculated by the player and 'put away'.<br/>
 +
 +
===Midnight===
 +
The day's activities are put together into a digest, including:
 +
* Weather forecast for the next few days
 +
* Special events that happened during the day
 +
* Current discounts on supplies
 +
* Any supplies which have perished will be listed
 +
 +
Once the digest has been displayed, the game returns to morning again.
 +
 +
==Difficulty Settings==
 +
===Easy===
 +
*Supplies will not perish
 +
*Prices are fixed at multiples of 25 and products yield more money per sale.
 +
*Subtotals are listed for all math problems
 +
*Math-based screens will not close while there are problems (trying to buy too many supplies, not collecting correct change)
 +
 +
===Normal===
 +
*Supplies will not perish
 +
*Prices are more complex multiples of 5 with slightly smaller profit margins
 +
*Subtotals are listed for all math problems
 +
*Math-based screens will not close while there are problems (trying to buy too many supplies, not collecting correct change)
 +
 +
===Hard===
 +
*Supplies will perish
 +
*Prices are the same as Normal
 +
*Subtotals are listed for all math problems
 +
*Math-based screens will allow you to give bad answers (buy too many supplies, not collecting correct change)
 +
 +
===Impossible===
 +
*Supplies will perish
 +
*Prices are not multiples of 5
 +
*Subtotals are not listed for math problems
 +
*Math-based screens will allow you to give bad answers (buy too many supplies, not collecting correct change)
    
==Goals==
 
==Goals==
Line 22: Line 77:     
=====Completed=====
 
=====Completed=====
- Creating a GUI based game<br />
+
* Creating a GUI based game
- Incorporating counting of money (bills and coins) to make change<br />
+
* Incorporating counting of money (bills and coins) to make change
- Cool Random Events:
+
* Cool [[Lemonade Stand/Events|Random Events]]:
Ants steal your supplies
+
* Weather patterns impacting sales
    -10% sugar
+
* Making materials perishable to increase difficulty
A lemon truck crashes in front of your stand
+
* Making the program more intuitive so that it can be easily learned<br />
    +10 lemons
      
=====In progress=====
 
=====In progress=====
- Creating seasons to vary prices and product demand<br />
+
* Implementing multiple difficulties
- Weather patterns impacting sales<br />
+
* Redesign UI
- Making materials perishable to increase difficulty<br />
+
* Advanced mode: changing the recipe for your "lemonade"<br />
- Making the program more intuitive so that it can be easily learned<br />
+
** Strawberry Lemonade
 +
** (Implemented but not purchaseable or usable)
    
=====Wishlist=====
 
=====Wishlist=====
- Advanced mode: changing the recipe for your "lemonade"<br />
+
* Creating seasons to vary prices and product demand<br />
- Implementing Bargaining / Haggling<br />
+
* Random events that may influence supplies and/or cost and/or customers<br />
- Random events that may influence supplies and/or cost and/or customers<br />
+
* "Tools" to buy to increase efficiency
- Potential use of network, competitive, or cooperative modes<br />
+
** Juicer reduces lemon requirement of recipies by 1/2
- Choosing location of Lemonade Stand within the town, would influence sales, cost of supplies, etc.<br />
+
* Hidden values 'advertising' and 'loyalty'
 
+
** Upgrading the stand / buying more recipies increases advertising (does not decrease)
==Potential Problems==
+
** Prices close to customer's expectations / satisfying demand increases loyalty (decreases over time)
Localization is likely to be a big problem in this game.  Not simply translating the words, but also translating the idea, ie. finding out what kind of shop would be reasonable to open in a country, what it might stock, etc.
+
** Both could act as a multiplier to customer demand. (base demand x advertising x loyalty = actual demand)
 +
* Implementing Bargaining / Haggling<br />
 +
* Potential use of network, competitive, or cooperative modes<br />
 +
* Choosing location of Lemonade Stand within the town, would influence sales, cost of supplies, etc.<br />
 +
* Perhaps showing currency the player has letting them find total profit
   −
This becomes even more difficult when moving to a graphical environment.  For every localized region we will need a different set of graphics depending on what the stand is selling.
+
==Helping Out==
 +
One of the things we always need are new [[Lemonade Stand/Events|random events]] to make the game more interesting.<br/>
 +
Another thing which is always useful is submitting new [[Lemonade Stand/Art|artwork]].<br/>
   −
==Updates and Milestones==
+
==Fall 2010 Milestones==
 +
* Week 3:
 +
** Get JT's sketches into image files
 +
** come up with more events and weather ideas
 +
** add recipes
   −
===Updates:===
+
* Week 4:
 +
** new background image
 +
** get into constants.py
 +
** define what difficulties entail, implement lowest difficulty
 +
** nail down ideas about overlays, startup screen
   −
4/28: Wiki reorganized, content added
+
* Week 5:
12/03: 1.1 release imminent
+
** implement two difficulties, simple and insane
 +
** Get counting game images
 +
** implement basic splash screen
   −
===Milestones:===
+
* Week 6:
 +
** Get store images
 +
** implement counting game
   −
4/24: Have everyone look at the current implementations.
+
* Week 7:
 +
** Get activity log images
 +
** Implement store
   −
5/1: produce a basic 'sugarized' build to work from.  Implement price fluctuations.
+
* Week 8:
 +
** Implement activity log
 +
** Get images for other parts of the game (events, weather, etc.)
   −
5/8: Move to a 'graphical interface' based off of pyGTK or pygameAdd any art we have managed to collect where it seems appropriate.
+
==Potential Problems==
 +
Localization is likely to be a big problem in this gameNot simply translating the words, but also translating the idea, ie. finding out what kind of shop would be reasonable to open in a country, what it might stock, etc.
   −
5/15: Finishing code sugarization
+
This becomes even more difficult when moving to a graphical environmentFor every localized region we will need a different set of graphics depending on what the stand is selling.
 
  −
==Design Decisions==
  −
Is lemonade made at the beginning of the day (make all available lemonade at once) or on the fly (a customer asks for lemonade and it is made for them)?  This is important as it impacts the resources from day to dayIn the former, normally non-perishable objects like cups will be used if they can make another drink (even beyond demand), however in the latter, it makes the game easy if you stock up on resources and slowly sell them each day.  This is usually mitigated by having perishable resources (lemons, etc) and variable prices.
      
==Educational Standards==
 
==Educational Standards==
Line 80: Line 155:     
==Contacts==
 
==Contacts==
 +
=== Current ===
 
*[[User:Qalthos|Nathaniel Case]]
 
*[[User:Qalthos|Nathaniel Case]]
 +
*[[User:Jlew| Justin Lewis]]
 +
*[[User:Sarah Wagner|Sarah Wagner]]
 +
*[[User:JT Mengel|JT Mengel]]
 +
 +
=== Historical ===
 
*[[User:Mdd8919 | Mitchell DeMarco]]
 
*[[User:Mdd8919 | Mitchell DeMarco]]
 
*[[User:Epsilon748 | Anthony King]]
 
*[[User:Epsilon748 | Anthony King]]
Line 87: Line 168:  
*[[User:Sss1406 | Steven Schoenfeld]]
 
*[[User:Sss1406 | Steven Schoenfeld]]
   −
==Links and Resources==
+
==Getting the Latest Snapshot from Git==
Coming soon!
+
Lemonade Stand is available either under the [http://dbad-license.org/ DBAD License] or the GPLv3+
   −
==Code so far==
+
To get the latest working version from Git, open a terminal and enter these commands:
<pre>
  −
#!/usr/env python
  −
# -*- coding: cp1252 -*-
  −
import random
  −
from counting import play_Money
      +
git clone git://gitorious.org/lemonade-stand-olpc/lemonade-stand.git<br/>
 +
cd lemonade-stand<br/>
 +
git clone git://git.fedorahosted.org/FortuneEngine.git fortuneengine<br/>
    +
mv fortuneengine/fortuneengine/* ./fortuneengine/<br/>
   −
#Generisize the names of supplys to make it easily editable
+
If you don't have pygame, then download and install it from [http://pygame.org pygame].
#[0] = name of the stand, [1] = first supply, [2] = second supply, [3] = third supply, [4] = the object that is being sold
  −
variables = ['Lemonade Stand','cups','lemons','sugar','cups']
     −
print 'Welcome to ' + variables[0]
+
The game can then be run by executing 'python LemonadeStand.py'
   −
#Random weather event, if its a hot day all stock will sell,  
+
==Game Play==
# if its a normal day, 90% will sell, and if its a raining day 80% will sell
+
After entering the command to run the game the following specials keys are used to actually play:
 +
*'''<ENTER>''':
 +
**From the Welcome Screen - Enters the game.
 +
**From the Main Screen - Enter the store.
 +
**From the Store Screen - Complete transaction, Leave store.
 +
**From Daily Log - Submits values entered.
 +
*'''Arrow Keys''':
 +
**From the Store Screen - Left and right arrows select a product.
 +
**From Daily Log - Up and down arrows select a monetary value (dollars, quarters, etc).
 +
*'''Number Keys''': From the Store Screen - Used to enter the desired quantity of the selected product.
 +
**From Daily Log - Used to enter the number of dollars, quarters, etc. which make up your profit.
 +
*'''<h>''': From any screen - Causes a help message to appear or disappear.
 +
*'''<ESC>''': From any screen - Exits the game.
   −
def weather_Change( ):
  −
    global weather
  −
    weather = random.randint( -1, 1 )
  −
   
  −
    if weather == -1:
  −
        print "It looks like its going to rain tomorrow"
  −
    elif weather == 0:
  −
        print "Its a normal day tomorrow"
  −
    elif weather == 1:
  −
        print "Tomorrow looks to be very hot"
     −
#Format the input text, and make it return a 0 if input is incorrect
+
To access the different difficulty levels use the following commands to run LemonadeStand.py:
def take_input(text, default = 0):
+
*'''Easy''': python LemonadeStand.py -d 0
    try:
+
*'''Normal''': python LemonadeStand.py -d 1
        in_text = input(text+" ["+`default`+"]: ")
+
*'''Hard''': python LemonadeStand.py -d 2
    except:
+
*'''Impossible''': python LemonadeStand.py -d 3
        return default
  −
    if in_text < 0:
  −
        in_text = 0
  −
   
  −
    return in_text
     −
#Declare a random event, More events can be added easily by building a new case statment
+
==Links and Resources==
def random_Event():
+
* [http://activities.sugarlabs.org/en-US/sugar/addon/4321/ Activity Page]
    global stored_sugar, stored_lemons, stored_cups
+
* [http://gitorious.org/lemonade-stand-olpc Git Repository]
    event = random.randint(0, 10) 
+
* [https://fedorahosted.org/fossrit/wiki/LemonadeStand Project Trac]
   
  −
    if event == 0:
  −
       
  −
        if stored_sugar > 10:
  −
            stored_sugar -= 10
  −
            print 'Ants steal your supplies!'
  −
        else:
  −
            stored_sugar = 0
  −
           
  −
    elif event == 1:
  −
 
  −
        print 'A lemon truck crashes in front of your stand!'
  −
        stored_lemons += 10
  −
       
  −
    elif event == 2:
  −
 
  −
        print 'It starts raining cups!'
  −
        stored_cups += 10
  −
 
  −
    print ""
  −
 
  −
 
  −
#Decreases currently the supply's by 10% each day
  −
def supply_Decay():
  −
    global stored_sugar, stored_lemons, stored_cups
  −
    if stored_sugar > 0:
  −
        stored_sugar -= 10 % stored_sugar
  −
    if stored_lemons > 0:
  −
        stored_lemons -= 10 % stored_lemons
  −
    if stored_cups > 0:
  −
        stored_cups -= 10% stored_cups
  −
 
  −
    return -1
  −
   
  −
# default values
  −
cup_price = .25
  −
lemon_price = 1.00
  −
sugar_price = .05
  −
weather = 0
  −
product_price = 1.50
  −
 
  −
#starting resources
  −
bank = 100
  −
 
  −
stored_cups = 0
  −
stored_lemons = 0
  −
stored_sugar = 0
  −
 
  −
# take in input
  −
num_days = take_input("How many days would you like to play for?", 30)
  −
 
  −
for day in range(1, num_days + 1):
  −
 
  −
   
  −
 
  −
 
  −
    print ""
  −
    print "____________________"
  −
    print "    Day number " + `day`
  −
    print "¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯"
  −
    print ""
  −
 
  −
    random_Event()
  −
 
  −
 
  −
    print "You have "+`stored_cups`+ " " + variables[1] + ", " +`stored_lemons`+ " " + variables[2] + ", and "+`stored_sugar`+ " " + variables[3] + " left."
  −
 
  −
    print variables[1] + " price: $" + `cup_price` + "    " +  variables[2] + " price: $"+ "%.2f" % lemon_price + "    " + variables[3] + " price: $"+ "%.2f" % sugar_price
  −
 
  −
    expenses = 0
  −
 
  −
    cost_over = 1
  −
 
  −
 
  −
    #Checks to make sure you dont go over your bank amount while buying.
  −
 
  −
    while cost_over == 1:
  −
 
  −
        potential_expense = 0
  −
        in_num = take_input("How many " + variables[1])
  −
        potential_expense = expenses + (in_num * cup_price)
  −
 
  −
        if potential_expense < bank:
  −
            cost_over = -1
  −
            expenses += in_num * cup_price
  −
            stored_cups += in_num
  −
        else:
  −
            print 'You cant afford that many ' + variables[1]
  −
 
  −
    cost_over = 1
  −
 
  −
    while cost_over == 1:
  −
 
  −
        potential_expense = 0
  −
        in_num = take_input("How many " + variables[2])
  −
        potential_expense = expenses + (in_num * cup_price)
  −
 
  −
        if potential_expense < bank:
  −
            cost_over = -1
  −
            expenses += in_num * lemon_price
  −
            stored_lemons += in_num
  −
        else:
  −
            print 'You cant afford that many ' + variables[2]
  −
 
  −
    cost_over = 1
  −
 
  −
    while cost_over == 1:
  −
 
  −
      potential_expense = 0
  −
      in_num = take_input("How much " + variables[3])
  −
      potential_expense = expenses + (in_num * cup_price)
  −
 
  −
      if potential_expense < bank:
  −
          cost_over = -1
  −
          expenses += in_num * sugar_price
  −
          stored_sugar += in_num
  −
 
  −
      else:
  −
          print 'You can not afford that many ' + variables[3]
  −
 
  −
 
  −
 
  −
    # Find the lowest amount of supplys, and make that many of lemonade that day
  −
    sales = max(min(stored_cups, stored_lemons, stored_sugar),0)
  −
 
  −
    # Option 2: make as many as requested
  −
    stored_cups -= sales
  −
    stored_lemons -= sales
  −
    stored_sugar -= sales
  −
   
  −
    if weather == 0:
  −
        sales -= 10 % sales
  −
    elif weather == -1:
  −
        sales -= 20 % sales
  −
 
  −
 
  −
   
  −
    print `sales`+ ' ' + variables[4]+ " made for $"+ "%.2f" % expenses
  −
 
  −
    profit = sales * product_price
  −
    print `sales`+ " " + variables[4] +" were sold today for $"+ "%.2f" % profit
  −
   
  −
    print "You made $"+ "%.2f" % (profit - expenses)+" today."
  −
   
  −
   
  −
    if (profit - expenses) <= 0:
  −
   
  −
        print "You lost money today"
  −
       
  −
    else:   
  −
   
  −
        #If you didnt lose money that day, play the small money game to put away your change
  −
        #If you put away change right, you get to keep the profit, otherwise you lose it
  −
 
  −
        print "You go to put profits away"
  −
                 
  −
        if play_Money( int(profit - expenses) ) == 1:
  −
            print "you put the money away correctly"
  −
            bank += profit - expenses
  −
        else:
  −
            print "You lost the money when putting it away"
  −
   
  −
   
  −
    print "Current funds: $"+ "%.2f" % bank
  −
   
  −
    #Decrease the supply's by 10%
  −
    #Warn for the next days weather
  −
 
  −
    supply_Decay()
  −
    weather_Change()
  −
   
  −
   
  −
    print
  −
   
  −
print "Done!"
  −
 
  −
 
  −
</pre>
  −
 
  −
Counting code
  −
 
  −
<pre>
  −
 
  −
 
  −
dollar = 1
  −
quarter = .25
  −
dime = .10
  −
nickel = .05
  −
penny = .01
  −
 
  −
 
  −
 
  −
def take_input(text, default = 0):
  −
    try:
  −
        in_text = input(text+" ["+`default`+"]: ")
  −
    except:
  −
        return default
  −
    if in_text < 0:
  −
        in_text = 0
  −
   
  −
    return in_text
  −
 
  −
 
  −
def play_Money( money_Find ):
  −
  −
    global quarter, dime, nickel, penny
  −
   
  −
    total = 0
  −
   
  −
    #Takes the amount of money
  −
    total += dollar*take_input( "How many dollars? ")
  −
 
  −
   
  −
    total += quarter*take_input( "How many quarters? ")
  −
 
  −
    total += dime*take_input( "How many dimes? ")
  −
 
  −
    total += nickel*take_input( "How many nickels? ")
  −
 
  −
    total += penny*take_input( "How many pennies? ")
  −
           
  −
    if total == money_Find:
  −
        return 1
  −
           
  −
    else:
  −
        return -1
  −
       
  −
 
  −
</pre>
 
5

edits

Navigation menu