-
Notifications
You must be signed in to change notification settings - Fork 0
/
GameManager.gd
34 lines (19 loc) · 751 Bytes
/
GameManager.gd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
extends Node
### PRELOAD RESOURCES
var FoodRes = preload("res://Food/GlowingFood.tscn")
var SegmentRes = preload("res://Worms/Segment.tscn")
var WormRes = preload("res://Worms/Worm.tscn")
var current_points : int = 20
var game_running : bool = false
var segment_fine_tuning : bool = false
var current_fine_tuning_segment : int = 0
var own_worm : WW_Worm
var Game : wriggly_worms
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
randomize() # important so that all random functions give different values on each startup.
# set Game varibale
Game = get_tree().root.get_node("Game")
func _process(delta: float) -> void:
if is_instance_valid(own_worm):
current_points = own_worm.worm_points