bushes
This commit is contained in:
4
coin.gd
4
coin.gd
@@ -1,6 +1,6 @@
|
||||
extends Area2D
|
||||
@export var coin_sound: AudioStreamPlayer
|
||||
@export var sprite: AnimatedSprite2D
|
||||
@onready var sprite: AnimatedSprite2D = $sprite
|
||||
@onready var coin_sound: AudioStreamPlayer = $coin_sound
|
||||
|
||||
func _on_body_entered(body: Node2D) -> void:
|
||||
if sprite != null:
|
||||
|
||||
4
dino.gd
4
dino.gd
@@ -1,10 +1,9 @@
|
||||
extends CharacterBody2D
|
||||
|
||||
@onready var jump: AudioStreamPlayer = $Jump
|
||||
|
||||
const SPEED = 300.0
|
||||
const JUMP_VELOCITY = -800.0
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
# Add the gravity.
|
||||
if not is_on_floor():
|
||||
@@ -13,6 +12,7 @@ func _physics_process(delta: float) -> void:
|
||||
# Handle jump.
|
||||
if Input.is_action_just_pressed("ui_accept") and is_on_floor():
|
||||
velocity.y = JUMP_VELOCITY
|
||||
jump.play()
|
||||
|
||||
# Get the input direction and handle the movement/deceleration.
|
||||
# As good practice, you should replace UI actions with custom gameplay actions.
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
[gd_scene format=3 uid="uid://b4dj7u1t6qjuy"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://dw64sm6hvikka" path="res://sprites/dino/DinoSprites - doux.png" id="1_la3et"]
|
||||
[ext_resource type="AudioStream" uid="uid://cg11utandve3m" path="res://sounds/jump.mp3" id="2_nb2aw"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_2lsqi"]
|
||||
atlas = ExtResource("1_la3et")
|
||||
@@ -134,3 +135,6 @@ frame_progress = 0.46606407
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=834206527]
|
||||
position = Vector2(0, -8.5)
|
||||
shape = SubResource("RectangleShape2D_la3et")
|
||||
|
||||
[node name="Jump" type="AudioStreamPlayer" parent="." unique_id=1836774866]
|
||||
stream = ExtResource("2_nb2aw")
|
||||
|
||||
Binary file not shown.
@@ -1,19 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="mp3"
|
||||
type="AudioStreamMP3"
|
||||
uid="uid://cg11utandve3m"
|
||||
path="res://.godot/imported/freesound_community-cartoon-jump-6462.mp3-08b55ccc1bf51b1ba962ccd7271cbd9f.mp3str"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://sounds/freesound_community-cartoon-jump-6462.mp3"
|
||||
dest_files=["res://.godot/imported/freesound_community-cartoon-jump-6462.mp3-08b55ccc1bf51b1ba962ccd7271cbd9f.mp3str"]
|
||||
|
||||
[params]
|
||||
|
||||
loop=false
|
||||
loop_offset=0
|
||||
bpm=0
|
||||
beat_count=0
|
||||
bar_beats=4
|
||||
Reference in New Issue
Block a user