bullet hell, asteroid and reaction done,. i think ill drop space invaders , 40 minutes left

This commit is contained in:
Tabby 2025-05-17 17:20:23 +10:00
parent 82652730f2
commit c000461fd6
23 changed files with 377 additions and 23 deletions

View file

@ -1,8 +1,8 @@
extends CharacterBody2D
const SPEED = 300.0
const JUMP_VELOCITY = -400.0
const SPEED = 200.0
#const JUMP_VELOCITY = -400.0
func _physics_process(delta: float) -> void:

View file

@ -3,11 +3,42 @@ extends Node
signal game_win
signal game_lose
@export var spawn_delay : float = 1.5
@export var win_time : float = 15
@export_group("Node References")
@export var spawn_line : Path2D
@export var follow_line : PathFollow2D
@export var win_progress : ProgressBar
var spawn_timer : float = 5
var alive_time : float = 0
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
spawn_timer = spawn_delay
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
spawn_timer -= delta
alive_time += delta
win_progress.value = alive_time/win_time
if spawn_timer <= 0:
spawn_timer = spawn_delay
spawn_new_bullet()
if alive_time> win_time:
game_win.emit()
func spawn_new_bullet():
var newBullet : Node2D = load("res://games/bullet_hell/hellBullet.tscn").instantiate()
follow_line.progress_ratio = randf()
newBullet.global_position = follow_line.global_position
#newBullet.heading = -newBullet.global_position.normalized()
get_parent().add_child(newBullet)
func _on_hitbox_area_entered(area: Area2D) -> void:
game_lose.emit()

View file

@ -1,8 +1,8 @@
[gd_scene load_steps=8 format=3 uid="uid://cnpyrh4c6a7cg"]
[gd_scene load_steps=11 format=3 uid="uid://cnpyrh4c6a7cg"]
[ext_resource type="Texture2D" uid="uid://diilj7xuttpqu" path="res://icon.svg" id="1_jfgig"]
[ext_resource type="Script" uid="uid://dld4egumb2u0o" path="res://games/bullet_hell/bullet_hell.gd" id="1_uvm3w"]
[ext_resource type="Script" uid="uid://c100m60xe4k3r" path="res://games/bullet_hell/bulletHellMovement.gd" id="1_x66ke"]
[ext_resource type="Texture2D" uid="uid://dyeqeyvksc8xh" path="res://sprites/bombGuy.png" id="3_uvm3w"]
[sub_resource type="Gradient" id="Gradient_x66ke"]
colors = PackedColorArray(0.552941, 0, 0, 1, 1, 0.513875, 0.319104, 1)
@ -18,10 +18,26 @@ noise = SubResource("FastNoiseLite_uvm3w")
[sub_resource type="RectangleShape2D" id="RectangleShape2D_jfgig"]
size = Vector2(38, 38)
[node name="BulletHell" type="Node"]
[sub_resource type="CircleShape2D" id="CircleShape2D_4njol"]
radius = 21.0
[sub_resource type="Curve2D" id="Curve2D_uvm3w"]
_data = {
"points": PackedVector2Array(0, 0, 0, 0, 0, 0, 0, 0, 400, 0, 0, 360)
}
point_count = 2
[sub_resource type="LabelSettings" id="LabelSettings_uvm3w"]
font_size = 46
[node name="BulletHell" type="Node" node_paths=PackedStringArray("spawn_line", "follow_line", "win_progress")]
script = ExtResource("1_uvm3w")
spawn_line = NodePath("Path2D")
follow_line = NodePath("Path2D/PathFollow2D")
win_progress = NodePath("ProgressBar")
[node name="TextureRect" type="TextureRect" parent="."]
z_index = -2
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
@ -35,8 +51,56 @@ motion_mode = 1
script = ExtResource("1_x66ke")
[node name="CollisionShape2D" type="CollisionShape2D" parent="CharacterBody2D"]
visible = false
shape = SubResource("RectangleShape2D_jfgig")
[node name="Sprite2D" type="Sprite2D" parent="CharacterBody2D"]
scale = Vector2(0.3, 0.3)
texture = ExtResource("1_jfgig")
scale = Vector2(3, 3)
texture = ExtResource("3_uvm3w")
[node name="hitbox" type="Area2D" parent="CharacterBody2D"]
[node name="CollisionShape2D" type="CollisionShape2D" parent="CharacterBody2D/hitbox"]
position = Vector2(0, -3)
shape = SubResource("CircleShape2D_4njol")
[node name="Path2D" type="Path2D" parent="."]
position = Vector2(-19, 0)
curve = SubResource("Curve2D_uvm3w")
[node name="PathFollow2D" type="PathFollow2D" parent="Path2D"]
rotation = 1.5708
[node name="ProgressBar" type="ProgressBar" parent="."]
modulate = Color(0, 1, 0, 1)
custom_minimum_size = Vector2(32, 0)
anchors_preset = 11
anchor_left = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -4.0
grow_horizontal = 0
grow_vertical = 2
max_value = 1.0
step = 0.0
value = 0.335
fill_mode = 3
show_percentage = false
[node name="Label" type="Label" parent="."]
z_index = -1
anchors_preset = 7
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -180.0
offset_top = -75.0
offset_right = 180.0
offset_bottom = -11.0
grow_horizontal = 2
grow_vertical = 0
text = "Dodge with IJKL!"
label_settings = SubResource("LabelSettings_uvm3w")
[connection signal="area_entered" from="CharacterBody2D/hitbox" to="." method="_on_hitbox_area_entered"]

View file

@ -0,0 +1,17 @@
[gd_scene load_steps=4 format=3 uid="uid://4gv3dbn62dys"]
[ext_resource type="Script" uid="uid://bkytaq1jg8ntg" path="res://games/bullet_hell/hell_bullet.gd" id="1_733pn"]
[ext_resource type="Texture2D" uid="uid://coo7nbsgvj4m4" path="res://sprites/hellBullet.png" id="1_eotlb"]
[sub_resource type="CircleShape2D" id="CircleShape2D_eotlb"]
radius = 16.0312
[node name="HellBullet" type="Area2D"]
script = ExtResource("1_733pn")
[node name="Sprite2D" type="Sprite2D" parent="."]
scale = Vector2(2, 2)
texture = ExtResource("1_eotlb")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_eotlb")

View file

@ -0,0 +1,14 @@
extends Area2D
var lifetime : float = 15
var speed : float = 80
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
position.x += delta * speed

View file

@ -0,0 +1 @@
uid://bkytaq1jg8ntg