Change of Friction

This commit is contained in:
tiffanyfrias10
2021-11-30 21:21:58 -06:00
parent 73efc1ffea
commit 34f7407d6a
6 changed files with 29 additions and 22 deletions

View File

@@ -4,36 +4,36 @@ signal complete(option)
func _on_new_game_button_pressed() -> void:
emit_signal('complete', 'new game')
return
emit_signal('complete', 'new game')
return
func _on_quit_button_pressed() -> void:
get_tree().quit()
return
get_tree().quit()
return
func _on_continue_button_mouse_entered() -> void:
if not $'Menu/Menu Elements/Menu Options/Continue/Continue Button'.disabled:
$'Menu Button Hover'.play(0.0)
return
if not $'Menu/Menu Elements/Menu Options/Continue/Continue Button'.disabled:
$'Menu Button Hover'.play(0.0)
return
func _on_new_game_button_mouse_entered() -> void:
$'Menu Button Hover'.play(0.0)
return
$'Menu Button Hover'.play(0.0)
return
func _on_settings_button_mouse_entered() -> void:
$'Menu Button Hover'.play(0.0)
return
$'Menu Button Hover'.play(0.0)
return
func _on_credits_button_mouse_entered() -> void:
$'Menu Button Hover'.play(0.0)
return
$'Menu Button Hover'.play(0.0)
return
func _on_quit_button_mouse_entered() -> void:
$'Menu Button Hover'.play(0.0)
return
$'Menu Button Hover'.play(0.0)
return

View File

@@ -2,5 +2,5 @@ extends Node2D
func _ready() -> void:
$YSort/Player.load_hud($HUD)
return
$YSort/Player.load_hud($HUD)
return

View File

@@ -6,14 +6,14 @@
[sub_resource type="CircleShape2D" id=1]
radius = 6.38067
[node name="Node2D" type="Area2D"]
[node name="coin" type="Area2D"]
script = ExtResource( 2 )
[node name="Sprite" type="Sprite" parent="."]
position = Vector2( 28.3217, 41.6257 )
texture = ExtResource( 1 )
[node name="Collision" type="CollisionShape2D" parent="."]
[node name="coin" type="CollisionShape2D" parent="."]
position = Vector2( 28.4389, 40.6703 )
shape = SubResource( 1 )

View File

@@ -3,6 +3,9 @@ extends Node2D
onready var coin = preload("res://Levels/Interactives/coin.tscn")
#onready var coin_container = get_node("YSort/coin_container")
#have event for timer to run out
var screensize
var score = 0

View File

@@ -44,7 +44,7 @@ tile_data = PoolIntArray( 0, 0, 65537, 1, 0, 65538, 2, 0, 65538, 3, 0, 65538, 4,
[node name="Player" parent="YSort" instance=ExtResource( 1 )]
position = Vector2( 20, 26 )
ACCELERATION = 500
FRICTION = 500
FRICTION = 100
[node name="tree6" type="StaticBody2D" parent="YSort"]

View File

@@ -85,11 +85,15 @@ func _input(event: InputEvent) -> void:
func _on_Hitbox_area_entered(area: Area2D) -> void:
print(area.name)
if area.name.begins_with("coin"):
print("COIN")
if not 'enemies' in area.get_parent().get_groups() or area.name.begins_with("detection") or (not area.name.begins_with("snowball")) :
return
if area.name.begins_with("snowball"):
print("SNOWBALL FIGHT")
if health_index != 0:
health_index -= 1