def intro(): text_blink = 0.0 angle = 0 fps = camera.fps_controller(0, 2, -10) fps.update(clock.update()) render.set_camera3d(fps.pos.x, fps.pos.y, fps.pos.z, fps.rot.x, fps.rot.y, fps.rot.z) while not input.key_press(gs.InputDevice.KeyEnter): render.clear(gs.Color.White) text_blink += clock.update() if text_blink > 1.0: text_blink = 0.0 # Effet de background animé à la "Street Fighter" (hem) dessine_fond_qui_scroll() for z in range(-100, 100, 5): for x in range(-100, 100, 5): render.geometry3d(x, 0, z, cube) afficheTexte(500, 400, 'Quel est ton gourou ?', size=2) afficheTexte(500, 365, 'Choisis le sens de ta vie ~~~~~~~~~~~~~~') afficheTexte(500, 325, '...et appuie sur [enter]', text_blink) afficheTexte(815,20, 'Made by Trofis #CODE and Safae #DESIGN' , size=0.5) render.flip() angle += 0.01 while input.key_press(gs.InputDevice.KeyEnter): render.clear() render.flip()
def raz_camera(cls): #cls.camera.GetTransform().SetPosition(cls.camera_start_pos_mem) cls.fps = camera.fps_controller(cls.camera_start_pos_mem.x, cls.camera_start_pos_mem.y, cls.camera_start_pos_mem.z)
from node_input_to_output.node_input_sensors_previous_behaviours import NodeInputs from node_input_to_output.action_4_move_right_left_wheel import Actions from node_input_to_output.decision_maker import DecisionMaker # import and init OOKPY import gs import gs.plus.clock as clock import gs.plus.input as input import gs.plus.render as render import gs.plus.camera as camera gs.LoadPlugins(gs.get_default_plugins_path()) render.init(640, 480, "pkg.core") fps = camera.fps_controller(0, 15, 0) array_perso = [] # init perso for i in range(5): perso_inputs = NodeInputs() perso_actions = Actions() perso_decision_maker = DecisionMaker() perso = Node(perso_actions, perso_inputs, perso_decision_maker) array_perso.append(perso) physic_world = PhysicWorld(gs.Vector2(640, 480)) #input handling (somewhat boilerplate code): def play_simulation():
def raz_camera(cls): #cls.camera.GetTransform().SetPosition(cls.camera_start_pos_mem) cls.fps=camera.fps_controller(cls.camera_start_pos_mem.x,cls.camera_start_pos_mem.y+300,cls.camera_start_pos_mem.z)