Browse Source

manuals fixs

galo 1 year ago
parent
commit
89ef884d1b
11 changed files with 1529 additions and 273 deletions
  1. 1 1
      BrowserListClient.gd
  2. 25 25
      Client.tscn
  3. 3 2
      ClientDummy.tscn
  4. 0 1
      Enemy.tscn
  5. 5 5
      Login.gd
  6. 3 5
      Server.tscn
  7. 2 2
      envarg.gd
  8. 8 72
      main.tscn
  9. 740 0
      main.tscn~RF1fbb2b.TMP
  10. 742 0
      main.tscn~RF207ce5.TMP
  11. 0 160
      spawner.gd

+ 1 - 1
BrowserListClient.gd

@@ -1,6 +1,6 @@
 extends Node
 
-var browsecolumn = preload('res://BrowseColumn.tscn')
+var browsecolumn = preload('res://browseColumn.tscn')
 
 
 func _on_dict_arrived(arg):

+ 25 - 25
Client.tscn

@@ -1,17 +1,17 @@
 [gd_scene load_steps=17 format=2]
 
-[ext_resource path="res://Debug.tscn" type="PackedScene" id=1]
-[ext_resource path="res://PowerMenu.tscn" type="PackedScene" id=2]
-[ext_resource path="res://Client.gd" type="Script" id=3]
-[ext_resource path="res://Input.gd" type="Script" id=4]
-[ext_resource path="res://ping.gd" type="Script" id=5]
-[ext_resource path="res://projectiles.gd" type="Script" id=6]
-[ext_resource path="res://enemiessprite.gd" type="Script" id=7]
-[ext_resource path="res://font/tiny.tres" type="DynamicFont" id=8]
-[ext_resource path="res://font/8bit.tres" type="DynamicFont" id=9]
-[ext_resource path="res://art/player/emote/esclamation.png" type="Texture" id=10]
-[ext_resource path="res://opts.gd" type="Script" id=11]
-[ext_resource path="res://art/coffeemilk.png" type="Texture" id=12]
+[ext_resource path="res://debug.tscn" type="PackedScene" id=1]
+[ext_resource path="res://powerMenu.tscn" type="PackedScene" id=2]
+[ext_resource path="res://client.gd" type="Script" id=3]
+[ext_resource path="res://font/tiny.tres" type="DynamicFont" id=4]
+[ext_resource path="res://font/8bit.tres" type="DynamicFont" id=5]
+[ext_resource path="res://ping.gd" type="Script" id=6]
+[ext_resource path="res://Input.gd" type="Script" id=7]
+[ext_resource path="res://opts.gd" type="Script" id=8]
+[ext_resource path="res://projectiles.gd" type="Script" id=9]
+[ext_resource path="res://enemiessprite.gd" type="Script" id=10]
+[ext_resource path="res://art/coffeemilk.png" type="Texture" id=11]
+[ext_resource path="res://art/player/emote/esclamation.png" type="Texture" id=12]
 
 [sub_resource type="GDScript" id=1]
 script/source = "extends Label
@@ -46,15 +46,15 @@ bg_color = Color( 0, 0, 0, 0.415686 )
 script = ExtResource( 3 )
 
 [node name="Input" type="Node" parent="."]
-script = ExtResource( 4 )
+script = ExtResource( 7 )
 
 [node name="players" type="Node" parent="."]
 
 [node name="enemies" type="Node" parent="."]
-script = ExtResource( 7 )
+script = ExtResource( 10 )
 
 [node name="projectiles" type="Node" parent="."]
-script = ExtResource( 6 )
+script = ExtResource( 9 )
 
 [node name="Debug" parent="." instance=ExtResource( 1 )]
 
@@ -63,9 +63,9 @@ margin_left = 12.1612
 margin_top = 260.304
 margin_right = 52.1612
 margin_bottom = 281.304
-custom_fonts/font = ExtResource( 8 )
+custom_fonts/font = ExtResource( 4 )
 text = "ping..."
-script = ExtResource( 5 )
+script = ExtResource( 6 )
 
 [node name="Timer" type="Timer" parent="Debug/ping"]
 wait_time = 0.5
@@ -159,7 +159,7 @@ anchor_right = 1.0
 anchor_bottom = 1.0
 margin_right = 600.0
 margin_bottom = 320.0
-texture = ExtResource( 12 )
+texture = ExtResource( 11 )
 expand = true
 stretch_mode = 2
 
@@ -171,13 +171,13 @@ margin_left = 236.0
 margin_right = 365.0
 margin_bottom = 321.0
 alignment = 1
-script = ExtResource( 11 )
+script = ExtResource( 8 )
 
 [node name="Label" type="Label" parent="Options/Control/VBoxContainer"]
 margin_top = 156.0
 margin_right = 129.0
 margin_bottom = 168.0
-custom_fonts/font = ExtResource( 9 )
+custom_fonts/font = ExtResource( 5 )
 text = "volume:"
 align = 1
 
@@ -185,16 +185,16 @@ align = 1
 margin_top = 172.0
 margin_right = 129.0
 margin_bottom = 188.0
-custom_icons/tick = ExtResource( 10 )
-custom_icons/grabber_disabled = ExtResource( 10 )
-custom_icons/grabber_highlight = ExtResource( 10 )
-custom_icons/grabber = ExtResource( 10 )
+custom_icons/tick = ExtResource( 12 )
+custom_icons/grabber_disabled = ExtResource( 12 )
+custom_icons/grabber_highlight = ExtResource( 12 )
+custom_icons/grabber = ExtResource( 12 )
 
 [node name="OptionButton" type="OptionButton" parent="Options/Control/VBoxContainer"]
 margin_top = 192.0
 margin_right = 129.0
 margin_bottom = 204.0
-custom_fonts/font = ExtResource( 9 )
+custom_fonts/font = ExtResource( 5 )
 custom_styles/hover = SubResource( 2 )
 custom_styles/pressed = SubResource( 2 )
 custom_styles/focus = SubResource( 2 )

+ 3 - 2
ClientDummy.tscn

@@ -1,9 +1,10 @@
 [gd_scene load_steps=5 format=2]
 
-[ext_resource path="res://PowerMenu.tscn" type="PackedScene" id=1]
-[ext_resource path="res://Client.gd" type="Script" id=2]
+[ext_resource path="res://powerMenu.tscn" type="PackedScene" id=1]
+[ext_resource path="res://client.gd" type="Script" id=2]
 [ext_resource path="res://PowerMenu.gd" type="Script" id=3]
 
+
 [sub_resource type="GDScript" id=6]
 script/source = "extends Node
 

+ 0 - 1
Enemy.tscn

@@ -4,7 +4,6 @@
 [ext_resource path="res://damage_enemy.tscn" type="PackedScene" id=2]
 [ext_resource path="res://enemiplayerdetect.gd" type="Script" id=3]
 
-
 [sub_resource type="RectangleShape2D" id=3]
 extents = Vector2( 120, 10 )
 

+ 5 - 5
Login.gd

@@ -1,8 +1,8 @@
 extends Node
 
-var client = preload('res://Client.tscn')
-var server = preload('res://Server.tscn')
-var auth = preload('res://Auth.tscn')
+var client = preload('res://client.tscn')
+var server = preload('res://server.tscn')
+var auth = preload('res://auth.tscn')
 signal login_confimed
 signal choose_a_server(arg)
 var login_await = true
@@ -30,7 +30,7 @@ func _on_Button_button_down():
 	else:
 		client2.ip = $directconnect/VBoxContainer/HBoxContainer/LineEdit2.get_text()
 		client2.port = int($directconnect/VBoxContainer/HBoxContainer/LineEdit.get_text())
-	
+
 	get_parent().get_node("BrowserListClient/PanelContainer").hide()
 	get_node('../Uibackground').hide()
 	get_parent().add_child(client2)
@@ -55,7 +55,7 @@ func _on_register_button_down():
 	pass # Replace with function body.
 
 func _on_login2_button_down():
-	
+
 	for x in get_children():
 		x.hide()
 	$loginscreen.show()

+ 3 - 5
Server.tscn

@@ -1,10 +1,9 @@
-[gd_scene load_steps=3 format=2]
+[gd_scene load_steps=2 format=2]
 
-[ext_resource path="res://Server.gd" type="Script" id=2]
-[ext_resource path="res://spawner.gd" type="Script" id=3]
+[ext_resource path="res://Server.gd" type="Script" id=1]
 
 [node name="Server" type="Node" groups=["server"]]
-script = ExtResource( 2 )
+script = ExtResource( 1 )
 database = NodePath("../Database")
 tickrate = 4
 
@@ -15,4 +14,3 @@ tickrate = 4
 [node name="projectiles" type="Node" parent="." groups=["proj"]]
 
 [node name="Enemies" type="Node" parent="." groups=["enemy_authority"]]
-script = ExtResource( 3 )

+ 2 - 2
envarg.gd

@@ -1,7 +1,7 @@
 extends Node
 
-var server = preload('res://Server.tscn')
-var auth = preload('res://Auth.tscn')
+var server = preload('res://server.tscn')
+var auth = preload('res://auth.tscn')
 
 func _ready():
 	var args = Array(OS.get_cmdline_args())

+ 8 - 72
main.tscn

@@ -1,18 +1,17 @@
-[gd_scene load_steps=43 format=2]
+[gd_scene load_steps=42 format=2]
 
-[ext_resource path="res://Login.gd" type="Script" id=1]
+[ext_resource path="res://login.gd" type="Script" id=1]
 [ext_resource path="res://envarg.gd" type="Script" id=2]
 [ext_resource path="res://Database.gd" type="Script" id=3]
 [ext_resource path="res://x509gen.gd" type="Script" id=4]
 [ext_resource path="res://BrowserListClient.gd" type="Script" id=5]
 [ext_resource path="res://loginnetcode.gd" type="Script" id=6]
-[ext_resource path="res://BrowseColumn.tscn" type="PackedScene" id=7]
+[ext_resource path="res://browseColumn.tscn" type="PackedScene" id=7]
 [ext_resource path="res://tiles/tile32bc.tres" type="TileSet" id=8]
 [ext_resource path="res://art/minibullet.png" type="Texture" id=9]
 [ext_resource path="res://art/Untitledcxz.png" type="Texture" id=10]
 [ext_resource path="res://Textures.gd" type="Script" id=11]
 [ext_resource path="res://Levelselect.gd" type="Script" id=12]
-[ext_resource path="res://Enemy.tscn" type="PackedScene" id=13]
 [ext_resource path="res://tiles/basicimage.tres" type="Material" id=14]
 [ext_resource path="res://art/Medieval_Castle_Asset_Pack/Background/layers71.png" type="Texture" id=15]
 [ext_resource path="res://art/Medieval_Castle_Asset_Pack/Background/layers3.png" type="Texture" id=16]
@@ -22,18 +21,22 @@
 [ext_resource path="res://font/8bit.tres" type="DynamicFont" id=20]
 
 [sub_resource type="AtlasTexture" id=1]
+flags = 4
 atlas = ExtResource( 10 )
 region = Rect2( 0, 0, 112, 113 )
 
 [sub_resource type="AtlasTexture" id=2]
+flags = 4
 atlas = ExtResource( 10 )
 region = Rect2( 112, 0, 112, 113 )
 
 [sub_resource type="AtlasTexture" id=3]
+flags = 4
 atlas = ExtResource( 10 )
 region = Rect2( 224, 0, 112, 113 )
 
 [sub_resource type="AtlasTexture" id=4]
+flags = 4
 atlas = ExtResource( 10 )
 region = Rect2( 336, 0, 112, 113 )
 
@@ -199,7 +202,6 @@ render_target_v_flip = true
 
 [node name="SoldierAnim2" parent="Textures/Goblin2" instance=ExtResource( 17 )]
 position = Vector2( 32, 12 )
-anim = "walk"
 
 [node name="Goblin3" type="Viewport" parent="Textures"]
 size = Vector2( 64, 64 )
@@ -209,8 +211,6 @@ render_target_v_flip = true
 
 [node name="SoldierAnim3" parent="Textures/Goblin3" instance=ExtResource( 17 )]
 position = Vector2( 32, 12 )
-anim = "shoot"
-animnode = "AnimationPlayer2"
 
 [node name="Goblin4" type="Viewport" parent="Textures"]
 size = Vector2( 64, 64 )
@@ -221,6 +221,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 )
@@ -743,71 +744,6 @@ tile_data = PoolIntArray( -262155, 0, 5, -196619, 0, 65539, -131083, 0, 65539, -
 [node name="enemies" type="Node2D" parent="Levelselect/test"]
 script = SubResource( 14 )
 
-[node name="Enemy" parent="Levelselect/test/enemies" instance=ExtResource( 13 )]
-position = Vector2( 236.079, 304.464 )
-
-[node name="Enemy2" parent="Levelselect/test/enemies" instance=ExtResource( 13 )]
-position = Vector2( 156.385, 304.464 )
-
-[node name="Enemy3" parent="Levelselect/test/enemies" instance=ExtResource( 13 )]
-position = Vector2( 57.608, 302.219 )
-
-[node name="Enemy4" parent="Levelselect/test/enemies" instance=ExtResource( 13 )]
-position = Vector2( 983.918, 232.923 )
-
-[node name="Enemy5" parent="Levelselect/test/enemies" instance=ExtResource( 13 )]
-position = Vector2( 1341.71, 172.112 )
-
-[node name="Enemy6" parent="Levelselect/test/enemies" instance=ExtResource( 13 )]
-position = Vector2( 1416.67, 169.283 )
-
-[node name="Enemy7" parent="Levelselect/test/enemies" instance=ExtResource( 13 )]
-position = Vector2( 1494.45, 169.283 )
-
-[node name="Enemy8" parent="Levelselect/test/enemies" instance=ExtResource( 13 )]
-position = Vector2( 2535.31, 207.467 )
-
-[node name="Enemy9" parent="Levelselect/test/enemies" instance=ExtResource( 13 )]
-position = Vector2( 2284.99, 142.413 )
-
-[node name="Enemy10" parent="Levelselect/test/enemies" instance=ExtResource( 13 )]
-position = Vector2( 2555.11, 80.1879 )
-
-[node name="Enemy11" parent="Levelselect/test/enemies" instance=ExtResource( 13 )]
-position = Vector2( 2835.12, 46.2468 )
-
-[node name="Enemy12" parent="Levelselect/test/enemies" instance=ExtResource( 13 )]
-position = Vector2( 2878.96, 46.2468 )
-
-[node name="Enemy13" parent="Levelselect/test/enemies" instance=ExtResource( 13 )]
-position = Vector2( 2924.22, 46.2468 )
-
-[node name="Enemy14" parent="Levelselect/test/enemies" instance=ExtResource( 13 )]
-position = Vector2( 3174.25, 46.2468 )
-
-[node name="Enemy15" parent="Levelselect/test/enemies" instance=ExtResource( 13 )]
-position = Vector2( 3225.11, 46.2468 )
-
-[node name="Enemy16" parent="Levelselect/test/enemies" instance=ExtResource( 13 )]
-position = Vector2( 3284.44, 46.2468 )
-
-[node name="Enemy17" parent="Levelselect/test/enemies" instance=ExtResource( 13 )]
-position = Vector2( 3625.58, 46.2468 )
-
-[node name="Enemy18" parent="Levelselect/test/enemies" instance=ExtResource( 13 )]
-position = Vector2( 3676.44, 46.2468 )
-
-[node name="Enemy19" parent="Levelselect/test/enemies" instance=ExtResource( 13 )]
-position = Vector2( 3735.77, 46.2468 )
-
-[node name="Enemy20" parent="Levelselect/test/enemies" instance=ExtResource( 13 )]
-position = Vector2( 4100.22, 137.361 )
-
-[node name="Enemy21" parent="Levelselect/test/enemies" instance=ExtResource( 13 )]
-position = Vector2( 4729.64, 269.902 )
-vida = 100
-speed = 140
-
 [node name="testclient" type="Node2D" parent="Levelselect"]
 visible = false
 

File diff suppressed because it is too large
+ 740 - 0
main.tscn~RF1fbb2b.TMP


File diff suppressed because it is too large
+ 742 - 0
main.tscn~RF207ce5.TMP


+ 0 - 160
spawner.gd

@@ -1,160 +0,0 @@
-extends Node
-
-var enemy = preload('res://Enemy.tscn')
-export var wave_num = 1
-export var spawn_speed = 10
-export var limit = 32
-export var maxlimit = 1024
-export var mod = 1.5
-export var mod2 = 1.2
-
-var dict = {
-	"arraypos":[],
-	"arrayvida":[],
-	"arraytype":[],
-	"arraytarget":[],
-	"arraymotion":[],
-	"arraydirtime":[],
-	'attacker':[],
-	'enabled':[],
-	'type':[],
-}
-
-var collisions = []
-var areas = preload('res://Enemy2.tscn')
-
-func _ready():
-	
-	yield(get_tree().create_timer(1.0),"timeout")
-	
-	for x in maxlimit:
-		var rot = rand_range(-PI,PI)
-		var pos = (Vector2(sin(rot), cos(rot)) * rand_range(400,800)) + Vector2(320,180)
-		dict.arraytarget.append(null)
-		dict.arraypos.append(pos)
-		dict.arrayvida.append(100)
-		dict.arraytype.append('goblin')
-		dict.attacker.append('')
-		dict.arraymotion.append(Vector2.ZERO)
-		dict.arraydirtime.append(int(rand_range(60,120)))
-		dict.enabled.append(true)
-		dict.type.append(randi()%4)
-	
-var motion = Vector2()
-export var speed = 2.3
-var tick = 0
-export var tickrate = 4
-
-var blockmapenemy = {}
-
-#func _physics_process(delta):
-#
-##setting tickrate, to reduce executions per second
-##	tick += 1
-##	if fmod(tick,tickrate) == 0:
-#	if true:
-#
-##dict of aprox positions of players
-#		var blockmap = {}
-#		if get_node('../players').get_child_count() == 0: return
-#		for z in get_node('../players').get_children():
-#			var x = int(z.global_position.x/20)
-#			var y = int(z.global_position.y/20)
-#			blockmap[Vector2(x,y)] = z
-#
-##yes this abomination controls the enemies, ECS code looks ugly as fuck in this engine
-#		for i in dict.arraytarget.size():
-#
-## death checking
-#			if dict.arrayvida[i] > 0 and dict.enabled[i]:
-#
-##picking new targets if the last one is invalid
-#				if dict.arraytarget[i] == null:
-#					if get_node('../players').get_child_count() == 0: return
-#					var array = get_node('../players').get_children()
-#					if array.size() > 0:
-#						dict.arraytarget[i] = array[randi()%array.size()]
-#
-##exclusive movmenet code
-#				if fmod(tick, dict.arraydirtime[i]) == 0:
-#					if is_instance_valid(dict.arraytarget[i]):
-#						dict.arraymotion[i] = (dict.arraytarget[i].global_position - dict.arraypos[i]).normalized() * speed
-#				dict.arraypos[i] += dict.arraymotion[i]
-#
-## enemy attak on players
-#				var x = int(dict.arraypos[i].x/20)
-#				var y = int(dict.arraypos[i].y/20)
-#				if blockmap.has(Vector2(x,y)):
-#					blockmap[Vector2(x,y)].damage( -enemydmg, '')
-##recycling enemies
-#			elif dict.enabled[i]:
-#				var rot = rand_range(-PI,PI)
-#				dict.arraypos[i] = (Vector2(sin(rot), cos(rot)) * rand_range(400,800)) + Vector2(320,180)
-#				dict.arrayvida[i] = 100
-#				dict.arraytarget[i] = null
-#				death_count(dict.attacker[i])
-#
-
-func damage_detection(arg,dmg, attacker):
-	blockmapenemy = {}
-	for i in dict.arraypos.size():
-		var x2 = int( (dict.arraypos[i].x -16)/32)
-		var y2 = int( (dict.arraypos[i].y -16)/32)
-		if blockmapenemy.has(Vector2(x2,y2)):
-			blockmapenemy[Vector2(x2,y2)].append(i)
-		else:
-			blockmapenemy[Vector2(x2,y2)] = [i]
-	
-	var x = int((arg.x -16)/32)
-	var y = int((arg.y -16)/32)
-	for x2 in range(-2,2):
-		for y2 in range(-2,2):
-			if blockmapenemy.has(Vector2(x+x2,y+y2)):
-				for i in blockmapenemy[Vector2(x+x2,y+y2)]:
-					dict.arrayvida[i] -= dmg
-					if dict.arrayvida[i] <= 0:
-						dict.attacker[i] = attacker
-
-
-#unrelated code that takes care of level up, kill counts, xp and etc
-
-var counter = 0
-var score = {}
-var xp = {}
-var nxt = {}
-var lv = {}
-var maxhp = {}
-
-export var hpgain = 5
-export var dmggain = 5
-export var xpggain = 10
-export var xpnext = 1.2
-export var enemydmg = 3.0
-
-func death_count(id):
-	if not nxt.has(id):
-		nxt[id] = 100
-	
-	if not maxhp.has(id):
-		maxhp[id] = 100
-	
-	if not lv.has(id):
-		lv[id] = 0
-	
-	if score.has(id):
-		score[id] += 1
-	else:
-		score[id] = 1
-	
-	if xp.has(id):
-		xp[id] += xpggain
-		if xp[id] > nxt[id]:
-			lv[id] += 1
-			var gain = hpgain * lv[id]
-			maxhp[id] += gain
-			get_parent().level_up(lv[id] , maxhp[id], gain, dmggain, id)
-			xp[id] = 0
-			nxt[id] *= xpnext
-	else:
-		xp[id] = xpggain
-	get_parent().kill_update(score[id], xp[id], lv[id], nxt[id], id)

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