[Manos con que el desarrollo del juego Godot] Flappy Bird: 6 a punto MUSIC (sin terminar)

En esta sección representaciones

En esta sección se incrementa de audio, por favor llene la siguiente figura se combina con el cerebro

Aquí Insertar imagen Descripción

Aquí Insertar imagen Descripción

Aquí Insertar imagen Descripción

Aquí Insertar imagen Descripción

Aquí Insertar imagen Descripción

Aquí Insertar imagen Descripción

Aquí Insertar imagen Descripción

Aquí Insertar imagen Descripción

Aquí Insertar imagen Descripción

extends Node

func play(name : String):
	var sfx = find_node(name)
	if sfx is AudioStreamPlayer:
		sfx.play()

Aquí Insertar imagen Descripción

Aquí Insertar imagen Descripción

Aquí Insertar imagen Descripción

Aquí Insertar imagen Descripción

Aquí Insertar imagen Descripción

# Bird.gd
extends RigidBody2D


func _ready():
	connect("body_entered",self,"on_body_entered")

func _physics_process(delta):
	if Input.is_mouse_button_pressed(1):
		AudioManager.play("sfx_swooshing")#音效
		linear_velocity = Vector2.UP*500
		angular_velocity = -3.0
	if rotation_degrees < -30:
		rotation_degrees = -30
		angular_velocity = 0
	if linear_velocity.y > 0.0:
		angular_velocity = 1.5

func on_body_entered(_body):
	if _body is StaticBody2D:
		AudioManager.play("sfx_hit")#音效
		print("Die.....")
#ScoreArea.gd

extends Area2D

func _ready():
	connect("body_exited",self,"_on_body_exited")
func _on_body_exited(_body):
	if _body.name == "Bird":
		AudioManager.play("sfx_point")#音效
		print("得分!!!!")
Publicados 375 artículos originales · ganado elogios 1037 · Vistas de 170.000 +

Supongo que te gusta

Origin blog.csdn.net/hello_tute/article/details/104990374
Recomendado
Clasificación