This commit is contained in:
2026-05-02 21:12:32 +01:00
parent 8ef525c8f5
commit 02efbce8f0
3 changed files with 7 additions and 6 deletions
+3 -3
View File
@@ -15,9 +15,9 @@ rect.on_click do
0xFF0000
end
main_scene.add_element text
main_scene.add_element rect
main_scene << text
main_scene << rect
window.add_scene :main_scene, main_scene
window.scenes[:main_scene] = main_scene
window.start :main_scene
+4 -3
View File
@@ -25,7 +25,7 @@ start_button.on_click do
window.start :game_scene
end
menu_scene.add_element start_button
menu_scene << start_button
game_scene = Scene.new
@@ -96,6 +96,7 @@ end
# match is set to list of all capturing queries
# for components returns an object that responds to .each with every ceomponents values
# for entities it does similarly
# mouse state can be read in systems always
query = tag(:enemy) & component(:health, true) & anti(name("Trap Preview", true))
# in the match name will return just the one entity
@@ -182,7 +183,7 @@ world.shader :fog do |shader|
z = 100 # shaders always appear above normal sprites but z is used to sort them relative to each other, so a shader with z 100 will appear above a shader with z 50, but both will appear above normal sprites
end
window.add_scene :menu_scene, menu_scene
window.add_scene :game_scene, game_scene
window.scenes[:menu_scene] = menu_scene
window.scenes[:game_scene] = game_scene
window.start :menu_scene # first scene to show when the game starts, stops the loading bg
View File