diff --git a/assets/dino4x.png b/assets/dino4x.png new file mode 100644 index 0000000..fef2b8d Binary files /dev/null and b/assets/dino4x.png differ 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");