one-dimensional vertical slice
This commit is contained in:
parent
548a23d0e9
commit
3607ca7e2e
42 changed files with 692 additions and 2 deletions
3
objects/bullet_types/bullet.gd
Normal file
3
objects/bullet_types/bullet.gd
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
class_name Bullet extends Node2D
|
||||
|
||||
@export var is_player_bullet = false
|
||||
1
objects/bullet_types/bullet.gd.uid
Normal file
1
objects/bullet_types/bullet.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bacbwjan886y1
|
||||
14
objects/bullet_types/test_bullet.gd
Normal file
14
objects/bullet_types/test_bullet.gd
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
extends Bullet
|
||||
|
||||
var speed = Vector2.ZERO
|
||||
var bullet_speed = 2
|
||||
var angle = randf_range(-360,360)
|
||||
var colors = [Color.RED,Color.BLUE,Color.GREEN,Color.YELLOW,]
|
||||
|
||||
func _ready() -> void:
|
||||
var color_choice = randi_range(0,colors.size() - 1)
|
||||
$Sprite.modulate = colors[color_choice]
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
speed = Vector2.RIGHT.rotated(rad_to_deg(angle)) * bullet_speed
|
||||
position += speed
|
||||
1
objects/bullet_types/test_bullet.gd.uid
Normal file
1
objects/bullet_types/test_bullet.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://dgrxej0tqnnfd
|
||||
61
objects/bullet_types/test_bullet.tscn
Normal file
61
objects/bullet_types/test_bullet.tscn
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
[gd_scene load_steps=8 format=3 uid="uid://je8ntnqgk0p6"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dgrxej0tqnnfd" path="res://objects/bullet_types/test_bullet.gd" id="1_nd7f1"]
|
||||
[ext_resource type="Texture2D" uid="uid://du7gh3nk66mpo" path="res://graphics/bullets/normal_bullet/bullet_1.png" id="2_gcdq1"]
|
||||
[ext_resource type="Texture2D" uid="uid://xe124f1kgf3x" path="res://graphics/bullets/normal_bullet/bullet_2.png" id="3_ic0v5"]
|
||||
[ext_resource type="Texture2D" uid="uid://cenv3e67bv5fl" path="res://graphics/bullets/normal_bullet/bullet_core_1.png" id="4_ic0v5"]
|
||||
[ext_resource type="Texture2D" uid="uid://4a633mudwp4q" path="res://graphics/bullets/normal_bullet/bullet_core_2.png" id="5_163b3"]
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_tg74j"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("2_gcdq1")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("3_ic0v5")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("3_ic0v5")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("2_gcdq1")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"default",
|
||||
"speed": 20.0
|
||||
}]
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_10vvt"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("4_ic0v5")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("5_163b3")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("5_163b3")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("4_ic0v5")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"default",
|
||||
"speed": 20.0
|
||||
}]
|
||||
|
||||
[node name="TestBullet" type="Node2D"]
|
||||
script = ExtResource("1_nd7f1")
|
||||
|
||||
[node name="Sprite" type="AnimatedSprite2D" parent="."]
|
||||
modulate = Color(0, 1, 1, 1)
|
||||
sprite_frames = SubResource("SpriteFrames_tg74j")
|
||||
autoplay = "default"
|
||||
frame_progress = 0.26925442
|
||||
|
||||
[node name="Sprite2" type="AnimatedSprite2D" parent="."]
|
||||
sprite_frames = SubResource("SpriteFrames_10vvt")
|
||||
autoplay = "default"
|
||||
frame_progress = 0.21053335
|
||||
Loading…
Add table
Add a link
Reference in a new issue