[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] GSoC project proposal: Pygame on rails



I plan to make my framework much simpler by restricting the game developer's options

Thadeus Burgess wrote:
I have actually attempted to perform this same thing. My project went
on a standstill as other things were pressing, however I am interested
in reopening my project back up.

I am calling it PyBTS (pygame behind the scenes). It includes a world
manager, terrain, physics based on the "genre". You can take the same
codebase, and change the type of Terrain class, and you get a tilemap
or sidescroller respectively.

I would definitely love to revive the project, my goals for it are
fairly similar, to provide all of the game engine boiler plate code
that goes into making a game.

http://hg.thadeusb.com/Games/PyBTS/
http://hg.thadeusb.com/Games/MyRTS/ # Uses pybts

-Thadeus
I plan to make my framework much simpler by restricting the game developer's options to hide complexity. Here's an idea of the type of code a developer using my framework would write to create a simple platformer with a single level:

from insta.menu import *
from insta.platformer import *

def startMenu():

   titleScreen = Screen(600, 400)
   titleScreen.setTheme(themes.MEDIEVAL)
   titleScreen.setTitle("Porcupine's Tiny Adventure")
   titleScreen.setOptions(["Play", "Controls", "Credits"])
   titleScreen.getOption("Play").setAction(startGame)
   # More code for other menu options

def startGame():

   game = Game()
hero = Player()
   hero.setSprite("standing.gif")
   hero.setRunningSprites(["running1.gif", "running2.gif", "running3.gif"])
   hero.setJumpSprite("jumping.gif")
   hero.setDeathSprite("gravestone.gif")
hero.setMovementTriggers(constants.ARROW_KEYS)
   hero.setJumpTrigger(constants.SPACE_BAR)
goal = Item()
   goal.setSprite("bigring.gif")
   goal.setBehavior(constants.FLOATING)
   goal.setAction(game.nextLevel)
itemGenerator = ItemGenerator([None, goal, hero]) ''' Tile generator translates level maps (text files full of numbers) into tile
   maps in a context-sensitive manner
   '''
   tileGenerator = TileGenerator()
   tileGenerator.setFloorSprite("levelground.gif")
   tileGenerator.setUndergroundSprite("underground.gif")
   tileGenerator.setPlatformSprite("platform.gif")
   # Edge and corner sprites could also be set
mushroom = Enemy()
   mushroom.setRunningSprites(["step1.gif", "step2.gif"])
   mushroom.setDeathSprite("explosion.gif")
   # Some simple behaviors would be pre-defined
   mushroom.setBehavior(constants.WALKING)
bird = Enemy()
   bird.setFlightSprites(["flap1.gif", "flap2.gif"])
   bird.setDeathSprite("feathers.gif")
   bird.setBehavior(constants.FLYING)
# List associates enemy types with numbers in the text file
   enemyGenerator = EnemyGenerator([None, mushroom, bird])
level = Level()
   level.setTileMap(tileGenerator.generateTileMap("levelmap1.txt"))
   level.setEnemyMap(enemyGenerator.generateEnemyMap("enemymap1.txt"))
   level.setItemMap(itemGenerator.generateItemMap("itemmap1.txt"))
   level.setBackground("background.gif")
   level.setBackgroundOptions([constants.TILED, constants.PARALLAX])
game.setLevels([level])
   game.start()

if (__name__ == "__main__"):

   startMenu()

I don't want to make developers worry about individual frames, bounding boxes, or damage calculations. They should only think about what's on screen and how it moves and interacts. I want to create a framework that lets developers think about their games on the same level as the LittleBigPlanet level creator at the expense of total freedom and granularity.

--
|Evan Kroske
Welcome2Obscurity.Blogspot.com <http://welcome2obscurity.blogspot.com>
The personal blog of a
novice software developer. |