コード例 #1
0
ファイル: physics_manager.py プロジェクト: EliasFarhan/GBJam
    else:
        raise TypeError("pixel2meter takes Vector2, numbers or tuple2")

    return None


def meter2pixel(meter):
    if isinstance(meter, Vector2) or isinstance(meter, Number):
        return meter*CONST.ratio
    elif isinstance(meter, tuple) or isinstance(meter, list):
        return meter[0]*CONST.ratio,meter[1]*CONST.ratio
    else:
        raise TypeError("pixel2meter takes Vector2, numbers or tuple2")
    return None

BodyType = enum("static", "dynamic","kinematic")
MoveType = enum("direct_set","force","impulse")

class PhysicsManager():
    def __init__(self):
        self.worlds = []
        self.current_world = None
    def init_world(self):
        pass

    def remove_world(self,world):
        pass

    @staticmethod
    def add_body(self,pos):
        pass
コード例 #2
0
ファイル: menustate.py プロジェクト: EliasFarhan/GBJam
'''
Created on 11 janv. 2014

@author: efarhan
'''
from engine.const import enum
from levels.scene import Scene

State = enum('MAIN', 'OPTIONS', 'GRAPHICS', 'SOUNDS', 'KEYS')


class MenuState(Scene):
    def __init__(self):
        Scene.__init__(self)
        self.state = None

    def init(self):
        Scene.init(self)
        self.state = State.MAIN

    def loop(self, screen):
        Scene.loop(self, screen)


    def exit(self, screen):
        Scene.exit(self, screen)