mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-12-06 03:30:22 -08:00
SMBS powerups give the proper amount of points when collecting (#671)
* SMBS powerups give the proper amount of points when collecting * Flag die doesn't give double points
This commit is contained in:
parent
df91706d16
commit
7a0adfa75c
6 changed files with 24 additions and 7 deletions
|
|
@ -1,9 +1,10 @@
|
|||
[gd_scene load_steps=7 format=3 uid="uid://bwdwavf4rp1m1"]
|
||||
[gd_scene load_steps=8 format=3 uid="uid://bwdwavf4rp1m1"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://vhxup1pn2v8q" path="res://Scripts/Classes/Entities/Items/HammerItem.gd" id="1_ws752"]
|
||||
[ext_resource type="Texture2D" uid="uid://bbdcmhyxmc3pu" path="res://Assets/Sprites/Items/SPItems.png" id="2_c0srl"]
|
||||
[ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="4_uc7h7"]
|
||||
[ext_resource type="JSON" path="res://Assets/Sprites/Items/HammerItem.json" id="5_6qq3q"]
|
||||
[ext_resource type="Script" uid="uid://5octqlf4ohel" path="res://Scripts/Classes/Components/ScoreNoteSpawner.gd" id="5_uc7h7"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_uc7h7"]
|
||||
size = Vector2(10, 10)
|
||||
|
|
@ -41,4 +42,9 @@ position = Vector2(0, -8)
|
|||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
|
||||
shape = SubResource("RectangleShape2D_ws752")
|
||||
|
||||
[node name="ScoreNoteSpawner" type="Node" parent="."]
|
||||
script = ExtResource("5_uc7h7")
|
||||
add_score = true
|
||||
metadata/_custom_type_script = "uid://5octqlf4ohel"
|
||||
|
||||
[connection signal="area_entered" from="Hitbox" to="." method="on_area_entered"]
|
||||
|
|
|
|||
|
|
@ -1,18 +1,21 @@
|
|||
[gd_scene load_steps=10 format=3 uid="uid://dhd0gp2xvl53l"]
|
||||
[gd_scene load_steps=11 format=3 uid="uid://dhd0gp2xvl53l"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bafdl3y53ly60" path="res://Scripts/Classes/UI/PackAnimatedSprite2D.gd" id="2_724cb"]
|
||||
[ext_resource type="Texture2D" uid="uid://bbdcmhyxmc3pu" path="res://Assets/Sprites/Items/SPItems.png" id="2_wnlnm"]
|
||||
[ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="3_ke2o5"]
|
||||
[ext_resource type="JSON" path="res://Assets/Sprites/Items/LuckyStar.json" id="4_4cwfa"]
|
||||
[ext_resource type="Script" uid="uid://5octqlf4ohel" path="res://Scripts/Classes/Components/ScoreNoteSpawner.gd" id="5_724cb"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_y0edb"]
|
||||
script/source = "extends PowerUpItem
|
||||
|
||||
func on_area_entered(area: Area2D) -> void:
|
||||
if area.owner is Player:
|
||||
queue_free()
|
||||
AudioManager.play_global_sfx(\"lucky_star\")
|
||||
$ScoreNoteSpawner.spawn_note(1000)
|
||||
DiscoLevel.combo_amount += 1
|
||||
get_tree().call_group(\"Enemies\", \"flag_die\")
|
||||
queue_free()
|
||||
"
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ke2o5"]
|
||||
|
|
@ -65,4 +68,9 @@ position = Vector2(0, -8)
|
|||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
|
||||
shape = SubResource("RectangleShape2D_7yv5x")
|
||||
|
||||
[node name="ScoreNoteSpawner" type="Node" parent="."]
|
||||
script = ExtResource("5_724cb")
|
||||
add_score = true
|
||||
metadata/_custom_type_script = "uid://5octqlf4ohel"
|
||||
|
||||
[connection signal="area_entered" from="Hitbox" to="." method="on_area_entered"]
|
||||
|
|
|
|||
|
|
@ -11,8 +11,7 @@ script/source = "extends PowerUpItem
|
|||
|
||||
func on_area_entered(area: Area2D) -> void:
|
||||
if area.owner is Player:
|
||||
AudioManager.play_sfx(\"power_up\", global_position)
|
||||
Global.score += 1000
|
||||
AudioManager.play_global_sfx(\"power_up\")
|
||||
$ScoreNoteSpawner.spawn_note(1000)
|
||||
area.owner.wing_get()
|
||||
queue_free()
|
||||
|
|
|
|||
|
|
@ -34,8 +34,9 @@ func flag_die() -> void:
|
|||
if on_screen_enabler != null:
|
||||
if on_screen_enabler.is_on_screen():
|
||||
queue_free()
|
||||
Global.score += 500
|
||||
if score_note_adder != null:
|
||||
if score_note_adder.add_score == false:
|
||||
Global.score += 500
|
||||
score_note_adder.spawn_note(500)
|
||||
|
||||
func die_from_hammer(obj: Node2D) -> void:
|
||||
|
|
|
|||
|
|
@ -3,6 +3,6 @@ extends PowerUpItem
|
|||
func on_area_entered(area: Area2D) -> void:
|
||||
if area.owner is Player:
|
||||
AudioManager.play_sfx("hachisuke", global_position)
|
||||
Global.score += 8000
|
||||
$ScoreNoteSpawner.spawn_note(8000)
|
||||
DiscoLevel.combo_amount += 1
|
||||
queue_free()
|
||||
|
|
|
|||
|
|
@ -2,5 +2,8 @@ extends PowerUpItem
|
|||
|
||||
func on_area_entered(area: Area2D) -> void:
|
||||
if area.owner is Player:
|
||||
AudioManager.play_global_sfx("power_up")
|
||||
$ScoreNoteSpawner.spawn_note(1000)
|
||||
DiscoLevel.combo_amount += 1
|
||||
area.owner.hammer_get()
|
||||
queue_free()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue