diff --git a/assets/images/frivorun-logo.png b/assets/images/frivorun-logo.png new file mode 100644 index 0000000..53db45c Binary files /dev/null and b/assets/images/frivorun-logo.png differ diff --git a/assets/images/frivorun-logo.png.import b/assets/images/frivorun-logo.png.import new file mode 100644 index 0000000..7d96f2a --- /dev/null +++ b/assets/images/frivorun-logo.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/frivorun-logo.png-2e442f9ed1ff542792330270c65c1cfa.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/images/frivorun-logo.png" +dest_files=[ "res://.import/frivorun-logo.png-2e442f9ed1ff542792330270c65c1cfa.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=false +svg/scale=1.0 diff --git a/assets/images/green.png b/assets/images/green.png new file mode 100644 index 0000000..15af8f6 Binary files /dev/null and b/assets/images/green.png differ diff --git a/assets/images/green.png.import b/assets/images/green.png.import new file mode 100644 index 0000000..4c5567e --- /dev/null +++ b/assets/images/green.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/green.png-be7d19da866775dbf25faff88f58b11e.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/images/green.png" +dest_files=[ "res://.import/green.png-be7d19da866775dbf25faff88f58b11e.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/game/Game.gd b/game/Game.gd index d144d48..0463af4 100644 --- a/game/Game.gd +++ b/game/Game.gd @@ -12,5 +12,6 @@ func _ready(): # Called every frame. 'delta' is the elapsed time since the previous frame. -#func _process(delta): -# pass +func _process(delta): + + pass diff --git a/game/Game.tscn b/game/Game.tscn index d46136b..e0bf6cb 100644 --- a/game/Game.tscn +++ b/game/Game.tscn @@ -1,10 +1,11 @@ -[gd_scene load_steps=7 format=2] +[gd_scene load_steps=8 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/Pause.gd" type="Script" id=6] [sub_resource type="RectangleShape2D" id=1] extents = Vector2( 8, 8 ) @@ -12,13 +13,57 @@ extents = Vector2( 8, 8 ) [node name="World" type="Node2D"] script = ExtResource( 1 ) -[node name="Interface" parent="." instance=ExtResource( 2 )] +[node name="HUD" type="CanvasLayer" parent="."] + +[node name="Interface" parent="HUD" instance=ExtResource( 2 )] + +[node name="Pause" type="CanvasLayer" parent="."] + +[node name="Pause" type="Control" parent="Pause"] +pause_mode = 2 +visible = false +anchor_right = 1.0 +anchor_bottom = 1.0 +script = ExtResource( 6 ) + +[node name="Overlay" type="ColorRect" parent="Pause/Pause"] +anchor_right = 1.0 +anchor_bottom = 1.0 +color = Color( 0, 0, 0, 0.352941 ) + +[node name="CenterContainer" type="CenterContainer" parent="Pause/Pause/Overlay"] +anchor_right = 1.0 +anchor_bottom = 1.0 + +[node name="VBoxContainer" type="VBoxContainer" parent="Pause/Pause/Overlay/CenterContainer"] +margin_left = 608.0 +margin_top = 329.0 +margin_right = 672.0 +margin_bottom = 391.0 + +[node name="Label" type="Label" parent="Pause/Pause/Overlay/CenterContainer/VBoxContainer"] +margin_right = 64.0 +margin_bottom = 14.0 +text = "Paused" +align = 1 + +[node name="Resume" type="Button" parent="Pause/Pause/Overlay/CenterContainer/VBoxContainer"] +margin_top = 18.0 +margin_right = 64.0 +margin_bottom = 38.0 +text = "Resume" + +[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="TileMap" type="TileMap" parent="."] tile_set = ExtResource( 3 ) cell_size = Vector2( 16, 16 ) format = 1 -tile_data = PoolIntArray( 1966133, 0, 0, 1966134, 0, 0, 1966135, 0, 0, 1966136, 0, 0, 1966137, 0, 0, 1966138, 0, 0, 1966139, 0, 0, 1966140, 0, 0, 1966141, 0, 0, 1966142, 0, 0, 1966143, 0, 0, 1966144, 0, 0, 1966145, 0, 0, 1966146, 0, 0, 1966147, 0, 0, 1966148, 0, 0, 1966149, 0, 0, 1966150, 0, 0, 1966151, 0, 0, 1966152, 0, 0, 1966153, 0, 0, 1966154, 0, 0, 1966155, 0, 0, 1966156, 0, 0, 1966157, 0, 0, 1966158, 0, 0, 1966159, 0, 0, 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, 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 ) +tile_data = PoolIntArray( 2031662, 0, 0, 2031663, 0, 0, 2031664, 0, 0, 2031665, 0, 0, 2031666, 0, 0, 2031667, 0, 0, 2031668, 0, 0, 2031669, 0, 0, 2031670, 0, 0, 2031671, 0, 0, 2031672, 0, 0, 2031673, 0, 0, 2031674, 0, 0, 2031675, 0, 0, 2031676, 0, 0, 2031677, 0, 0, 2031678, 0, 0, 2031679, 0, 0, 2031680, 0, 0, 2031681, 0, 0, 2031682, 0, 0, 2031683, 0, 0, 2031684, 0, 0, 2031685, 0, 0, 2031686, 0, 0, 2031687, 0, 0, 2031688, 0, 0, 2031689, 0, 0, 2031690, 0, 0, 2031691, 0, 0, 2031692, 0, 0, 2031693, 0, 0, 2031694, 0, 0, 2031695, 0, 0, 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, 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 ) diff --git a/game/Interface.tscn b/game/Interface.tscn index 8efd082..fa0ea6e 100644 --- a/game/Interface.tscn +++ b/game/Interface.tscn @@ -11,13 +11,13 @@ margin_right = 67.0 margin_bottom = 40.0 [node name="FPS" type="Label" parent="VBoxContainer"] -margin_right = 67.0 +margin_right = 107.0 margin_bottom = 14.0 text = "FPS" script = ExtResource( 1 ) [node name="Money" type="Label" parent="VBoxContainer"] margin_top = 18.0 -margin_right = 67.0 +margin_right = 107.0 margin_bottom = 32.0 -text = "Money: $0" +text = "Money Spent: $0" diff --git a/game/Pause.gd b/game/Pause.gd new file mode 100644 index 0000000..eae0f5e --- /dev/null +++ b/game/Pause.gd @@ -0,0 +1,7 @@ +extends Control + +func _input(event): + if event.is_action_pressed("pause"): + var new_pause_state = not get_tree().paused + get_tree().paused = new_pause_state + visible = new_pause_state diff --git a/game/characters/player/Player.gd b/game/characters/player/Player.gd index f764015..ea87926 100644 --- a/game/characters/player/Player.gd +++ b/game/characters/player/Player.gd @@ -5,7 +5,7 @@ export var GRAVITY = 20 export var MAXFALLSPEED = 200 export var MAXSPEED = 80 export var JUMPFORCE = 300 -export var ACCEL = 10 +export var ACCEL = 20 var motion = Vector2() @@ -20,15 +20,23 @@ func _physics_process(_delta): if motion.y > MAXFALLSPEED: motion.y = MAXFALLSPEED - - if is_on_floor(): - if Input.is_action_just_released("jump"): - motion.y = -JUMPFORCE - pass - + motion.x = clamp(motion.x,-MAXSPEED,MAXSPEED) - motion.x += ACCEL + if Input.is_action_pressed("left"): + motion.x -= ACCEL + + elif Input.is_action_pressed("right"): + motion.x += ACCEL + else: + motion.x = lerp(motion.x,0,0.2) + + if is_on_floor(): + if Input.is_action_just_pressed("jump"): + motion.y = -JUMPFORCE + pass + + motion = move_and_slide(motion,UP) pass diff --git a/menu/Menu.tscn b/menu/Menu.tscn index 888312c..26c265d 100644 --- a/menu/Menu.tscn +++ b/menu/Menu.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=2] [ext_resource path="res://menu/Menu.gd" type="Script" id=1] -[ext_resource path="res://assets/images/text236.png" type="Texture" id=2] +[ext_resource path="res://assets/images/frivorun-logo.png" type="Texture" id=2] [node name="Menu" type="MarginContainer"] anchor_right = 1.0 @@ -15,51 +15,51 @@ margin_right = 1280.0 margin_bottom = 720.0 [node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"] -margin_left = 429.0 -margin_top = 272.0 -margin_right = 850.0 -margin_bottom = 448.0 +margin_left = 408.0 +margin_top = 223.0 +margin_right = 871.0 +margin_bottom = 497.0 [node name="Logo" type="TextureRect" parent="CenterContainer/VBoxContainer"] -margin_right = 421.0 -margin_bottom = 60.0 +margin_right = 463.0 +margin_bottom = 158.0 texture = ExtResource( 2 ) [node name="Play" type="Button" parent="CenterContainer/VBoxContainer"] -margin_top = 64.0 -margin_right = 421.0 -margin_bottom = 84.0 +margin_top = 162.0 +margin_right = 463.0 +margin_bottom = 182.0 text = "Play" [node name="Credits" type="Button" parent="CenterContainer/VBoxContainer"] -margin_top = 88.0 -margin_right = 421.0 -margin_bottom = 108.0 +margin_top = 186.0 +margin_right = 463.0 +margin_bottom = 206.0 text = "Credits" [node name="Quit" type="Button" parent="CenterContainer/VBoxContainer"] -margin_top = 112.0 -margin_right = 421.0 -margin_bottom = 132.0 +margin_top = 210.0 +margin_right = 463.0 +margin_bottom = 230.0 text = "Quit" [node name="HSeparator" type="HSeparator" parent="CenterContainer/VBoxContainer"] modulate = Color( 1, 1, 1, 0 ) -margin_top = 136.0 -margin_right = 421.0 -margin_bottom = 140.0 +margin_top = 234.0 +margin_right = 463.0 +margin_bottom = 238.0 [node name="About" type="Label" parent="CenterContainer/VBoxContainer"] -margin_top = 144.0 -margin_right = 421.0 -margin_bottom = 158.0 +margin_top = 242.0 +margin_right = 463.0 +margin_bottom = 256.0 text = "Made for the bits & Bytes Unofficial Game Jam! August 2022." align = 1 [node name="Copyright" type="Label" parent="CenterContainer/VBoxContainer"] -margin_top = 162.0 -margin_right = 421.0 -margin_bottom = 176.0 +margin_top = 260.0 +margin_right = 463.0 +margin_bottom = 274.0 text = "(c) Copyright 2022 Andrew Lee. Powered by the Godot Engine." align = 1 diff --git a/project.godot b/project.godot index 981a2f3..76411f1 100644 --- a/project.godot +++ b/project.godot @@ -28,6 +28,21 @@ jump={ "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"physical_scancode":0,"unicode":0,"echo":false,"script":null) ] } +right={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"physical_scancode":0,"unicode":0,"echo":false,"script":null) + ] +} +left={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"physical_scancode":0,"unicode":0,"echo":false,"script":null) + ] +} +pause={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777217,"physical_scancode":0,"unicode":0,"echo":false,"script":null) + ] +} [physics]