Beispiel #1
0
  def GameSurface(self):
    return self.engDisplay.Surface

  @property
  def image(self):
    """
      These are used by pygame and are necessary in order for the parent object (DirtySprite)
    """
    return self.Surface

if __name__ == "__main__":
  
  from src.controllers.frogcontroller import FrogController
  from src.core.validationframework   import ValidationFramework
  
  Validation = ValidationFramework()

  # Draw entities ... do stuff that needs to be rendered to the Main Display
  entCar = CarEntity([0, 0])
  carControl = FrogController(entCar)
  entCar.setController(carControl)
  entCar.setGameScreen(Validation.Surface) 

  Validation.addToRunQueue(entCar.update)
  
  while Validation.running == True:
    for event in Validation.getEvents():
      Validation.run()
      entCar.respond(event)    

  Validation.quit()
Beispiel #2
0
  @property
  def GameSurface(self):
    return self.surfGameDisplay

  @property
  def Controller(self):
    return self.myController


if __name__ == "__main__":
  
  from src.core.validationframework         import ValidationFramework  
  from src.entities.entityfactory               import EntityFactory
  
  Validation = ValidationFramework()
  
  # Create a new EntityFactory
  
  defaultEntityFactory = EntityFactory(Validation.engDisplay)

  # Draw entities ... do stuff that needs to be rendered to the Main Display
  
  # Create Static Entities (i.e. visual aspects of the Game Screen)

  listStaticBackgroundEntities = defaultEntityFactory.buildBackground()
    
  # Create Controlled Entities (i.e. those Entities that will be controllable via User Input)
    
  entFrog = defaultEntityFactory.buildFrog()
  entFrog.draw()