Project reorganization

Reorganized the project so it's a little less all over the place. For example, world scenes are now in scenes/world. I also moved all scripts to the script directory.
This commit is contained in:
Anthony Foxclaw 2020-06-28 14:58:49 -04:00
parent 6ce7d58163
commit dbac16804c
7 changed files with 35 additions and 44 deletions

122
scenes/Player.tscn Normal file
View file

@ -0,0 +1,122 @@
[gd_scene load_steps=40 format=2]
[ext_resource path="res://Sprites/polo_sprites/poloright_0.png" type="Texture" id=3]
[ext_resource path="res://Sprites/polo_sprites/poloright_2.png" type="Texture" id=4]
[ext_resource path="res://Sprites/polo_sprites/polorightdown_0.png" type="Texture" id=5]
[ext_resource path="res://Sprites/polo_sprites/Spawn/spr_poloSpawn_9.png" type="Texture" id=6]
[ext_resource path="res://Sprites/polo_sprites/polorightup_0.png" type="Texture" id=7]
[ext_resource path="res://Sprites/polo_sprites/Warp/polowarp_8.png" type="Texture" id=8]
[ext_resource path="res://Sprites/polo_sprites/Warp/polowarp_10.png" type="Texture" id=9]
[ext_resource path="res://Sprites/polo_sprites/Warp/polowarp_3.png" type="Texture" id=10]
[ext_resource path="res://Sprites/polo_sprites/Spawn/spr_poloSpawn_1.png" type="Texture" id=11]
[ext_resource path="res://Sprites/polo_sprites/Warp/polowarp_13.png" type="Texture" id=12]
[ext_resource path="res://Sprites/polo_sprites/Spawn/spr_poloSpawn_7.png" type="Texture" id=13]
[ext_resource path="res://Sprites/polo_sprites/Spawn/spr_poloSpawn_0.png" type="Texture" id=14]
[ext_resource path="res://Sprites/polo_sprites/Idle/polo_r_blink_3.png" type="Texture" id=15]
[ext_resource path="res://Sprites/polo_sprites/Spawn/spr_poloSpawn_2.png" type="Texture" id=16]
[ext_resource path="res://Sprites/polo_sprites/Spawn/spr_poloSpawn_3.png" type="Texture" id=17]
[ext_resource path="res://Sprites/polo_sprites/Warp/polowarp_9.png" type="Texture" id=18]
[ext_resource path="res://Sprites/polo_sprites/Spawn/spr_poloSpawn_6.png" type="Texture" id=19]
[ext_resource path="res://Sounds/snd_jump2.wav" type="AudioStream" id=20]
[ext_resource path="res://Sprites/polo_sprites/Warp/polowarp_6.png" type="Texture" id=21]
[ext_resource path="res://Sounds/snd_respawn.wav" type="AudioStream" id=22]
[ext_resource path="res://Sprites/polo_sprites/Idle/polo_r_blink_2.png" type="Texture" id=23]
[ext_resource path="res://Sprites/polo_sprites/Spawn/spr_poloSpawn_8.png" type="Texture" id=24]
[ext_resource path="res://scripts/player.gd" type="Script" id=25]
[ext_resource path="res://Sprites/polo_sprites/Warp/polowarp_12.png" type="Texture" id=26]
[ext_resource path="res://Sprites/polo_sprites/Warp/polowarp_11.png" type="Texture" id=27]
[ext_resource path="res://Sprites/polo_sprites/Warp/polowarp_5.png" type="Texture" id=28]
[ext_resource path="res://Sprites/polo_sprites/Spawn/spr_poloSpawn_4.png" type="Texture" id=29]
[ext_resource path="res://Sprites/polo_sprites/Warp/polowarp_4.png" type="Texture" id=30]
[ext_resource path="res://Sprites/polo_sprites/Spawn/spr_poloSpawn_5.png" type="Texture" id=31]
[ext_resource path="res://Sprites/polo_sprites/Warp/polowarp_7.png" type="Texture" id=32]
[ext_resource path="res://Sprites/polo_sprites/Idle/polo_r_blink_0.png" type="Texture" id=33]
[ext_resource path="res://Sprites/polo_sprites/Warp/polowarp_1.png" type="Texture" id=34]
[ext_resource path="res://Sprites/polo_sprites/Warp/polowarp_14.png" type="Texture" id=35]
[ext_resource path="res://Sprites/polo_sprites/Warp/polowarp_2.png" type="Texture" id=36]
[ext_resource path="res://Sprites/polo_sprites/poloright_1.png" type="Texture" id=37]
[ext_resource path="res://Sprites/polo_sprites/poloright_3.png" type="Texture" id=38]
[ext_resource path="res://misc/fonts/playertext.tres" type="DynamicFont" id=39]
[sub_resource type="SpriteFrames" id=1]
animations = [ {
"frames": [ ExtResource( 14 ), ExtResource( 11 ), ExtResource( 16 ), ExtResource( 17 ), ExtResource( 29 ), ExtResource( 31 ), ExtResource( 19 ), ExtResource( 13 ), ExtResource( 24 ), ExtResource( 6 ) ],
"loop": false,
"name": "Spawn",
"speed": 5.0
}, {
"frames": [ ExtResource( 9 ), ExtResource( 27 ), ExtResource( 26 ), ExtResource( 12 ), ExtResource( 35 ), ExtResource( 34 ), ExtResource( 36 ), ExtResource( 10 ), ExtResource( 30 ), ExtResource( 28 ), ExtResource( 21 ), ExtResource( 32 ), ExtResource( 8 ), ExtResource( 18 ) ],
"loop": true,
"name": "Warp",
"speed": 20.0
}, {
"frames": [ ExtResource( 33 ), ExtResource( 23 ), ExtResource( 15 ), ExtResource( 33 ), ExtResource( 33 ), ExtResource( 33 ), ExtResource( 33 ), ExtResource( 33 ), ExtResource( 33 ), ExtResource( 33 ), ExtResource( 33 ), ExtResource( 33 ), ExtResource( 33 ), ExtResource( 33 ), ExtResource( 33 ), ExtResource( 33 ), ExtResource( 33 ), ExtResource( 33 ), ExtResource( 33 ), ExtResource( 33 ), ExtResource( 33 ), ExtResource( 33 ), ExtResource( 33 ), ExtResource( 33 ), ExtResource( 33 ), ExtResource( 33 ), ExtResource( 33 ), ExtResource( 33 ), ExtResource( 33 ), ExtResource( 33 ), ExtResource( 33 ), ExtResource( 33 ), ExtResource( 33 ), ExtResource( 33 ), ExtResource( 33 ), ExtResource( 33 ) ],
"loop": true,
"name": "Idle",
"speed": 20.0
}, {
"frames": [ ExtResource( 5 ) ],
"loop": true,
"name": "Fall",
"speed": 5.0
}, {
"frames": [ ExtResource( 3 ), ExtResource( 37 ), ExtResource( 4 ), ExtResource( 38 ) ],
"loop": true,
"name": "Run",
"speed": 20.0
}, {
"frames": [ ExtResource( 7 ) ],
"loop": true,
"name": "Jump",
"speed": 5.0
} ]
[sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 5.0126, 5.32944 )
[node name="Player" type="KinematicBody2D"]
script = ExtResource( 25 )
[node name="Label" type="Label" parent="."]
margin_left = -25.041
margin_top = -16.584
margin_right = 25.959
margin_bottom = -5.58401
custom_fonts/font = ExtResource( 39 )
text = "p1"
align = 1
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Sprite" type="AnimatedSprite" parent="."]
frames = SubResource( 1 )
animation = "Spawn"
frame = 9
playing = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2( 0.128571, 0.706848 )
shape = SubResource( 2 )
one_way_collision_margin = 0.0
[node name="Camera2D" type="Camera2D" parent="."]
current = true
zoom = Vector2( 0.5, 0.5 )
smoothing_speed = 2.0
drag_margin_left = 0.01
drag_margin_top = 0.05
drag_margin_right = 0.01
drag_margin_bottom = 0.05
editor_draw_limits = true
[node name="SndJump" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 20 )
volume_db = -25.0
pitch_scale = 0.8
mix_target = 2
[node name="SndSpawn" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 22 )
volume_db = -15.0
mix_target = 2

View file

@ -1,54 +0,0 @@
extends Control
var host_port = 2675
var host_playermax = 2
var ip = "127.0.0.1"
var port = 2670
# Called when the node enters the scene tree for the first time.
func _ready():
#var myip = IP.get_local_addresses()
#var interfaces = IP.get_local_interfaces ()
#$HostPanel/label_myip.text = "IP "+myip[0]+". "+interfaces[0]
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
func _on_singleplayer_button_up():
var _letsgo = get_tree().change_scene("res://world_scenes/World.tscn")
func _on_JoinGameBtn_button_up():
ip = $JoinPanel/join_ip
port = $JoinPanel/join_port
print("Netplay - Attempting to join game at IP ",ip," via port ",port)
join_game()
func _on_HostGameBtn_button_up():
var host_port = $HostPanel/host_port.value
print("Netplay - Attempting to host game on port ",host_port,"...")
host_game(host_port)
func host_game(port):
var maxplayers = $HostPanel/playercount.value
var host = NetworkedMultiplayerENet.new()
print("Netplay - Returned: ",host)
host.create_server(port, maxplayers) # ports, maxplayers
get_tree().set_network_peer(host)
print("Netplay - Hosting on port ",port,". Max players: ",maxplayers)
print("Netplay - Are you the server ... ",get_tree().is_network_server())
$HostPanel/HostGameBtn.disabled = 1
$HostPanel/HostGameBtn.hint_tooltip = "Cannot start another server, Server already started."
$JoinPanel/JoinGameBtn.disabled = 1
$JoinPanel/JoinGameBtn.hint_tooltip = "Cannot join another server, Server already started."
#Goto a lobby instance
func join_game():
var host = NetworkedMultiplayerENet.new()
host.create_client(ip, port)
get_tree().set_network_peer(host)
print("Maybe it joined...?")

View file

@ -3,7 +3,7 @@
[ext_resource path="res://misc/fonts/font_buttons.tres" type="DynamicFont" id=1]
[ext_resource path="res://misc/fonts/field_labels.tres" type="DynamicFont" id=2]
[ext_resource path="res://misc/fonts/fieldfonts.tres" type="DynamicFont" id=3]
[ext_resource path="res://scenes/menu.gd" type="Script" id=4]
[ext_resource path="res://scripts/menu.gd" type="Script" id=4]
[ext_resource path="res://Sounds/mus_test.ogg" type="AudioStream" id=5]
[ext_resource path="res://Backgrounds/bkMountains.png" type="Texture" id=6]
[ext_resource path="res://misc/panel_mainmenu.tres" type="StyleBox" id=7]
@ -158,7 +158,7 @@ margin_bottom = -62.0
hint_tooltip = "Start a singleplayer game"
mouse_default_cursor_shape = 2
custom_fonts/font = ExtResource( 1 )
text = "Force Start"
text = "Single player"
__meta__ = {
"_edit_use_anchors_": false
}

View file

@ -0,0 +1,30 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://Backgrounds/bkMountains.png" type="Texture" id=1]
[node name="Mountains" type="ParallaxBackground"]
[node name="ParallaxLayer" type="ParallaxLayer" parent="."]
scale = Vector2( 0.75, 0.75 )
motion_scale = Vector2( 0.09, 0.07 )
motion_offset = Vector2( 0, -90 )
motion_mirroring = Vector2( 240, 0 )
__meta__ = {
"_edit_group_": true,
"_edit_lock_": true
}
[node name="bk_mountain" type="Sprite" parent="ParallaxLayer"]
texture = ExtResource( 1 )
centered = false
__meta__ = {
"_edit_lock_": true
}
[node name="bk_mountain2" type="Sprite" parent="ParallaxLayer"]
texture = ExtResource( 1 )
centered = false
offset = Vector2( 240, 0 )
__meta__ = {
"_edit_lock_": true
}

42
scenes/world/Stars.tscn Normal file
View file

@ -0,0 +1,42 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://Backgrounds/bk_clouds.png" type="Texture" id=1]
[node name="Stars" type="ParallaxBackground"]
[node name="ColorRect" type="ColorRect" parent="."]
margin_left = -58.2606
margin_top = -48.236
margin_right = 1861.74
margin_bottom = 503.764
color = Color( 0.137255, 0.152941, 0.262745, 1 )
__meta__ = {
"_edit_lock_": true,
"_edit_use_anchors_": false
}
[node name="ParallaxLayer" type="ParallaxLayer" parent="."]
scale = Vector2( 0.5, 0.5 )
motion_scale = Vector2( 0.02, 0.01 )
motion_offset = Vector2( 200, -100 )
motion_mirroring = Vector2( 480, 0 )
__meta__ = {
"_edit_group_": true,
"_edit_lock_": true
}
[node name="bk_clouds" type="Sprite" parent="ParallaxLayer"]
texture = ExtResource( 1 )
centered = false
offset = Vector2( 0, -16 )
__meta__ = {
"_edit_lock_": true
}
[node name="bk_clouds2" type="Sprite" parent="ParallaxLayer"]
texture = ExtResource( 1 )
centered = false
offset = Vector2( 240, -16 )
__meta__ = {
"_edit_lock_": true
}

48
scenes/world/World.tscn Normal file

File diff suppressed because one or more lines are too long