feat: 场景与核心玩法脚本(双机型/波次/Boss/道具/炸弹/地面单位/浮游炮激光)
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
class_name EnemyBullet
|
||||
extends Area2D
|
||||
## 敌方弹丸:直线飞行,出屏即回收。
|
||||
|
||||
const TEX := preload("res://assets/svg/bullet_enemy.svg")
|
||||
|
||||
var velocity := Vector2(0.0, 260.0)
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
collision_layer = 8
|
||||
collision_mask = 0
|
||||
var sprite := Sprite2D.new()
|
||||
sprite.texture = TEX
|
||||
add_child(sprite)
|
||||
var shape := CollisionShape2D.new()
|
||||
var circle := CircleShape2D.new()
|
||||
circle.radius = 5.0
|
||||
shape.shape = circle
|
||||
add_child(shape)
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
position += velocity * delta
|
||||
if position.y < -40.0 or position.y > 1000.0 or position.x < -40.0 or position.x > 580.0:
|
||||
queue_free()
|
||||
Reference in New Issue
Block a user