diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2022-08-12 22:58:33 -0400 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2022-08-12 22:58:33 -0400 |
| commit | 9541a472e0b38369d169ad3f7bb250a8127bc471 (patch) | |
| tree | 10ef75d83509de9af6110936f4bf8dd37751265e /game | |
| parent | e47a732cb6b9a117faf7662170ced55e86da4add (diff) | |
| download | frivolous-run-9541a472e0b38369d169ad3f7bb250a8127bc471.tar.gz frivolous-run-9541a472e0b38369d169ad3f7bb250a8127bc471.tar.bz2 frivolous-run-9541a472e0b38369d169ad3f7bb250a8127bc471.zip | |
Added new music; Victor
Diffstat (limited to 'game')
| -rw-r--r-- | game/Game.gd | 13 | ||||
| -rw-r--r-- | game/Game.tscn | 74 | ||||
| -rw-r--r-- | game/Pause.gd | 5 | ||||
| -rw-r--r-- | game/characters/player/Player.tscn | 35 | ||||
| -rw-r--r-- | game/characters/victor/Victor.gd | 7 | ||||
| -rw-r--r-- | game/characters/victor/Victor.tscn | 14 | ||||
| -rw-r--r-- | game/objects/Shop.tscn | 16 |
7 files changed, 105 insertions, 59 deletions
diff --git a/game/Game.gd b/game/Game.gd index 2bf346f..4ce8957 100644 --- a/game/Game.gd +++ b/game/Game.gd @@ -1,18 +1,5 @@ extends Node2D - -# Declare member variables here. Examples: -# var a = 2 -# var b = "text" - - -# Called when the node enters the scene tree for the first time. func _ready(): pass # Replace with function body. - - -# Called every frame. 'delta' is the elapsed time since the previous frame. -#func _process(delta): - -# pass diff --git a/game/Game.tscn b/game/Game.tscn index ccfd590..fa51378 100644 --- a/game/Game.tscn +++ b/game/Game.tscn @@ -1,23 +1,22 @@ -[gd_scene load_steps=9 format=2] +[gd_scene load_steps=10 format=2] [ext_resource path="res://game/Game.gd" type="Script" id=1] [ext_resource path="res://game/Interface.tscn" type="PackedScene" id=2] [ext_resource path="res://assets/tilemap.tres" type="TileSet" id=3] -[ext_resource path="res://assets/images/white.png" type="Texture" id=4] -[ext_resource path="res://game/characters/player/Player.gd" type="Script" id=5] +[ext_resource path="res://game/characters/player/Player.tscn" type="PackedScene" id=4] +[ext_resource path="res://game/characters/victor/Victor.tscn" type="PackedScene" id=5] [ext_resource path="res://game/Pause.gd" type="Script" id=6] [ext_resource path="res://assets/audio/Happy Bee.mp3" type="AudioStream" id=7] - -[sub_resource type="RectangleShape2D" id=1] -extents = Vector2( 8, 8 ) +[ext_resource path="res://game/objects/Shop.tscn" type="PackedScene" id=8] +[ext_resource path="res://game/characters/victor/Victor.gd" type="Script" id=9] [node name="World" type="Node2D"] script = ExtResource( 1 ) [node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."] -pause_mode = 2 stream = ExtResource( 7 ) autoplay = true +bus = "Music" [node name="HUD" type="CanvasLayer" parent="."] @@ -59,35 +58,66 @@ margin_right = 64.0 margin_bottom = 38.0 text = "Resume" +[node name="Mute" type="Button" parent="Pause/Pause/Overlay/CenterContainer/VBoxContainer"] +visible = false +margin_right = 12.0 +margin_bottom = 20.0 +text = "Mute" + [node name="Quit" type="Button" parent="Pause/Pause/Overlay/CenterContainer/VBoxContainer"] margin_top = 42.0 margin_right = 64.0 margin_bottom = 62.0 text = "Quit" +[node name="Game Over" type="CanvasLayer" parent="."] + +[node name="Game Over" type="Control" parent="Game Over"] +pause_mode = 2 +visible = false +anchor_right = 1.0 +anchor_bottom = 1.0 + +[node name="Overlay" type="ColorRect" parent="Game Over/Game Over"] +anchor_right = 1.0 +anchor_bottom = 1.0 +color = Color( 0, 0, 0, 0.352941 ) + +[node name="CenterContainer" type="CenterContainer" parent="Game Over/Game Over/Overlay"] +anchor_right = 1.0 +anchor_bottom = 1.0 + +[node name="VBoxContainer" type="VBoxContainer" parent="Game Over/Game Over/Overlay/CenterContainer"] +margin_left = 461.0 +margin_top = 344.0 +margin_right = 818.0 +margin_bottom = 375.0 + +[node name="Label" type="Label" parent="Game Over/Game Over/Overlay/CenterContainer/VBoxContainer"] +margin_right = 357.0 +margin_bottom = 31.0 +text = "Game Over! +Victor has banned you from b&B for taking his Up card..." +align = 1 + [node name="TileMap" type="TileMap" parent="."] tile_set = ExtResource( 3 ) cell_size = Vector2( 16, 16 ) +bake_navigation = true format = 1 tile_data = PoolIntArray( 2424870, 0, 0, 2424871, 0, 0, 2424872, 0, 0, 2424873, 0, 0, 2424874, 0, 0, 2424875, 0, 0, 2424876, 0, 0, 2424877, 0, 0, 2424878, 0, 0, 2424879, 0, 0, 2424880, 0, 0, 2424881, 0, 0, 2424882, 0, 0, 2424883, 0, 0, 2424884, 0, 0, 2424885, 0, 0, 2424886, 0, 0, 2424887, 0, 0, 2424888, 0, 0, 2424889, 0, 0, 2424890, 0, 0, 2424891, 0, 0, 2424892, 0, 0, 2424893, 0, 0, 2424894, 0, 0, 2424895, 0, 0, 2424896, 0, 0, 2424897, 0, 0, 2424898, 0, 0, 2424899, 0, 0, 2424900, 0, 0, 2424901, 0, 0, 2424902, 0, 0, 2424903, 0, 0, 2424904, 0, 0, 2424905, 0, 0, 2424906, 0, 0, 2424907, 0, 0, 2424908, 0, 0, 2424909, 0, 0, 2424910, 0, 0, 2424911, 0, 0, 2818048, 0, 0, 2818049, 0, 0, 2818050, 0, 0, 2818051, 0, 0, 2818052, 0, 0, 2818053, 0, 0, 2818054, 0, 0, 2818055, 0, 0, 2818056, 0, 0, 2818057, 0, 0, 2818058, 0, 0, 2818059, 0, 0, 2818060, 0, 0, 2818061, 0, 0, 2818062, 0, 0, 2818063, 0, 0, 2818064, 0, 0, 2818065, 0, 0, 2818066, 0, 0, 2818067, 0, 0, 2818068, 0, 0, 2818069, 0, 0, 2818070, 0, 0, 2818071, 0, 0, 2818072, 0, 0, 2818073, 0, 0, 2818074, 0, 0, 2818075, 0, 0, 2818076, 0, 0, 2818077, 0, 0, 2818078, 0, 0, 2818079, 0, 0, 2818080, 0, 0, 2818081, 0, 0, 2818082, 0, 0, 2818083, 0, 0, 2818084, 0, 0, 2818085, 0, 0, 2818086, 0, 0, 2818087, 0, 0, 2818088, 0, 0, 2818089, 0, 0, 2818090, 0, 0, 2818091, 0, 0, 2818092, 0, 0, 2818093, 0, 0, 2818094, 0, 0, 2818095, 0, 0, 2818096, 0, 0, 2818097, 0, 0, 2818098, 0, 0, 2818099, 0, 0, 2818100, 0, 0, 2818101, 0, 0, 2818102, 0, 0, 2818103, 0, 0, 2818104, 0, 0, 2818105, 0, 0, 2818106, 0, 0, 2818107, 0, 0, 2818108, 0, 0, 2818109, 0, 0, 2818110, 0, 0, 2818111, 0, 0, 2818112, 0, 0, 2818113, 0, 0, 2818114, 0, 0, 2818115, 0, 0, 2818116, 0, 0, 2818117, 0, 0, 2818118, 0, 0, 2818119, 0, 0, 2818120, 0, 0, 2818121, 0, 0, 2818122, 0, 0, 2818123, 0, 0, 2818124, 0, 0, 2818125, 0, 0, 2818126, 0, 0, 2818127, 0, 0, 2883584, 0, 0, 2883585, 0, 0, 2883586, 0, 0, 2883587, 0, 0, 2883588, 0, 0, 2883589, 0, 0, 2883590, 0, 0, 2883591, 0, 0, 2883592, 0, 0, 2883593, 0, 0, 2883594, 0, 0, 2883595, 0, 0, 2883596, 0, 0, 2883597, 0, 0, 2883598, 0, 0, 2883599, 0, 0, 2883600, 0, 0, 2883601, 0, 0, 2883602, 0, 0, 2883603, 0, 0, 2883604, 0, 0, 2883605, 0, 0, 2883606, 0, 0, 2883607, 0, 0, 2883608, 0, 0, 2883609, 0, 0, 2883610, 0, 0, 2883611, 0, 0, 2883612, 0, 0, 2883613, 0, 0, 2883614, 0, 0, 2883615, 0, 0, 2883616, 0, 0, 2883617, 0, 0, 2883618, 0, 0, 2883619, 0, 0, 2883620, 0, 0, 2883621, 0, 0, 2883622, 0, 0, 2883623, 0, 0, 2883624, 0, 0, 2883625, 0, 0, 2883626, 0, 0, 2883627, 0, 0, 2883628, 0, 0, 2883629, 0, 0, 2883630, 0, 0, 2883631, 0, 0, 2883632, 0, 0, 2883633, 0, 0, 2883634, 0, 0, 2883635, 0, 0, 2883636, 0, 0, 2883637, 0, 0, 2883638, 0, 0, 2883639, 0, 0, 2883640, 0, 0, 2883641, 0, 0, 2883642, 0, 0, 2883643, 0, 0, 2883644, 0, 0, 2883645, 0, 0, 2883646, 0, 0, 2883647, 0, 0, 2883648, 0, 0, 2883649, 0, 0, 2883650, 0, 0, 2883651, 0, 0, 2883652, 0, 0, 2883653, 0, 0, 2883654, 0, 0, 2883655, 0, 0, 2883656, 0, 0, 2883657, 0, 0, 2883658, 0, 0, 2883659, 0, 0, 2883660, 0, 0, 2883661, 0, 0, 2883662, 0, 0, 2883663, 0, 0 ) -[node name="Player" type="KinematicBody2D" parent="."] -position = Vector2( 50, 600 ) -script = ExtResource( 5 ) -MAXSPEED = 200 -JUMPFORCE = 500 -ACCEL = 100 - -[node name="Sprite" type="Sprite" parent="Player"] -texture = ExtResource( 4 ) +[node name="Player" parent="." instance=ExtResource( 4 )] -[node name="CollisionShape2D" type="CollisionShape2D" parent="Player"] -shape = SubResource( 1 ) +[node name="Shop" parent="." instance=ExtResource( 8 )] +light_mask = 3 +position = Vector2( 478, 673 ) +scale = Vector2( 2.61361, 1.88 ) -[node name="Camera2D" type="Camera2D" parent="Player"] -current = true -zoom = Vector2( 0.5, 0.5 ) -smoothing_enabled = true +[node name="Victor" parent="." instance=ExtResource( 5 )] +position = Vector2( 8, 680 ) +script = ExtResource( 9 ) [connection signal="pressed" from="Pause/Pause/Overlay/CenterContainer/VBoxContainer/Resume" to="Pause/Pause" method="_on_Resume_pressed"] +[connection signal="pressed" from="Pause/Pause/Overlay/CenterContainer/VBoxContainer/Mute" to="Pause/Pause" method="_on_Mute_pressed"] [connection signal="pressed" from="Pause/Pause/Overlay/CenterContainer/VBoxContainer/Quit" to="Pause/Pause" method="_on_Quit_pressed"] diff --git a/game/Pause.gd b/game/Pause.gd index ccdf132..e04e94d 100644 --- a/game/Pause.gd +++ b/game/Pause.gd @@ -12,6 +12,11 @@ func _on_Resume_pressed(): get_tree().paused = new_pause_state visible = new_pause_state +func _on_Mute_pressed(): + var player = get_node("../../AudioStreamPlayer") + var player_paused = not player.stream_paused + player.stream_paused = player_paused func _on_Quit_pressed(): get_tree().quit() + diff --git a/game/characters/player/Player.tscn b/game/characters/player/Player.tscn index a7ee0e4..3a3bba7 100644 --- a/game/characters/player/Player.tscn +++ b/game/characters/player/Player.tscn @@ -1,38 +1,25 @@ [gd_scene load_steps=4 format=2] +[ext_resource path="res://game/characters/player/Player.gd" type="Script" id=1] [ext_resource path="res://assets/images/white.png" type="Texture" id=2] -[sub_resource type="GDScript" id=2] -script/source = "extends KinematicBody2D - - -# Declare member variables here. Examples: -# var a = 2 -# var b = \"text\" - - -# Called when the node enters the scene tree for the first time. -func _ready(): - pass # Replace with function body. - - -# Called every frame. 'delta' is the elapsed time since the previous frame. -#func _process(delta): -# pass -" - [sub_resource type="RectangleShape2D" id=1] -extents = Vector2( 160, 160 ) +extents = Vector2( 8, 8 ) [node name="Player" type="KinematicBody2D"] -script = SubResource( 2 ) +position = Vector2( 50, 600 ) +script = ExtResource( 1 ) +MAXSPEED = 200 +JUMPFORCE = 500 +ACCEL = 100 -[node name="White" type="Sprite" parent="."] -position = Vector2( -4.76837e-07, 0 ) -scale = Vector2( 20, 20 ) +[node name="Sprite" type="Sprite" parent="."] texture = ExtResource( 2 ) [node name="CollisionShape2D" type="CollisionShape2D" parent="."] shape = SubResource( 1 ) [node name="Camera2D" type="Camera2D" parent="."] +current = true +zoom = Vector2( 0.5, 0.5 ) +smoothing_enabled = true diff --git a/game/characters/victor/Victor.gd b/game/characters/victor/Victor.gd new file mode 100644 index 0000000..7d8259f --- /dev/null +++ b/game/characters/victor/Victor.gd @@ -0,0 +1,7 @@ +extends KinematicBody2D + +var speed = 100 +var velocity = Vector2(0, 0) + +func _physics_process(_delta): + pass diff --git a/game/characters/victor/Victor.tscn b/game/characters/victor/Victor.tscn new file mode 100644 index 0000000..1cd8f7a --- /dev/null +++ b/game/characters/victor/Victor.tscn @@ -0,0 +1,14 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://assets/images/blue.png" type="Texture" id=1] + +[sub_resource type="RectangleShape2D" id=1] +extents = Vector2( 8, 8 ) + +[node name="Victor" type="KinematicBody2D"] + +[node name="Sprite" type="Sprite" parent="."] +texture = ExtResource( 1 ) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource( 1 ) diff --git a/game/objects/Shop.tscn b/game/objects/Shop.tscn new file mode 100644 index 0000000..c34640d --- /dev/null +++ b/game/objects/Shop.tscn @@ -0,0 +1,16 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://assets/images/green.png" type="Texture" id=1] + +[sub_resource type="RectangleShape2D" id=1] +extents = Vector2( 8, 8 ) + +[node name="Shop" type="Node2D"] + +[node name="Sprite" type="Sprite" parent="."] +texture = ExtResource( 1 ) + +[node name="Area2D" type="Area2D" parent="."] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] +shape = SubResource( 1 ) |
