Browse Source

bunch of fixes based on feedback, adding changelog

galo 1 year ago
parent
commit
a0ec37ea9b
5 changed files with 30 additions and 14 deletions
  1. 4 4
      Client.tscn
  2. 1 1
      Server.gd
  3. 8 2
      enemie/newai.gd
  4. 14 2
      enemie/tankboss.tscn
  5. 3 5
      main.tscn

+ 4 - 4
Client.tscn

@@ -117,10 +117,10 @@ anchor_right = 1.0
 anchor_bottom = 1.0
 
 [node name="VBoxContainer" type="VBoxContainer" parent="spawnmsg/CenterContainer"]
-margin_left = 238.0
-margin_top = 164.0
-margin_right = 402.0
-margin_bottom = 196.0
+margin_left = 236.0
+margin_top = 166.0
+margin_right = 404.0
+margin_bottom = 194.0
 
 [node name="spawnmsg" type="Label" parent="spawnmsg/CenterContainer/VBoxContainer"]
 margin_right = 164.0

+ 1 - 1
Server.gd

@@ -85,7 +85,7 @@ func player_spawn(arg, arg2):
 	send_list_of_usernames(arg2, username)
 	rpc_id(arg2,'loadlevel',level_to_load)
 
-var level_to_load = 'tankarena'
+var level_to_load = 'test'
 var player_spawn_queue = {}
 
 func send_list_of_usernames(user, username):

+ 8 - 2
enemie/newai.gd

@@ -99,7 +99,7 @@ func _physics_process(delta):
 			motion.y = 40
 		'canon':
 			sprite_loader('canon',global_position,enemy_id)
-			if clock == 30 and onceacycle:
+			if [30,36,42].has(clock) and onceacycle:
 				var instancer = load('res://enemie/tankcanonball.tscn').instance()
 				add_child(instancer)
 				instancer.global_position = $canonpoint.global_position
@@ -112,7 +112,7 @@ func _physics_process(delta):
 			if target == null: 
 				target = find_target()
 				return
-			if motion == Vector2(0,0): motion = (target_position_buff - global_position).normalized() * 150
+			if motion == Vector2(0,0): motion = (target_position_buff - global_position).normalized() * 300
 	if clock == 0:
 		gen.shuffle()
 		state = gen[0]
@@ -135,3 +135,9 @@ func _on_Area2D_body_entered(body):
 		queue_free()
 	pass # Replace with function body.
 
+
+
+func _on_Area2D_body_entered_2(body):
+	if body.is_in_group('player'):
+		body.damage(-20, enemy_id)
+	pass # Replace with function body.

+ 14 - 2
enemie/tankboss.tscn

@@ -1,12 +1,14 @@
-[gd_scene load_steps=3 format=2]
+[gd_scene load_steps=4 format=2]
 
 [ext_resource path="res://enemie/newai.gd" type="Script" id=1]
 
 [sub_resource type="RectangleShape2D" id=23]
 extents = Vector2( 128.34, 81.3173 )
 
+[sub_resource type="RectangleShape2D" id=24]
+extents = Vector2( 94.6445, 48.9112 )
+
 [node name="tank" type="KinematicBody2D" groups=["enemy", "ennemy"]]
-position = Vector2( 689.688, 214.579 )
 collision_layer = 12
 collision_mask = 0
 script = ExtResource( 1 )
@@ -19,3 +21,13 @@ shape = SubResource( 23 )
 
 [node name="canonpoint" type="Position2D" parent="."]
 position = Vector2( -23.973, -127.356 )
+
+[node name="Area2D" type="Area2D" parent="."]
+collision_layer = 2
+collision_mask = 2
+
+[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
+position = Vector2( 22, 39 )
+shape = SubResource( 24 )
+
+[connection signal="body_entered" from="Area2D" to="." method="_on_Area2D_body_entered_2"]

File diff suppressed because it is too large
+ 3 - 5
main.tscn


Some files were not shown because too many files changed in this diff