From f328ff9b10c761430fa0d3a247204c47d4413678 Mon Sep 17 00:00:00 2001 From: "ItsAleph[core]" Date: Wed, 13 Jul 2022 23:57:54 +0300 Subject: [PATCH] Fix #1 and #2 --- assets/dino4x.png | Bin 0 -> 8129 bytes assets/dino4x.png.import | 35 ++++++++++++++++++++++++++ export_presets.cfg | 2 +- scenes/Levels/LevelLoader.gd | 7 +++++- scenes/MultiplayerLobby.tscn | 46 +++++++++++++++++++++++++++++++++++ scripts/ExplosiveCan.gd | 6 ++--- scripts/MupltiplayerGame.gd | 18 +++++++------- scripts/ToxicCan.gd | 6 ++--- 8 files changed, 103 insertions(+), 17 deletions(-) create mode 100644 assets/dino4x.png create mode 100644 assets/dino4x.png.import create mode 100644 scenes/MultiplayerLobby.tscn diff --git a/assets/dino4x.png b/assets/dino4x.png new file mode 100644 index 0000000000000000000000000000000000000000..fef2b8df8e13f04e1637b79f7589ae224a7d80d4 GIT binary patch literal 8129 zcmeHMc~lek{zbGZZn$f$B(6oP6>AldC8N;(sG{Od1vIwQq9D5hA9OIY}M_?VOD){0zihQ`mT zzHn}4f?ILvf~fDm==Hz&<>U9HalV(@GArgW!K z&SS<;U9j;#7ylnYIElLCJdJDkdh74#CC=XemdlGJGSj3#BYm%ez$D7V5a`oUD1FJU zlYbDzp-s+&_`3M>363b`dO+O2d9rZ2u-rjcJ07c)~w!Se2H(P=$YG3LBuWa>0WCMoN3x`$I! zRQ1*?e*pV;JpJQNH_jY-=X(FbMGio;VD*ZVnfseszWNvVdnWWSoxq{DM-RK6ctxil zI6XEJp0iN)z<3@;i2+4Hx_azlXVgk;tr1^R<4Q7F-LT?UJ4Xi z&|RUMOoBF57y~arz*y@8KtFUZLCH&q+)ZJ}qJof1l3ZYa|Gke0wWY-*Fz1)so*8q2 z6Tjj3xq};2xx{m+htsF7(;SlCe!KL3DR2BAcmEd}{A3i}=^SN|L+)2P-Rr|9PgOw4 z9&n&H2`cP*$>w_kC@`2|pej`T>IrprX>7m#X_ppTv=-tF`~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N$vSV>9x{71+EiWA=I8r|5r1^2N4>d)0(cndY~rl@p_6NOD;vBjl+oTxz`ENox2i5=p literal 0 HcmV?d00001 diff --git a/assets/dino4x.png.import b/assets/dino4x.png.import new file mode 100644 index 0000000..019ad23 --- /dev/null +++ b/assets/dino4x.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/dino4x.png-a484b5f8c966ac9f70804f22df26731e.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/dino4x.png" +dest_files=[ "res://.import/dino4x.png-a484b5f8c966ac9f70804f22df26731e.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/export_presets.cfg b/export_presets.cfg index 609da64..0f3a1ba 100644 --- a/export_presets.cfg +++ b/export_presets.cfg @@ -7,7 +7,7 @@ custom_features="" export_filter="all_resources" include_filter="*json" exclude_filter="" -export_path="../Builds/FluxEdge v1.0.6.exe" +export_path="../Builds/FluxEdge v0.1.1.exe" script_export_mode=1 script_encryption_key="" diff --git a/scenes/Levels/LevelLoader.gd b/scenes/Levels/LevelLoader.gd index b6ded2e..c47e750 100644 --- a/scenes/Levels/LevelLoader.gd +++ b/scenes/Levels/LevelLoader.gd @@ -22,6 +22,7 @@ func loader(): file.close(); xxx_player_startpoint = Vector2(data['startpoint']['x'] * 32, data['startpoint']['y'] * 32); + poss[1] = xxx_player_startpoint; if data.get("p2startpoint"): poss[2] = Vector2(data['p2startpoint']['x'] * 32, data['p2startpoint']['y'] * 32); @@ -72,4 +73,8 @@ func get_player_position(player): #var aa = Vector2(xxx_player_startpoint.x + (32 * player), xxx_player_startpoint.y); #print(aa) #return aa; - return poss[player]; + #return poss[player]; + if GlobalVars.HOST: + return poss[2]; + else: + return poss[1]; diff --git a/scenes/MultiplayerLobby.tscn b/scenes/MultiplayerLobby.tscn new file mode 100644 index 0000000..02310e7 --- /dev/null +++ b/scenes/MultiplayerLobby.tscn @@ -0,0 +1,46 @@ +[gd_scene load_steps=8 format=2] + +[ext_resource path="res://assets/BackgroundEarth.png" type="Texture" id=1] +[ext_resource path="res://assets/dino4x.png" type="Texture" id=2] + +[sub_resource type="AtlasTexture" id=1] +flags = 4 +atlas = ExtResource( 2 ) +region = Rect2( 1920, 0, 96, 96 ) + +[sub_resource type="AtlasTexture" id=2] +flags = 4 +atlas = ExtResource( 2 ) +region = Rect2( 2016, 0, 96, 96 ) + +[sub_resource type="AtlasTexture" id=3] +flags = 4 +atlas = ExtResource( 2 ) +region = Rect2( 2112, 0, 96, 96 ) + +[sub_resource type="AtlasTexture" id=4] +flags = 4 +atlas = ExtResource( 2 ) +region = Rect2( 2208, 0, 96, 96 ) + +[sub_resource type="SpriteFrames" id=5] +animations = [ { +"frames": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 4 ) ], +"loop": true, +"name": "default", +"speed": 5.0 +} ] + +[node name="MultiplayerLobby" type="Node2D"] + +[node name="Camera2D" type="Camera2D" parent="."] +current = true + +[node name="Sprite" type="Sprite" parent="Camera2D"] +texture = ExtResource( 1 ) + +[node name="AnimatedSprite" type="AnimatedSprite" parent="."] +scale = Vector2( 2.22917, 2.22917 ) +frames = SubResource( 5 ) +frame = 2 +playing = true diff --git a/scripts/ExplosiveCan.gd b/scripts/ExplosiveCan.gd index d4d9e11..232e680 100644 --- a/scripts/ExplosiveCan.gd +++ b/scripts/ExplosiveCan.gd @@ -20,13 +20,13 @@ func xxx_process_destroy(): get_tree().root.get_child(1).get_child(1).add_child(instance); for player in ps_high: - player.health -= 50; + player.deal_damage(50); for player in ps_medium: - player.health -= 25; + player.deal_damage(25); for player in ps_small: - player.health -= 10; + player.deal_damage(10); var camera: Camera2D = get_parent().xxx_player.get_node("Camera2D"); diff --git a/scripts/MupltiplayerGame.gd b/scripts/MupltiplayerGame.gd index 774003f..5307338 100644 --- a/scripts/MupltiplayerGame.gd +++ b/scripts/MupltiplayerGame.gd @@ -11,12 +11,10 @@ func gather_lvl_data(): func _ready(): get_tree().set_pause(true); if GlobalVars.HOST: - print("HOST") var peer = NetworkedMultiplayerENet.new(); peer.create_server(GlobalVars.SERVER_PORT, GlobalVars.MAX_PLAYERS); get_tree().network_peer = peer; else: - print("NOT HOST") var peer = NetworkedMultiplayerENet.new(); peer.create_client(GlobalVars.SERVER_IP, GlobalVars.SERVER_PORT); get_tree().network_peer = peer; @@ -25,33 +23,35 @@ func _ready(): get_tree().connect("network_peer_disconnected", self, "_player_disconnected"); func _player_connected(id): - print("CONNECTED") get_tree().set_pause(false); # Called on both clients and server when a peer connects. Send my info to it. rpc_id(id, "register_player"); func _player_disconnected(id): - print("DISCONNECTED") get_tree().set_pause(true); get_tree().set_refuse_new_network_connections(false); player_count -= 1; remove_child(get_node("RemotePlayer_%s" % id)); remote func register_player(): - print("REGPLAYER") var id = get_tree().get_rpc_sender_id(); var rp = remote_player.instance(); player_count += 1; - rp.position = $Level.get_player_position(player_count); + #rp.position = $Level.get_player_position(player_count); + + if id == 1: + rp.position = $Level.poss[1]; + else: + rp.position = $Level.poss[2]; rp.name = "RemotePlayer_%s" % id; add_child(rp); - if player_count == 2: - get_tree().set_refuse_new_network_connections(true); - get_tree().set_pause(false); + #if player_count == GlobalVars.MAX_PLAYERS: + # get_tree().set_refuse_new_network_connections(true); + # get_tree().set_pause(false); func do_map_sync(): rpc("sync_map", $Level); diff --git a/scripts/ToxicCan.gd b/scripts/ToxicCan.gd index da965f2..2ffc96b 100644 --- a/scripts/ToxicCan.gd +++ b/scripts/ToxicCan.gd @@ -20,13 +20,13 @@ func xxx_process_destroy(): get_tree().root.get_child(1).get_child(1).add_child(instance); for player in ps_high: - player.health -= 50; + player.deal_damage(50); for player in ps_medium: - player.health -= 25; + player.deal_damage(25); for player in ps_small: - player.health -= 10; + player.deal_damage(10); var camera: Camera2D = get_parent().xxx_player.get_node("Camera2D");