boutton de menu dans les jeux #38

Merged
raphael merged 2 commits from menu-button into main 2024-01-07 21:30:41 +00:00
Showing only changes of commit cb8b544560 - Show all commits

View file

@ -8,6 +8,8 @@ from engine.ecs import Entity, World
from engine.math import Vec2
from plugins import render
from plugins import physics
from plugins.click import Clickable
from plugins.hover import HoveredTexture
from plugins.inputs import Held
from plugins.render import (
Origin,
@ -340,6 +342,24 @@ def __spawn_bonus(world: World):
),
bonus,
)
world.new_entity().set(
SpriteBundle(
f"button_menu_icon.png",
1,
Vec2(40, 40),
Vec2(50, 50),
Vec2(0.5),
),
HoveredTexture(
f"button_menu_icon.png",
f"button_menu_icon_hover.png",
),
Clickable(__go_to_menu),
)
def __go_to_menu(world: World, _e: Entity):
world[CurrentScene] = menu.MENU
def __spawn_ball(world: World):