Skip to content

Commit

Permalink
Move shader material loading to world
Browse files Browse the repository at this point in the history
  • Loading branch information
konsumlamm committed Apr 16, 2024
1 parent a5add4c commit 5833270
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/scripts/title-screen.gd
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
extends Control

func _ready() -> void:
# preload shader materials
ResourceLoader.load_threaded_request("res://shaders/hit-indicator.tres")
ResourceLoader.load_threaded_request("res://shaders/hp-bar.tres")
ResourceLoader.load_threaded_request("res://shaders/pentagram.tres")
ResourceLoader.load_threaded_request("res://shaders/shield.tres")

func on_start_game_button_pressed() -> void:
get_tree().change_scene_to_file('res://scenes/world.tscn')

Expand Down
6 changes: 6 additions & 0 deletions src/scripts/world.gd
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ func load_room(scene: PackedScene):
$Player.position = room.find_child("PlayerMarker").position

func _ready():
# preload shader materials
ResourceLoader.load_threaded_request("res://shaders/hit-indicator.tres")
ResourceLoader.load_threaded_request("res://shaders/hp-bar.tres")
ResourceLoader.load_threaded_request("res://shaders/pentagram.tres")
ResourceLoader.load_threaded_request("res://shaders/shield.tres")

var common := []
var rare := []
var ultra := []
Expand Down

0 comments on commit 5833270

Please sign in to comment.