diff --git a/apps/gamejam/brackeys/13/assets/kenny/space-shooter-redux/png/laserGreen11.png b/apps/gamejam/brackeys/13/assets/kenny/space-shooter-redux/png/laserGreen11.png new file mode 100644 index 000000000..100cddbd4 Binary files /dev/null and b/apps/gamejam/brackeys/13/assets/kenny/space-shooter-redux/png/laserGreen11.png differ diff --git a/apps/gamejam/brackeys/13/assets/kenny/space-shooter-redux/png/laserGreen11.png.import b/apps/gamejam/brackeys/13/assets/kenny/space-shooter-redux/png/laserGreen11.png.import new file mode 100644 index 000000000..950398b0f --- /dev/null +++ b/apps/gamejam/brackeys/13/assets/kenny/space-shooter-redux/png/laserGreen11.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cpg870sshds0m" +path="res://.godot/imported/laserGreen11.png-776296bf2871b1464fd65317ea694ad5.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/kenny/space-shooter-redux/png/laserGreen11.png" +dest_files=["res://.godot/imported/laserGreen11.png-776296bf2871b1464fd65317ea694ad5.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 diff --git a/apps/gamejam/brackeys/13/project.godot b/apps/gamejam/brackeys/13/project.godot index f8524d79e..31bf58283 100644 --- a/apps/gamejam/brackeys/13/project.godot +++ b/apps/gamejam/brackeys/13/project.godot @@ -60,6 +60,11 @@ drift_right={ "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":69,"key_label":0,"unicode":101,"location":0,"echo":false,"script":null) ] } +shoot={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"location":0,"echo":false,"script":null) +] +} [layer_names] diff --git a/apps/gamejam/brackeys/13/scenes/game.tscn b/apps/gamejam/brackeys/13/scenes/game.tscn index 818cc3b5e..9be2da029 100644 --- a/apps/gamejam/brackeys/13/scenes/game.tscn +++ b/apps/gamejam/brackeys/13/scenes/game.tscn @@ -1,8 +1,12 @@ -[gd_scene load_steps=2 format=3 uid="uid://cbrda40vq26pj"] +[gd_scene load_steps=3 format=3 uid="uid://cbrda40vq26pj"] +[ext_resource type="Script" path="res://scripts/game.gd" id="1_oyaqx"] [ext_resource type="PackedScene" uid="uid://1s5v0llrjq3" path="res://scenes/spaceship.tscn" id="1_rlyye"] [node name="Game" type="Node2D"] +script = ExtResource("1_oyaqx") [node name="Spaceship" parent="." instance=ExtResource("1_rlyye")] position = Vector2(500, 300) + +[node name="Projectiles" type="Node" parent="."] diff --git a/apps/gamejam/brackeys/13/scenes/laser.tscn b/apps/gamejam/brackeys/13/scenes/laser.tscn new file mode 100644 index 000000000..4d7c179b3 --- /dev/null +++ b/apps/gamejam/brackeys/13/scenes/laser.tscn @@ -0,0 +1,26 @@ +[gd_scene load_steps=4 format=3 uid="uid://dd2eekysgtc4"] + +[ext_resource type="Script" path="res://scripts/laser.gd" id="1_5kyoc"] +[ext_resource type="Texture2D" uid="uid://cpg870sshds0m" path="res://assets/kenny/space-shooter-redux/png/laserGreen11.png" id="1_s4xlg"] + +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_44da2"] +radius = 3.0 +height = 28.0 + +[node name="Laser" type="Area2D"] +collision_layer = 256 +collision_mask = 216 +script = ExtResource("1_5kyoc") + +[node name="Sprite2D" type="Sprite2D" parent="."] +position = Vector2(0, -15) +scale = Vector2(0.5, 0.5) +texture = ExtResource("1_s4xlg") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2(0, -15) +shape = SubResource("CapsuleShape2D_44da2") + +[node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="."] +position = Vector2(0, -14.5) +scale = Vector2(0.5, 1.35) diff --git a/apps/gamejam/brackeys/13/scenes/spaceship.tscn b/apps/gamejam/brackeys/13/scenes/spaceship.tscn index c91152cf0..a0248d97b 100644 --- a/apps/gamejam/brackeys/13/scenes/spaceship.tscn +++ b/apps/gamejam/brackeys/13/scenes/spaceship.tscn @@ -4,16 +4,21 @@ [ext_resource type="Script" path="res://scripts/spaceship.gd" id="1_uejed"] [sub_resource type="CircleShape2D" id="CircleShape2D_s734v"] -radius = 40.05 +radius = 20.91 [node name="Spaceship" type="CharacterBody2D"] +collision_layer = 32 +collision_mask = 472 script = ExtResource("1_uejed") [node name="Sprite2D" type="Sprite2D" parent="."] position = Vector2(0, -1) +scale = Vector2(0.4, 0.4) texture = ExtResource("1_8hcjj") [node name="CollisionShape2D" type="CollisionShape2D" parent="."] position = Vector2(0, 4) rotation = -0.0497135 shape = SubResource("CircleShape2D_s734v") + +[node name="OmniScope" type="Node2D" parent="."] diff --git a/apps/gamejam/brackeys/13/scripts/game.gd b/apps/gamejam/brackeys/13/scripts/game.gd new file mode 100644 index 000000000..743de9ca5 --- /dev/null +++ b/apps/gamejam/brackeys/13/scripts/game.gd @@ -0,0 +1,10 @@ +extends Node2D + +@onready var spaceship = $Spaceship +@onready var projectiles = $Projectiles + +func _ready(): + spaceship.connect("laser_shot", _on_spaceship_laser_shot) + +func _on_spaceship_laser_shot(laser): + projectiles.add_child(laser) diff --git a/apps/gamejam/brackeys/13/scripts/global.gd b/apps/gamejam/brackeys/13/scripts/global.gd index 2dc327f0c..bacc34464 100644 --- a/apps/gamejam/brackeys/13/scripts/global.gd +++ b/apps/gamejam/brackeys/13/scripts/global.gd @@ -13,15 +13,19 @@ var resources := { } var base_starship_stats := { - "acceleration": 10.0, - "max_speed": 350.0, - "rotation_speed": 250.0 + "acceleration": 15.0, + "max_speed": 400.0, + "rotation_speed": 270.0, + "laser_speed": 550.0, + "overheat": 0.0 } var starship_bonuses := { "acceleration": 0.0, "max_speed": 0.0, - "rotation_speed": 0.0 + "rotation_speed": 0.0, + "laser_speed": 0.0, + "overheat": 0.0 } func earn_resource(resource_name: String, amount: int, invoice: String = "Earned"): diff --git a/apps/gamejam/brackeys/13/scripts/laser.gd b/apps/gamejam/brackeys/13/scripts/laser.gd new file mode 100644 index 000000000..0c958846e --- /dev/null +++ b/apps/gamejam/brackeys/13/scripts/laser.gd @@ -0,0 +1,10 @@ +extends Area2D + +var movement_vector := Vector2(0, -1) + +func _physics_process(delta): + var laser_speed = Global.get_starship_stat("laser_speed") + global_position += movement_vector.rotated(rotation) * laser_speed * delta + +func _on_visible_on_screen_notifier_2d_screen_exited(): + queue_free() diff --git a/apps/gamejam/brackeys/13/scripts/spaceship.gd b/apps/gamejam/brackeys/13/scripts/spaceship.gd index 289403197..96bff83c2 100644 --- a/apps/gamejam/brackeys/13/scripts/spaceship.gd +++ b/apps/gamejam/brackeys/13/scripts/spaceship.gd @@ -1,5 +1,15 @@ class_name Spaceship extends CharacterBody2D +signal laser_shot(laser) + +@onready var scope = $OmniScope + +var laser_scene = preload("res://scenes/laser.tscn") + +func _process(delta): + if Input.is_action_pressed("shoot"): + shoot_laser() + func _physics_process(delta): var acceleration = Global.get_starship_stat("acceleration") var max_speed = Global.get_starship_stat("max_speed") @@ -40,3 +50,9 @@ func _physics_process(delta): global_position.x = screen_size.x elif global_position.x > screen_size.x: global_position.x = 0 + +func shoot_laser(): + var laser = laser_scene.instantiate(); + laser.global_position = scope.global_position + laser.rotation = rotation + emit_signal("laser_shot", laser) diff --git a/apps/kbve/kbve.com/src/content/journal/02-19.mdx b/apps/kbve/kbve.com/src/content/journal/02-19.mdx index a88064027..522664d4a 100644 --- a/apps/kbve/kbve.com/src/content/journal/02-19.mdx +++ b/apps/kbve/kbve.com/src/content/journal/02-19.mdx @@ -21,6 +21,10 @@ tags: The global resources will be held under a singleton that will make it easier to call anywhere within the application. By moving all our variables into there, we can use them in both the asteroid scene and also call them in the UI. +- 06:24PM + + The Omniscope will be where the weapons are fired off from and a node called `Projectiles` will hold the different bullets and lasers that get fired off. + ## 2024 ### Flex