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,7 +1,7 @@
# Games
- [x] Finish Platformer
- [ ] Finish Space Invaders
- [ ] Finish Bullet Hell
- [x] Finish Bullet Hell
- [x] Finish Bomb Defusal
- [x] Finish DDR
- [ ] Finish Asteroids
@ -14,8 +14,8 @@
- [x] lasers not appearing
- [x] only 1 lane getting warning
- [x] platformer works once but having trouble getting it to replay
- [ ] menu credits
- [ ] menu exit? (not visible in web build)
- [x] menu credits
- [x] menu exit? (not visible in web build)
- [x] still need a player!!! (make it the cat from catdash?)
## Publishing
@ -39,3 +39,4 @@
- [ ] win sound
- [ ] lose sound
- [ ] kanes zoom out sound
- [ ] music - electronic msuic?

View file

@ -0,0 +1,20 @@
extends Area2D
var speed : float = 50
var target_pos : Vector2
@export var sprite : Sprite2D
var spin_speed : float = 50
# 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:
sprite.rotation_degrees += spin_speed * delta
global_position = global_position.move_toward(target_pos, delta * speed)
func _on_area_entered(area: Area2D) -> void:
queue_free()

View file

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

View file

@ -0,0 +1,22 @@
[gd_scene load_steps=4 format=3 uid="uid://chwuh2bbilfn1"]
[ext_resource type="Texture2D" uid="uid://b0sii6paqk3gm" path="res://sprites/asteroid.png" id="1_7d121"]
[ext_resource type="Script" uid="uid://dculqxasbgkte" path="res://games/asteroids/asteroid.gd" id="1_aye07"]
[sub_resource type="CircleShape2D" id="CircleShape2D_7d121"]
radius = 46.0435
[node name="Asteroid" type="Area2D" node_paths=PackedStringArray("sprite")]
collision_mask = 2
script = ExtResource("1_aye07")
sprite = NodePath("Sprite2D")
[node name="Sprite2D" type="Sprite2D" parent="."]
position = Vector2(0, -2)
scale = Vector2(0.3, 0.3)
texture = ExtResource("1_7d121")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_7d121")
[connection signal="area_entered" from="." to="." method="_on_area_entered"]

View file

@ -3,11 +3,40 @@ extends Node
signal game_win
signal game_lose
@export var asteroid_spawns : Array[Node2D]
@export var win_progress : ProgressBar
@export var win_time : float = 15
var alive_time : float =0
@export var spawn_time : float = 3
@export var player : Node2D
var timer : float
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
timer = spawn_time
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
win_progress.value = alive_time/win_time
timer -= delta
alive_time += delta
if timer <0:
spawn_new_asteroid()
timer = spawn_time
if alive_time >= win_time:
print("Asteroid win")
game_win.emit()
func spawn_new_asteroid():
var newAsteroid : Node2D = load("res://games/asteroids/asteroid.tscn").instantiate()
var randSpawn : int = randi_range(0,3)
newAsteroid.global_position = asteroid_spawns[randSpawn].global_position
newAsteroid.target_pos = player.global_position
#newBullet.heading = -newBullet.global_position.normalized()
get_parent().add_child(newAsteroid)
func _on_area_2d_area_entered(area: Area2D) -> void:
print("Asteroid lose")
game_lose.emit()

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=8 format=3 uid="uid://bw1hhx7lyfonr"]
[gd_scene load_steps=9 format=3 uid="uid://bw1hhx7lyfonr"]
[ext_resource type="Script" uid="uid://brih2jftm2tsa" path="res://games/asteroids/ship_controller.gd" id="1_6dc0m"]
[ext_resource type="Script" uid="uid://carkc2diu0xwd" path="res://games/asteroids/asteroids.gd" id="1_j0tb1"]
@ -20,8 +20,14 @@ noise = SubResource("FastNoiseLite_j0tb1")
[sub_resource type="CircleShape2D" id="CircleShape2D_dtqgl"]
radius = 26.0192
[node name="Asteroids" type="Node"]
[sub_resource type="CircleShape2D" id="CircleShape2D_j0tb1"]
radius = 26.0192
[node name="Asteroids" type="Node" node_paths=PackedStringArray("asteroid_spawns", "win_progress", "player")]
script = ExtResource("1_j0tb1")
asteroid_spawns = [NodePath("Spawns/SpawnPoint"), NodePath("Spawns/SpawnPoint2"), NodePath("Spawns/SpawnPoint3"), NodePath("Spawns/SpawnPoint4")]
win_progress = NodePath("ProgressBar")
player = NodePath("Ship")
[node name="TextureRect" type="TextureRect" parent="."]
anchors_preset = 15
@ -52,3 +58,39 @@ position = Vector2(30, 0)
[node name="BulletGoal" type="Marker2D" parent="Ship"]
position = Vector2(459, 0)
[node name="Area2D" type="Area2D" parent="Ship"]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Ship/Area2D"]
shape = SubResource("CircleShape2D_j0tb1")
[node name="Spawns" type="Node2D" parent="."]
[node name="SpawnPoint" type="Marker2D" parent="Spawns"]
position = Vector2(-92, -85)
[node name="SpawnPoint2" type="Marker2D" parent="Spawns"]
position = Vector2(724, -92)
[node name="SpawnPoint3" type="Marker2D" parent="Spawns"]
position = Vector2(742, 445)
[node name="SpawnPoint4" type="Marker2D" parent="Spawns"]
position = Vector2(-108, 435)
[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
fill_mode = 3
show_percentage = false
[connection signal="area_entered" from="Ship/Area2D" to="." method="_on_area_2d_area_entered"]

View file

@ -7,6 +7,8 @@
radius = 7.0
[node name="Bullet" type="Area2D"]
collision_layer = 2
collision_mask = 3
script = ExtResource("1_hy4j0")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]

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

View file

@ -4,7 +4,8 @@ signal game_win
signal game_lose
@export var keys : Array[String]
@export var time_limit : float = 25
@export var time_limit : float = 20
@export var pixel_count : int = 16
@export_group("Node References")
@export var pixel_grid : GridContainer
@ -12,6 +13,7 @@ signal game_lose
var pixels : Array[Control]
var current_time : float = 25
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
create_pixels()
@ -19,7 +21,7 @@ func _ready() -> void:
pass # Replace with function body.
func create_pixels():
for i in range(25):
for i in range(pixel_count):
var newPixel = load("res://games/crafting/pixel.tscn").instantiate()
var randomKey = randi_range(0,keys.size()-1)
newPixel.key = keys[randomKey]
@ -48,7 +50,7 @@ func count_activated() -> bool:
for pixel in pixels:
if pixel.activated:
count += 1
if count == 25:
if count == pixel_count:
return true
else:
return false

View file

@ -59,7 +59,7 @@ layout_mode = 2
[node name="GridContainer" type="GridContainer" parent="CenterContainer/VBoxContainer"]
layout_mode = 2
columns = 5
columns = 4
[node name="Timer" type="ProgressBar" parent="CenterContainer/VBoxContainer"]
visible = false

View file

@ -26,9 +26,13 @@ func _process(delta: float) -> void:
reaction_window -= delta
if(Input.is_action_just_pressed("reaction_press")):
if(time_remaining<=0 and reaction_window > 0):
pass
print("reaction win")
game_win.emit()
#winner
else:
pass
print("reaction lose")
game_lose.emit()
#loser
pass
if(reaction_window <= 0):
print("reaction lose")
game_lose.emit()

View file

@ -19,8 +19,10 @@ colors = PackedColorArray(1, 0, 0.141176, 1, 1, 1, 0, 1)
gradient = SubResource("Gradient_6p5vi")
fill_to = Vector2(1, 1)
[node name="Reaction" type="Node"]
[node name="Reaction" type="Node" node_paths=PackedStringArray("prepare_node", "press_node")]
script = ExtResource("1_fqqjl")
prepare_node = NodePath("Prepare")
press_node = NodePath("Press")
[node name="Prepare" type="Control" parent="."]
layout_mode = 3

BIN
sprites/asteroid.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b0sii6paqk3gm"
path="res://.godot/imported/asteroid.png-08189385464b77d33d4670fae0e55447.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/asteroid.png"
dest_files=["res://.godot/imported/asteroid.png-08189385464b77d33d4670fae0e55447.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

BIN
sprites/bombGuy.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 447 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dyeqeyvksc8xh"
path="res://.godot/imported/bombGuy.png-b6b3967c500adb900f6aafdb9c390764.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/bombGuy.png"
dest_files=["res://.godot/imported/bombGuy.png-b6b3967c500adb900f6aafdb9c390764.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

BIN
sprites/hellBullet.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://coo7nbsgvj4m4"
path="res://.godot/imported/hellBullet.png-19507af9ba81db4e7803fdf30874f155.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/hellBullet.png"
dest_files=["res://.godot/imported/hellBullet.png-19507af9ba81db4e7803fdf30874f155.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1