lvl1 lvl2 lvl3

This commit is contained in:
MarcEricMartel 2022-10-12 13:32:38 -04:00
parent f02268b101
commit 8deb034f52
6 changed files with 181 additions and 8 deletions

View File

@ -4,8 +4,8 @@ extends Spatial
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
var enemycount = 2
onready var NEXTSCENE = "res://Test_Scene.tscn"
var enemycount = 1
onready var NEXTSCENE = "res://Levels/Level03.tscn"
onready var WinMess = $Messages/Win
onready var EndTimer = $End
@ -21,7 +21,6 @@ func _on_Enemy_dying():
if enemycount == 0:
WinMess.show()
EndTimer.start()
HUD.ingame = false
func _on_Win_timeout():

View File

@ -25,12 +25,12 @@ albedo_texture = ExtResource( 1 )
[sub_resource type="SpatialMaterial" id=5]
albedo_texture = ExtResource( 1 )
[sub_resource type="PanoramaSky" id=6]
[sub_resource type="PanoramaSky" id=9]
panorama = ExtResource( 6 )
[sub_resource type="Environment" id=7]
background_mode = 2
background_sky = SubResource( 6 )
background_sky = SubResource( 9 )
ambient_light_energy = 0.67
fog_enabled = true
fog_color = Color( 0.305882, 0.372549, 0.52549, 1 )
@ -140,7 +140,6 @@ wait_time = 3.0
[node name="Music" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 9 )
volume_db = -3.0
autoplay = true
bus = "Music"
[connection signal="dying" from="Enemy" to="." method="_on_Enemy_dying"]

28
Levels/Level03.gd Normal file
View File

@ -0,0 +1,28 @@
extends Spatial
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
var enemycount = 5
onready var NEXTSCENE = "res://Test_Scene.tscn"
onready var WinMess = $Messages/Win
onready var EndTimer = $End
onready var HUD = $"Player/HUD/MenuLayer/Start"
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
func _on_Enemy_dying():
enemycount -= 1
if enemycount == 0:
WinMess.show()
EndTimer.start()
func _on_Win_timeout():
get_tree().change_scene(NEXTSCENE)

145
Levels/Level03.tscn Normal file
View File

@ -0,0 +1,145 @@
[gd_scene load_steps=10 format=2]
[ext_resource path="res://Levels/Level03.gd" type="Script" id=1]
[ext_resource path="res://Scenes/Enemy.tscn" type="PackedScene" id=3]
[ext_resource path="res://Player.tscn" type="PackedScene" id=5]
[ext_resource path="res://AllSkyFree_Skyboxes/Epic_BlueSunset_EquiRect_flat.png" type="Texture" id=6]
[ext_resource path="res://fonts/TorontoSubwayRegular.ttf" type="DynamicFontData" id=8]
[ext_resource path="res://Audio/DiJazz.ogg" type="AudioStream" id=9]
[sub_resource type="PanoramaSky" id=6]
panorama = ExtResource( 6 )
[sub_resource type="Environment" id=7]
background_mode = 2
background_sky = SubResource( 6 )
ambient_light_energy = 0.67
fog_enabled = true
fog_color = Color( 0.305882, 0.372549, 0.52549, 1 )
fog_sun_color = Color( 0.901961, 0.803922, 0.752941, 1 )
fog_sun_amount = 1.0
fog_depth_begin = 98.8
fog_depth_end = 1444.5
fog_depth_curve = 0.466516
fog_transmit_enabled = true
fog_transmit_curve = 0.659754
fog_height_enabled = true
fog_height_min = 148.2
fog_height_max = -48.0
fog_height_curve = 4.59481
ssao_radius = 8.1
ssao_intensity = 4.3
ssao_radius2 = 40.7
ssao_intensity2 = 14.6
ssao_bias = 0.059
ssao_color = Color( 0.180392, 0.207843, 0.25098, 1 )
glow_enabled = true
glow_intensity = 1.86
glow_strength = 0.87
glow_bloom = 0.02
glow_hdr_threshold = 0.44
glow_bicubic_upscale = true
[sub_resource type="DynamicFont" id=8]
size = 64
outline_size = 4
outline_color = Color( 0, 0, 0, 1 )
use_mipmaps = true
use_filter = true
font_data = ExtResource( 8 )
[node name="lvl3" type="Spatial"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.990751, 0 )
script = ExtResource( 1 )
[node name="CSGCombiner" type="CSGCombiner" parent="."]
transform = Transform( 1, 0, 0.000244346, 0, 1, 0, -0.000244346, 0, 1, 0, 0, 0 )
use_collision = true
[node name="CSGBox" type="CSGBox" parent="CSGCombiner"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.858472, -1.98215, 0.0803872 )
width = 28.7268
depth = 39.2853
[node name="CSGBox2" type="CSGBox" parent="CSGCombiner"]
transform = Transform( 0.999998, 0, 0, 0, 1, 0, 0, 0, 0.999998, -0.650235, -1.05012, 50.3919 )
width = 5.52827
depth = 31.9112
[node name="CSGBox3" type="CSGBox" parent="CSGCombiner"]
transform = Transform( 0.999998, 0, 0, 0, 1, 0, 0, 0, 0.999998, -0.739882, 6.73672, 50.3919 )
width = 5.52827
depth = 31.9112
[node name="CSGBox4" type="CSGBox" parent="CSGCombiner"]
transform = Transform( -0.00610858, 0.999981, -0.000245838, -0.999979, -0.00610863, -0.000244341, -0.000245838, 0.000244341, 0.999997, 4.43244, 2.53261, 50.3931 )
width = 5.52827
depth = 31.9112
[node name="CSGBox5" type="CSGBox" parent="CSGCombiner"]
transform = Transform( -0.00610858, 0.99998, -0.000245838, -0.999979, -0.00610863, -0.000244341, -0.000245838, 0.000244341, 0.999997, -5.21178, 2.53261, 50.3907 )
width = 5.52827
depth = 31.9112
[node name="Player" parent="." instance=ExtResource( 5 )]
transform = Transform( -0.997569, 0, -0.0696868, 0, 1, 0, 0.0696868, 0, -0.997569, 0.792524, 7.59106, -6.04147 )
[node name="WorldEnvironment_EpicBlueSky" type="WorldEnvironment" parent="."]
environment = SubResource( 7 )
[node name="DirectionalLight_EpicBlueSky" type="DirectionalLight" parent="."]
transform = Transform( 1, 0, 0, 0, 0.849579, 0.527461, 0, -0.527461, 0.849579, 0, 26.5368, 0 )
light_color = Color( 1, 0.924276, 0.869018, 1 )
light_specular = 1.0
shadow_enabled = true
[node name="Messages" type="Control" parent="."]
margin_right = 40.0
margin_bottom = 40.0
[node name="Win" type="Label" parent="Messages"]
visible = false
margin_left = 775.0
margin_top = 469.0
margin_right = 1187.0
margin_bottom = 627.0
custom_fonts/font = SubResource( 8 )
text = "You're Winner!"
[node name="End" type="Timer" parent="."]
wait_time = 3.0
[node name="Music" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 9 )
volume_db = -3.0
bus = "Music"
[node name="Enemy" parent="." instance=ExtResource( 3 )]
transform = Transform( 0.995641, 0, 0, 0, 0.995641, 0, 0, 0, 0.995641, -0.602382, 2.53295, 38.0864 )
[node name="Enemy2" parent="." instance=ExtResource( 3 )]
transform = Transform( 0.995641, 0, 0, 0, 0.995641, 0, 0, 0, 0.995641, -0.602382, 2.53295, 44.3578 )
[node name="Enemy3" parent="." instance=ExtResource( 3 )]
transform = Transform( 0.995641, 0, 0, 0, 0.995641, 0, 0, 0, 0.995641, -0.602382, 2.53295, 51.6479 )
[node name="Enemy4" parent="." instance=ExtResource( 3 )]
transform = Transform( 0.995641, 0, 0, 0, 0.995641, 0, 0, 0, 0.995641, -0.602382, 2.53295, 58.9016 )
[node name="Enemy5" parent="." instance=ExtResource( 3 )]
transform = Transform( 0.995641, 0, 0, 0, 0.995641, 0, 0, 0, 0.995641, -0.602382, 2.53295, 65.7735 )
[node name="Enemy6" parent="." instance=ExtResource( 3 )]
transform = Transform( 0.995641, 0, 0, 0, 0.995641, 0, 0, 0, 0.995641, -0.602382, 2.53295, 15.4607 )
[node name="Enemy7" parent="." instance=ExtResource( 3 )]
transform = Transform( 0.995641, 0, 0, 0, 0.995641, 0, 0, 0, 0.995641, -0.602382, 2.53295, -12.5044 )
[connection signal="timeout" from="End" to="." method="_on_Win_timeout"]
[connection signal="dying" from="Enemy" to="." method="_on_Enemy_dying"]
[connection signal="dying" from="Enemy2" to="." method="_on_Enemy_dying"]
[connection signal="dying" from="Enemy3" to="." method="_on_Enemy_dying"]
[connection signal="dying" from="Enemy4" to="." method="_on_Enemy_dying"]
[connection signal="dying" from="Enemy5" to="." method="_on_Enemy_dying"]
[connection signal="dying" from="Enemy6" to="." method="_on_Enemy_dying"]
[connection signal="dying" from="Enemy7" to="." method="_on_Enemy_dying"]

View File

@ -44,7 +44,7 @@ func get_slapped(slap_level, slap_kill, slap_vector):
func get_shot(hitboxOwner):
Explosion.play()
hitboxOwner.die()
#hitboxOwner.die()
die()
func die():

View File

@ -10,7 +10,7 @@ onready var CurrentLevel = $"Level"
onready var Levels = {
"lvl1": "Level 1 - What did the five fingers say to the face? SLAP!",
"lvl2": "Level 2 - Something in the way...",
"lvl3": "Level 3 - ",
"lvl3": "Level 3 - Ever seen Star Wars? No?",
"lvl4": "Level 4 - ",
"lvl5": "Level 5 - ",
"lvl6": "Level 6 - ",
@ -42,6 +42,8 @@ func _on_New_Game_pressed():
get_tree().paused = false
ingame = true
MMusic.stop()
if get_tree().get_current_scene().get_node("Music"):
get_tree().get_current_scene().get_node("Music").play()
func openMenu():
if (ingame):