boutton de menu dans les jeux

This commit is contained in:
Raphaël 2024-01-07 22:29:16 +01:00
parent 0a26566038
commit cb8b544560

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):