Browse Source

bunch of fixes based on feedback, adding changelog

galo 1 year ago
parent
commit
b32743ac8e
3 changed files with 8 additions and 15 deletions
  1. 1 1
      Server.gd
  2. 6 14
      enemyadder.gd
  3. 1 0
      main.tscn

+ 1 - 1
Server.gd

@@ -149,7 +149,7 @@ func _physics_process(delta):
 	if fmod(tick,tickrate) == 0:
 		synnc(get_tree().get_nodes_in_group('enemy'), 'enemies_position_2')
 	
-	if get_tree().get_nodes_in_group('player').size() == 0:
+	if get_tree().get_nodes_in_group('player').size() == 0 and game_status != 'await':
 		print('everyone is dead')
 		game_status = 'await'
 		conn(0)

+ 6 - 14
enemyadder.gd

@@ -1,23 +1,15 @@
 extends Position2D
 
-
-# Declare member variables here. Examples:
-# var a = 2
-# var b = "text"
-
-
 var loader = load('res://npc.tscn')
-func _ready():
-	while true:
+var buffer = 300
+func _physics_process(delta):
+	buffer -= 1
+	if buffer == 0:
+		buffer = 300
 		if get_child_count() < 5:
 			print('add enemy')
 			var instancer = loader.instance()
 			instancer.global_position = global_position
 			add_child(instancer)
-		yield(get_tree().create_timer(5.0),"timeout")
-	pass # Replace with function body.
-
 
-# Called every frame. 'delta' is the elapsed time since the previous frame.
-#func _process(delta):
-#	pass
+	pass # Replace with function body.

+ 1 - 0
main.tscn

@@ -227,6 +227,7 @@ render_target_v_flip = true
 [node name="Goblin" type="AnimatedSprite" parent="Textures/Goblin4"]
 modulate = Color( 1, 0, 0.984314, 1 )
 frames = SubResource( 5 )
+frame = 1
 speed_scale = 0.9
 playing = true
 offset = Vector2( 32, 32 )