Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A library for Python/PyGame that imitates features from Fenix.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 examples
Octocat-spinner-32 fenix
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.md
README.md

Pygame-Fenix (By Fiona Burrows)

Requirements:

  • Python 2.5
  • PyGame 1.8

Description

pygame-fenix is a library for Python that allows one to write games with Pygame, but using concepts such as processes and frames inspired by Fenix.

It uses an actor based model for game objects, automatically handling rendering in the game world. All the developer has to do is tell it where things need to go.

Generators are used to simulate a frame system. Rather than a monolithic game loop for your objects, you can have your object stop at a specific point in it's code and continue on in the next frame.

It also includes helpful routines such as getting the distances between two processes, collision detection and easy input routines.

Example

This example will display a character on screen. The player use the cursor keys to rotate the character and move him backwards/forwards (like a car).

For more examples check the "examples" directory.

import pygame       

from fenix.program import Program
from fenix.process import Process

class Game(Process):

  def begin(self):
    Program.set_mode((800,600))
    Program.set_fps(60)
    My_guy()


class My_guy(Process):

  def begin(self):
    self.graph = Program.load_png("my_guy.png")
    self.x, self.y = 400, 300

    while True:

      if(Program.key(K_LEFT)):
        self.angle -= 5000
      if(Program.key(K_RIGHT)):
        self.angle += 5000
      if(Program.key(K_UP)):
        self.advance(2)
      if(Program.key(K_DOWN)):
        self.advance(-1)

      yield        


Game()
Something went wrong with that request. Please try again.