feat: New Frog Free Button, More Air Movement
This commit is contained in:
parent
4fd7452f94
commit
3c2119a57d
BIN
assets/meta/digits.aseprite
Normal file
BIN
assets/meta/digits.aseprite
Normal file
Binary file not shown.
BIN
assets/meta/digits.png
Normal file
BIN
assets/meta/digits.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 149 B |
35
assets/meta/digits.png.import
Normal file
35
assets/meta/digits.png.import
Normal file
@ -0,0 +1,35 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/digits.png-dccee9e093127045b68cbe3ebaf19aa0.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/meta/digits.png"
|
||||
dest_files=[ "res://.import/digits.png-dccee9e093127045b68cbe3ebaf19aa0.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=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=false
|
||||
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
|
||||
@ -27,8 +27,8 @@ var init_acceleration_force := {
|
||||
# newtonmeters is the unit
|
||||
var acceleration_force := {
|
||||
"walk": Vector2(1800, 1233),
|
||||
"fall": Vector2(0, 0),
|
||||
"jump": Vector2(0, 0),
|
||||
"fall": Vector2(2000, 0),
|
||||
"jump": Vector2(2000, 0),
|
||||
"idle": Vector2(1800, 1233),
|
||||
"duck": Vector2(500, 1400),
|
||||
"run": Vector2(2500, 1290),
|
||||
|
||||
@ -286,8 +286,13 @@ func calculate_jump_velocity(
|
||||
linear_velocity.y += _gravity * delta
|
||||
|
||||
# TODO This is poop too
|
||||
if -20 < velocity.x and velocity.x < 20:
|
||||
linear_velocity.x += inair_velocity * direction.x
|
||||
if -45 < velocity.x and direction.x < 0 || \
|
||||
45 > velocity.x and direction.x > 0:
|
||||
linear_velocity.x = PhysicsFunc.two_step_euler(
|
||||
linear_velocity.x, acceleration_force[state].x * direction.x,
|
||||
mass,
|
||||
delta
|
||||
)
|
||||
|
||||
if is_correct_airstrafe_input():
|
||||
linear_velocity = execute_airstrafe(linear_velocity, delta, direction)
|
||||
@ -299,15 +304,21 @@ func calculate_jump_velocity(
|
||||
func calculate_fall_velocity(
|
||||
linear_velocity: Vector2, delta: float, direction: Vector2
|
||||
) -> Vector2:
|
||||
var state = player_state_machine.state
|
||||
if velocity.y < max_velocity["fall"]:
|
||||
linear_velocity.y = PhysicsFunc.two_step_euler(
|
||||
linear_velocity.y, _gravity * mass, mass, delta
|
||||
)
|
||||
else:
|
||||
linear_velocity.y = max_velocity["fall"]
|
||||
if -10 < velocity.x and velocity.x < 10:
|
||||
if -45 < velocity.x and direction.x < 0 || \
|
||||
45 > velocity.x and direction.x > 0:
|
||||
# TODO This is poop
|
||||
linear_velocity.x += inair_velocity * direction.x
|
||||
linear_velocity.x = PhysicsFunc.two_step_euler(
|
||||
linear_velocity.x, acceleration_force[state].x * direction.x,
|
||||
mass,
|
||||
delta
|
||||
)
|
||||
if Input.is_action_just_pressed("jump"):
|
||||
jump_buffer_filled = true
|
||||
if is_correct_airstrafe_input():
|
||||
|
||||
@ -286,11 +286,11 @@ states/idleTurn/position = Vector2( 1375.54, -193.991 )
|
||||
states/idling/node = SubResource( 116 )
|
||||
states/idling/position = Vector2( 1375.63, -53.9546 )
|
||||
states/jumpToFall/node = SubResource( 119 )
|
||||
states/jumpToFall/position = Vector2( 1795.36, 322.199 )
|
||||
states/jumpToFall/position = Vector2( 1981.07, 404.104 )
|
||||
states/jumping/node = SubResource( 125 )
|
||||
states/jumping/position = Vector2( 1375.54, 117.961 )
|
||||
states/runToJump/node = SubResource( 146 )
|
||||
states/runToJump/position = Vector2( 2191.5, 650.286 )
|
||||
states/runToJump/position = Vector2( 2194.36, 651.238 )
|
||||
states/running/node = SubResource( 122 )
|
||||
states/running/position = Vector2( 2273.2, -53.7278 )
|
||||
states/turnToRun/node = SubResource( 130 )
|
||||
@ -303,7 +303,7 @@ states/wallsliding/node = SubResource( 96 )
|
||||
states/wallsliding/position = Vector2( 1795.54, 493.009 )
|
||||
transitions = [ "falling", "wallsliding", SubResource( 138 ), "wallsliding", "idling", SubResource( 139 ), "wallsliding", "wallslideToJump", SubResource( 140 ), "wallslideToJump", "jumping", SubResource( 141 ), "idling", "jumping", SubResource( 147 ), "runToJump", "jumping", SubResource( 148 ), "ducking", "jumping", SubResource( 149 ), "jumping", "jumpToFall", SubResource( 150 ), "jumpToFall", "falling", SubResource( 151 ), "ducking", "duckTurn", SubResource( 152 ), "duckTurn", "ducking", SubResource( 153 ), "falling", "ducking", SubResource( 154 ), "ducking", "falling", SubResource( 155 ), "ducking", "walking", SubResource( 156 ), "walking", "ducking", SubResource( 157 ), "idling", "ducking", SubResource( 158 ), "ducking", "idling", SubResource( 159 ), "ducking", "running", SubResource( 160 ), "running", "ducking", SubResource( 161 ), "running", "falling", SubResource( 162 ), "falling", "running", SubResource( 163 ), "walking", "falling", SubResource( 164 ), "falling", "walking", SubResource( 165 ), "falling", "idling", SubResource( 166 ), "idling", "walking", SubResource( 167 ), "walking", "idling", SubResource( 168 ), "walking", "turnToRun", SubResource( 169 ), "turnToRun", "walking", SubResource( 170 ), "running", "turnToRun", SubResource( 171 ), "turnToRun", "running", SubResource( 172 ), "idling", "idleTurn", SubResource( 173 ), "walking", "idleTurn", SubResource( 174 ), "idleTurn", "walking", SubResource( 175 ), "idling", "turnToRun", SubResource( 176 ), "turnToRun", "idling", SubResource( 177 ), "running", "runToJump", SubResource( 178 ), "wallsliding", "falling", SubResource( 137 ), "jumping", "wallsliding", SubResource( 189 ), "jumping", "idling", SubResource( 193 ), "jumping", "walking", SubResource( 194 ), "runToJump", "wallsliding", SubResource( 195 ), "jumpToFall", "idling", SubResource( 196 ) ]
|
||||
start_node = "idling"
|
||||
graph_offset = Vector2( 1105.54, -34.431 )
|
||||
graph_offset = Vector2( 1078.54, -151.431 )
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachinePlayback" id=48]
|
||||
|
||||
|
||||
@ -53,7 +53,7 @@ func disconnect_rope() -> void:
|
||||
rope.spawn_rope(anchor.global_position, $RopeAnchor.global_position, movement_radius, false)
|
||||
|
||||
|
||||
func _on_WhyButton_button_pushed() -> void:
|
||||
func _on_FrogFreeButton_pushed() -> void:
|
||||
$WhatAreFrog.levelState.frees += 1
|
||||
$WhatAreFrog.is_bound = false
|
||||
disconnect_rope()
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
[gd_scene load_steps=46 format=2]
|
||||
[gd_scene load_steps=47 format=2]
|
||||
|
||||
[ext_resource path="res://assets/enemy/froshler.png" type="Texture" id=1]
|
||||
[ext_resource path="res://src/Actors/Enemies/Beings/WhatAreFrog.gd" type="Script" id=2]
|
||||
[ext_resource path="res://src/Actors/Enemies/Beings/WhatAreFrogStateMachine.gd" type="Script" id=3]
|
||||
[ext_resource path="res://assets/meta/new_dynamicfont.tres" type="DynamicFont" id=4]
|
||||
[ext_resource path="res://assets/meta/digits.png" type="Texture" id=5]
|
||||
|
||||
[sub_resource type="Animation" id=5]
|
||||
length = 0.001
|
||||
@ -453,13 +454,19 @@ text = "Ihre Werbung"
|
||||
align = 1
|
||||
valign = 1
|
||||
|
||||
[node name="Digit" type="Sprite" parent="."]
|
||||
position = Vector2( 0, -3 )
|
||||
z_index = 1
|
||||
texture = ExtResource( 5 )
|
||||
hframes = 10
|
||||
|
||||
[node name="FrogSprite" type="Sprite" parent="."]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2( 0, -7 )
|
||||
scale = Vector2( -1, 1 )
|
||||
texture = ExtResource( 1 )
|
||||
hframes = 2
|
||||
vframes = 4
|
||||
frame = 1
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="FrogSprite"]
|
||||
anims/RESET = SubResource( 5 )
|
||||
@ -480,11 +487,11 @@ anim_player = NodePath("../AnimationPlayer")
|
||||
active = true
|
||||
root_motion_track = NodePath(".:frame")
|
||||
parameters/playback = SubResource( 11 )
|
||||
parameters/idleHappy/blend_position = -1.00141
|
||||
parameters/idleMean/blend_position = 1.0
|
||||
parameters/idleHappy/blend_position = 1.0
|
||||
parameters/idleMean/blend_position = 0.999614
|
||||
parameters/liftOff/blend_position = 1.0
|
||||
parameters/midJumping/blend_position = 1.0
|
||||
parameters/sleeping/blend_position = 0.998762
|
||||
parameters/sleeping/blend_position = 1.0
|
||||
|
||||
[node name="VisibilityEnabler2D" type="VisibilityEnabler2D" parent="."]
|
||||
position = Vector2( 954, 0 )
|
||||
|
||||
@ -1,6 +1,10 @@
|
||||
extends Node
|
||||
|
||||
var progress_dict := {} setget set_progress
|
||||
var wallet := 0 setget set_wallet
|
||||
|
||||
func set_progress(value) -> void:
|
||||
progress_dict = value
|
||||
|
||||
func set_wallet(value) -> void:
|
||||
wallet = value
|
||||
|
||||
34
src/Contraptions/Triggers/FrogFreeButton.gd
Normal file
34
src/Contraptions/Triggers/FrogFreeButton.gd
Normal file
@ -0,0 +1,34 @@
|
||||
extends Node2D
|
||||
|
||||
signal button_pushed
|
||||
|
||||
onready var activatorArea = $"%ActivatorArea"
|
||||
onready var indicatorPlayer = $"%IndicatorPlayer"
|
||||
onready var elevator = get_node("./Portal")
|
||||
onready var signalManager := get_tree().root.get_child(1).get_node("%SignalManager")
|
||||
onready var unactivatable_timer := $Timer
|
||||
|
||||
var activatable = false
|
||||
|
||||
func _process(delta):
|
||||
if activatable && Input.is_action_just_released("interact"):
|
||||
selfActivate()
|
||||
signalManager.emit_signal("button_pushed")
|
||||
|
||||
|
||||
func selfActivate():
|
||||
indicatorPlayer.play("onning")
|
||||
#TODO dis importante
|
||||
activatorArea.set_deferred("monitoring", false)
|
||||
|
||||
|
||||
func _on_ActivatorArea_area_entered(area:Area2D) -> void:
|
||||
$Label.visible = true
|
||||
activatable = true
|
||||
|
||||
func _on_ActivatorArea_area_exited(area:Area2D) -> void:
|
||||
unactivatable_timer.start()
|
||||
|
||||
func _on_Timer_timeout():
|
||||
$Label.visible = false
|
||||
activatable = false
|
||||
94
src/Contraptions/Triggers/FrogFreeButton.tscn
Normal file
94
src/Contraptions/Triggers/FrogFreeButton.tscn
Normal file
@ -0,0 +1,94 @@
|
||||
[gd_scene load_steps=8 format=2]
|
||||
|
||||
[ext_resource path="res://src/Contraptions/Triggers/FrogFreeButton.gd" type="Script" id=1]
|
||||
[ext_resource path="res://assets/contraption/freeButton.png" type="Texture" id=2]
|
||||
[ext_resource path="res://assets/contraption/freeButtonSlider.png" type="Texture" id=3]
|
||||
[ext_resource path="res://assets/meta/digits.png" type="Texture" id=4]
|
||||
|
||||
[sub_resource type="Animation" id=19]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath(".:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( 0, -7 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=13]
|
||||
resource_name = "onning"
|
||||
length = 0.809
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath(".:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.8 ),
|
||||
"transitions": PoolRealArray( 1, 2.73207 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( 0, -7 ), Vector2( 0, 7 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="CircleShape2D" id=18]
|
||||
radius = 18.0
|
||||
|
||||
[node name="FrogFreeButton" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Button" type="Sprite" parent="."]
|
||||
texture = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_editor_description_": "YXNlcHJpdGVfd2l6YXJkX2NvbmZpZwpwbGF5ZXJ8PVNwcml0ZS9BbmltYXRpb25QbGF5ZXIKc291cmNlfD1yZXM6Ly9hc3NldHMvbmV1dHJhbCBvYmplY3QvYnV0dG9uLmFzZXByaXRlCmxheWVyfD0Kb3BfZXhwfD1GYWxzZQpvX2ZvbGRlcnw9Cm9fbmFtZXw9Cm9ubHlfdmlzaWJsZXw9RmFsc2UKb19leF9wfD0K"
|
||||
}
|
||||
|
||||
[node name="Digit" type="Sprite" parent="."]
|
||||
position = Vector2( 0.5, 0.5 )
|
||||
z_index = 1
|
||||
texture = ExtResource( 4 )
|
||||
hframes = 10
|
||||
|
||||
[node name="Indicator" type="Sprite" parent="."]
|
||||
position = Vector2( 0, -7 )
|
||||
z_index = 1
|
||||
texture = ExtResource( 3 )
|
||||
__meta__ = {
|
||||
"_editor_description_": "YXNlcHJpdGVfd2l6YXJkX2NvbmZpZwpwbGF5ZXJ8PUluZGljYXRvcjIvQW5pbWF0aW9uUGxheWVyCnNvdXJjZXw9cmVzOi8vYXNzZXRzL25ldXRyYWwgb2JqZWN0L2J1dHRvblN0YXRlSW5kaWNhdG9yLmFzZXByaXRlCmxheWVyfD0Kb3BfZXhwfD1GYWxzZQpvX2ZvbGRlcnw9Cm9fbmFtZXw9Cm9ubHlfdmlzaWJsZXw9RmFsc2UKb19leF9wfD0K"
|
||||
}
|
||||
|
||||
[node name="IndicatorPlayer" type="AnimationPlayer" parent="Indicator"]
|
||||
unique_name_in_owner = true
|
||||
anims/RESET = SubResource( 19 )
|
||||
anims/onning = SubResource( 13 )
|
||||
|
||||
[node name="ActivatorArea" type="Area2D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
collision_layer = 0
|
||||
monitorable = false
|
||||
|
||||
[node name="ActivatorAreaShape" type="CollisionShape2D" parent="ActivatorArea"]
|
||||
unique_name_in_owner = true
|
||||
shape = SubResource( 18 )
|
||||
|
||||
[node name="Timer" type="Timer" parent="."]
|
||||
wait_time = 0.333
|
||||
one_shot = true
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
visible = false
|
||||
margin_left = -5.0
|
||||
margin_top = -26.0
|
||||
margin_right = 13.0
|
||||
margin_bottom = -12.0
|
||||
rect_scale = Vector2( 0.590909, 0.627907 )
|
||||
text = "[e]"
|
||||
|
||||
[connection signal="area_entered" from="ActivatorArea" to="." method="_on_ActivatorArea_area_entered"]
|
||||
[connection signal="area_exited" from="ActivatorArea" to="." method="_on_ActivatorArea_area_exited"]
|
||||
[connection signal="timeout" from="Timer" to="." method="_on_Timer_timeout"]
|
||||
@ -5,15 +5,17 @@ onready var signalManager := get_tree().root.get_child(1).get_node("%SignalManag
|
||||
onready var levelState := get_tree().root.get_child(1).get_node("%LevelState")
|
||||
onready var blobby := $"../%Blobby"
|
||||
onready var unactivatable_timer := $Timer
|
||||
export var cost := 3
|
||||
|
||||
var activatable = false
|
||||
|
||||
|
||||
func _process(delta):
|
||||
# TODO Global currency count?? Maybe just level intern currency
|
||||
if activatable && Input.is_action_just_released("interact") && levelState.currency >= 3:
|
||||
levelState.currency -= 3
|
||||
selfActivate()
|
||||
if activatable && Input.is_action_just_released("interact"):
|
||||
if(levelState.spend_currency(cost)):
|
||||
signalManager.emit_signal("currency_updated")
|
||||
selfActivate()
|
||||
|
||||
func selfActivate():
|
||||
#TODO Is a event for blobby himself
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=17 format=2]
|
||||
[gd_scene load_steps=18 format=2]
|
||||
|
||||
[ext_resource path="res://src/Environment/AlienShipTileSet.tres" type="TileSet" id=1]
|
||||
[ext_resource path="res://src/Contraptions/Portal/Portal.tscn" type="PackedScene" id=2]
|
||||
@ -15,6 +15,7 @@
|
||||
[ext_resource path="res://src/Platforms/DropThroughPlatform.tscn" type="PackedScene" id=13]
|
||||
[ext_resource path="res://src/Actors/Enemies/Beings/WhatAreFrog.tscn" type="PackedScene" id=14]
|
||||
[ext_resource path="res://src/Levels/Level 2.gd" type="Script" id=15]
|
||||
[ext_resource path="res://src/NeutralObjects/SavePoint.tscn" type="PackedScene" id=16]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachinePlayback" id=4]
|
||||
|
||||
@ -41,10 +42,10 @@ unique_name_in_owner = true
|
||||
drag_margin_bottom = 0.3
|
||||
|
||||
[node name="AnimatedSprite" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="4"]
|
||||
frame = 11
|
||||
frame = 2
|
||||
|
||||
[node name="AnimatedSprite2" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="5"]
|
||||
frame = 11
|
||||
frame = 2
|
||||
|
||||
[node name="Blobby" parent="." instance=ExtResource( 9 )]
|
||||
unique_name_in_owner = true
|
||||
@ -236,6 +237,9 @@ position = Vector2( 3144, -48 )
|
||||
[node name="Coin6" parent="." instance=ExtResource( 11 )]
|
||||
position = Vector2( 3279, -192 )
|
||||
|
||||
[node name="SavePoint" parent="." instance=ExtResource( 16 )]
|
||||
position = Vector2( 2502, -120 )
|
||||
|
||||
[connection signal="body_exited" from="Blobby/BlobbySkin" to="Blobby" method="_on_BlobbySkin_body_exited"]
|
||||
|
||||
[editable path="SignalManager"]
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
[ext_resource path="res://src/Platforms/FlyingPlatformClean.tscn" type="PackedScene" id=40]
|
||||
[ext_resource path="res://src/Contraptions/Portal/Portal.tscn" type="PackedScene" id=41]
|
||||
[ext_resource path="res://src/Platforms/DropThroughPlatform.tscn" type="PackedScene" id=42]
|
||||
[ext_resource path="res://src/Contraptions/Triggers/WhyButton.tscn" type="PackedScene" id=43]
|
||||
[ext_resource path="res://src/Contraptions/Triggers/FrogFreeButton.tscn" type="PackedScene" id=43]
|
||||
[ext_resource path="res://src/Contraptions/Triggers/ElevatorButton.tscn" type="PackedScene" id=44]
|
||||
[ext_resource path="res://src/Actors/Enemies/Beings/Flyer.tscn" type="PackedScene" id=45]
|
||||
[ext_resource path="res://src/Actors/Blobby/Blobby.tscn" type="PackedScene" id=46]
|
||||
@ -140,7 +140,7 @@ shape = SubResource( 3 )
|
||||
position = Vector2( 0, 1.5 )
|
||||
z_index = -1
|
||||
frames = SubResource( 5 )
|
||||
frame = 19
|
||||
frame = 4
|
||||
playing = true
|
||||
|
||||
[node name="Terminal" parent="." instance=ExtResource( 44 )]
|
||||
@ -169,9 +169,6 @@ tile_data = PoolIntArray( 851970, 1, 0, 851971, 0, 0, 851973, 0, 0, 851975, 2, 0
|
||||
position = Vector2( 496, 152 )
|
||||
max_speed = 120
|
||||
|
||||
[node name="StateLabel" parent="Flyer" index="1"]
|
||||
visible = false
|
||||
|
||||
[node name="AnimationTree" parent="Flyer/FlyerSprite" index="1"]
|
||||
parameters/playback = SubResource( 6 )
|
||||
|
||||
@ -182,20 +179,14 @@ movement_radius = 4
|
||||
[node name="FlyingPlatformClean" parent="." instance=ExtResource( 40 )]
|
||||
position = Vector2( 496, 220 )
|
||||
|
||||
[node name="WhyButton" parent="." instance=ExtResource( 43 )]
|
||||
position = Vector2( 632, 336 )
|
||||
|
||||
[node name="Indicator1" parent="WhyButton" index="1"]
|
||||
visible = false
|
||||
|
||||
[node name="Indicator3" parent="WhyButton" index="3"]
|
||||
visible = false
|
||||
[node name="FrogFreeButton" parent="." instance=ExtResource( 43 )]
|
||||
position = Vector2( 576, 312 )
|
||||
|
||||
[connection signal="ready" from="." to="BoundFrog" method="_on_Level_ready"]
|
||||
[connection signal="body_exited" from="Blobby/BlobbySkin" to="Blobby" method="_on_BlobbySkin_body_exited"]
|
||||
[connection signal="area_exited" from="Spring/SpringPlatform/SpringSkin" to="Spring/SpringPlatform" method="_on_SpringSkin_area_exited"]
|
||||
[connection signal="area_entered" from="Spring/SpringPlatform/EnteringVelocityDetector" to="Spring/SpringPlatform" method="_on_EnteringVelocityDetector_area_entered"]
|
||||
[connection signal="button_pushed" from="WhyButton" to="BoundFrog" method="_on_WhyButton_button_pushed"]
|
||||
[connection signal="button_pushed" from="FrogFreeButton" to="BoundFrog" method="_on_FrogFreeButton_pushed"]
|
||||
|
||||
[editable path="UserInterface"]
|
||||
[editable path="UserInterface/HUD"]
|
||||
@ -204,4 +195,3 @@ visible = false
|
||||
[editable path="BoundFrog"]
|
||||
[editable path="BoundFrog/RopeAnchor"]
|
||||
[editable path="FlyingPlatformClean"]
|
||||
[editable path="WhyButton"]
|
||||
|
||||
29
src/NeutralObjects/SavePoint.tscn
Normal file
29
src/NeutralObjects/SavePoint.tscn
Normal file
@ -0,0 +1,29 @@
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://assets/neutral object/blobby1Flag.png" type="Texture" id=1]
|
||||
[ext_resource path="res://assets/neutral object/flagPoleAndBasePlant.png" type="Texture" id=2]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id=1]
|
||||
radius = 12.0
|
||||
|
||||
[node name="SavePoint" type="Node2D"]
|
||||
|
||||
[node name="FlagPole" type="Sprite" parent="."]
|
||||
z_index = 1
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="Flag" type="Sprite" parent="."]
|
||||
visible = false
|
||||
position = Vector2( -1, 4 )
|
||||
texture = ExtResource( 1 )
|
||||
region_enabled = true
|
||||
region_rect = Rect2( 10, 20, 25, 15 )
|
||||
region_filter_clip = true
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
collision_layer = 0
|
||||
monitorable = false
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||
position = Vector2( -15, 6 )
|
||||
shape = SubResource( 1 )
|
||||
@ -38,13 +38,7 @@ func _zoom_timer() -> void:
|
||||
|
||||
func update_interface() -> void:
|
||||
|
||||
var wallet = 0
|
||||
var prog := GlobalState.progress_dict
|
||||
for key in prog:
|
||||
if prog[key].has("currency"):
|
||||
wallet += prog[key]["currency"]
|
||||
|
||||
wallet += levelState.currency
|
||||
var wallet = GlobalState.wallet + levelState.currency
|
||||
|
||||
currency.text = "Wallet: %s Orbicles" % wallet
|
||||
kills.text = "Kills: %s" % levelState.kills
|
||||
|
||||
@ -39,6 +39,20 @@ func set_frees(value: int) -> void:
|
||||
func set_dead(value: bool) -> void:
|
||||
is_dead = value
|
||||
|
||||
# Spends the currency when enough is available
|
||||
# and returns true if so. Else it does not spend and return false.
|
||||
func spend_currency(cost: int) -> bool:
|
||||
if GlobalState.wallet + currency < cost:
|
||||
return false
|
||||
var remainder = currency - cost
|
||||
if remainder >= 0:
|
||||
currency = remainder
|
||||
else:
|
||||
currency = 0
|
||||
GlobalState.set_wallet(GlobalState.wallet + remainder)
|
||||
return true
|
||||
|
||||
|
||||
func _on_level_completed():
|
||||
update_global_state()
|
||||
reset()
|
||||
@ -52,6 +66,7 @@ func update_global_state() -> void:
|
||||
levelProgress["deaths"] = deaths
|
||||
levelProgress["frees"] = frees
|
||||
|
||||
# TODO Doesnt account for multiple plays of same level
|
||||
if !progress_dict.has(levelName):
|
||||
progress_dict[levelName] = levelProgress
|
||||
else:
|
||||
@ -60,6 +75,9 @@ func update_global_state() -> void:
|
||||
progress_dict[levelName]["deaths"] = progress_dict[levelName]["deaths"] + deaths
|
||||
progress_dict[levelName]["frees"] = progress_dict[levelName]["frees"] + frees
|
||||
|
||||
GlobalState.set_wallet(GlobalState.wallet + currency)
|
||||
|
||||
|
||||
GlobalState.set_progress(progress_dict)
|
||||
|
||||
func player_dying() -> void:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user