Ejemplo n.º 1
0
except:
    # Target system is an xo, so we may not have the module
    # installed, so we want to load the one in our folder
    print "Using fortune engine from path"
    import sys
    sys.path.append( 'fortuneengine' )
    from fortuneengine.GameEngine import GameEngine

from MafhGameMenu import GameMenuHolder
from constants import MENU_PATH, FMC_PATH, TOUR_PATH

from Comic import Comic
from Profile import Profile
from MafhGameManager import MafhGameManager

ge = GameEngine(width=1200, height=900, always_draw=True, fps_cap=24,
                version=True, title="Mathematical Adventure: Fortune Hunter")

def start_game():
    ge.add_object('manager', MafhGameManager() )

def menu_screen():
    ge.add_object('menu', GameMenuHolder( menu_called, MENU_PATH + "mafh_splash.gif", width=ge.width, height=ge.height))
    ge.get_object('menu').show_menu('title')

def menu_called(id, menu):
    if id == 'new':
        #ge.get_object('menu').remove_from_engine()
        menu.remove_from_engine()
        ge.remove_object('menu')

        if not ge.has_object('profile'):
Ejemplo n.º 2
0
#       but WITHOUT ANY WARRANTY; without even the implied warranty of
#       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#       GNU General Public License for more details.
#
#       You should have received a copy of the GNU General Public License
#       along with this program; if not, write to the Free Software
#       Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
#       MA 02110-1301, USA.

from fortuneengine.GameEngine import GameEngine
from PPGameManager import PPGameManager
from PPMainMenu import MainMenuHolder
from PPGame import PPGame
from Constants import IMAGE_PATH

ge = GameEngine(width=952, height=714, always_draw=False)


def start_game():
    ge.add_object('manager', PPGameManager())


def menu_screen():
    ge.add_object(
        'menu',
        MainMenuHolder(menu_called,
                       IMAGE_PATH + "bg.gif",
                       width=ge.width,
                       height=ge.height))
    ge.get_object('menu').show_menu('title')
Ejemplo n.º 3
0
                  "--height",
                  dest="height",
                  help="window height",
                  metavar="HEIGHT",
                  default=480,
                  type="int")

parser.add_option("-f",
                  "--font",
                  dest="font",
                  help="font size",
                  metavar="SIZE",
                  default=20,
                  type="int")

parser.add_option("-d",
                  "--difficulty",
                  dest="difficulty",
                  help="difficulty level",
                  metavar="DIFFICULTY",
                  default=0,
                  type="int")

(opts, args) = parser.parse_args()

ge = GameEngine(width=opts.width, height=opts.height, always_draw=False)
ge.add_object('font', font.SysFont(font.get_default_font(), opts.font))
ge.add_object('main', LemonadeMain(opts.difficulty))
ge.add_object('gui', LemonadeGui())
ge.start_main_loop()
Ejemplo n.º 4
0
#!/usr/bin/env python

from fortuneengine.GameEngine import GameEngine
from LemonadeMain import LemonadeMain
from LemonadeGui import LemonadeGui
from optparse import OptionParser

from pygame import font
parser = OptionParser()

parser.add_option("", "--width", dest="width", help="window width",
                  metavar="WIDTH", default=640, type="int")

parser.add_option("", "--height", dest="height", help="window height",
                  metavar="HEIGHT", default=480, type="int")

parser.add_option("-f", "--font", dest="font", help="font size",
                  metavar="SIZE", default=20, type="int")

parser.add_option("-d", "--difficulty", dest="difficulty", help="difficulty level",
                  metavar="DIFFICULTY", default=0, type="int")

(opts, args) = parser.parse_args()

ge = GameEngine(width=opts.width, height=opts.height, always_draw=False)
ge.add_object('font', font.SysFont(font.get_default_font(), opts.font))
ge.add_object('main', LemonadeMain(opts.difficulty) )
ge.add_object('gui', LemonadeGui() )
ge.start_main_loop()