diff --git a/apps/gamejam/brackeys/13/assets/kenny/space-shooter-redux/png/playerShip3_red.png b/apps/gamejam/brackeys/13/assets/kenny/space-shooter-redux/png/playerShip3_red.png new file mode 100644 index 000000000..796e81d71 Binary files /dev/null and b/apps/gamejam/brackeys/13/assets/kenny/space-shooter-redux/png/playerShip3_red.png differ diff --git a/apps/gamejam/brackeys/13/assets/kenny/space-shooter-redux/png/playerShip3_red.png.import b/apps/gamejam/brackeys/13/assets/kenny/space-shooter-redux/png/playerShip3_red.png.import new file mode 100644 index 000000000..b47bddf4e --- /dev/null +++ b/apps/gamejam/brackeys/13/assets/kenny/space-shooter-redux/png/playerShip3_red.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c0kmvkwygg0ox" +path="res://.godot/imported/playerShip3_red.png-94ca45c3e4c27e99caaf86799e6a053a.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/kenny/space-shooter-redux/png/playerShip3_red.png" +dest_files=["res://.godot/imported/playerShip3_red.png-94ca45c3e4c27e99caaf86799e6a053a.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 792633fe7..2d7785576 100644 --- a/apps/gamejam/brackeys/13/project.godot +++ b/apps/gamejam/brackeys/13/project.godot @@ -20,6 +20,18 @@ config/icon="res://icon.svg" window/stretch/mode="canvas_items" window/per_pixel_transparency/allowed=true +[layer_names] + +2d_physics/layer_1="timespace" +2d_physics/layer_2="universe" +2d_physics/layer_3="galaxy" +2d_physics/layer_4="environment" +2d_physics/layer_5="planet" +2d_physics/layer_6="spaceship" +2d_physics/layer_7="npc" +2d_physics/layer_8="entity" +2d_physics/layer_9="projectile" + [rendering] renderer/rendering_method="gl_compatibility" diff --git a/apps/gamejam/brackeys/13/scenes/game.tscn b/apps/gamejam/brackeys/13/scenes/game.tscn index a327fc6f2..818cc3b5e 100644 --- a/apps/gamejam/brackeys/13/scenes/game.tscn +++ b/apps/gamejam/brackeys/13/scenes/game.tscn @@ -1,3 +1,8 @@ -[gd_scene format=3 uid="uid://cbrda40vq26pj"] +[gd_scene load_steps=2 format=3 uid="uid://cbrda40vq26pj"] + +[ext_resource type="PackedScene" uid="uid://1s5v0llrjq3" path="res://scenes/spaceship.tscn" id="1_rlyye"] [node name="Game" type="Node2D"] + +[node name="Spaceship" parent="." instance=ExtResource("1_rlyye")] +position = Vector2(500, 300) diff --git a/apps/gamejam/brackeys/13/scenes/spaceship.tscn b/apps/gamejam/brackeys/13/scenes/spaceship.tscn new file mode 100644 index 000000000..c91152cf0 --- /dev/null +++ b/apps/gamejam/brackeys/13/scenes/spaceship.tscn @@ -0,0 +1,19 @@ +[gd_scene load_steps=4 format=3 uid="uid://1s5v0llrjq3"] + +[ext_resource type="Texture2D" uid="uid://c0kmvkwygg0ox" path="res://assets/kenny/space-shooter-redux/png/playerShip3_red.png" id="1_8hcjj"] +[ext_resource type="Script" path="res://scripts/spaceship.gd" id="1_uejed"] + +[sub_resource type="CircleShape2D" id="CircleShape2D_s734v"] +radius = 40.05 + +[node name="Spaceship" type="CharacterBody2D"] +script = ExtResource("1_uejed") + +[node name="Sprite2D" type="Sprite2D" parent="."] +position = Vector2(0, -1) +texture = ExtResource("1_8hcjj") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2(0, 4) +rotation = -0.0497135 +shape = SubResource("CircleShape2D_s734v") diff --git a/apps/gamejam/brackeys/13/scripts/spaceship.gd b/apps/gamejam/brackeys/13/scripts/spaceship.gd new file mode 100644 index 000000000..cfe9e6113 --- /dev/null +++ b/apps/gamejam/brackeys/13/scripts/spaceship.gd @@ -0,0 +1,32 @@ +class_name Spaceship extends CharacterBody2D + +## Attacks +signal gunship_fire + +## Defense +signal shield_decay + + + +const SPEED = 300.0 +const JUMP_VELOCITY = -400.0 + + +func _physics_process(delta: float) -> void: + # Add the gravity. for later on. + if not is_on_floor(): + velocity += get_gravity() * delta + + # Handle jump. + if Input.is_action_just_pressed("ui_accept") and is_on_floor(): + velocity.y = JUMP_VELOCITY + + # Get the input direction and handle the movement/deceleration. + # As good practice, you should replace UI actions with custom gameplay actions. + var direction := Input.get_axis("ui_left", "ui_right") + if direction: + velocity.x = direction * SPEED + else: + velocity.x = move_toward(velocity.x, 0, SPEED) + + move_and_slide() diff --git a/apps/kbve/kbve.com/astro.config.mjs b/apps/kbve/kbve.com/astro.config.mjs index 34b0ca6a2..7354853fb 100644 --- a/apps/kbve/kbve.com/astro.config.mjs +++ b/apps/kbve/kbve.com/astro.config.mjs @@ -5,12 +5,12 @@ import partytown from '@astrojs/partytown'; import sitemap from '@astrojs/sitemap'; import tailwind from '@astrojs/tailwind'; import mdx from '@astrojs/mdx'; -import rehypeMermaid from "rehype-mermaid"; +import rehypeMermaid from 'rehype-mermaid'; import starlight from '@astrojs/starlight'; import { fileURLToPath } from 'node:url'; import markdownConfig from './markdown.config'; -import starlightSiteGraph from 'starlight-site-graph' +import starlightSiteGraph from 'starlight-site-graph'; import { defineConfig as defineViteConfig } from 'vite'; // import topLevelAwait from 'vite-plugin-top-level-await'; @@ -39,11 +39,13 @@ export default defineConfig({ // }, integrations: [ starlight({ - plugins: [starlightSiteGraph({ - graphConfig: { - "renderArrows": true - } - })], + plugins: [ + starlightSiteGraph({ + graphConfig: { + renderArrows: true, + }, + }), + ], title: 'KBVE Docs', editLink: { baseUrl: 'https://github.com/kbve/kbve/edit/dev/apps/kbve.com', @@ -240,12 +242,17 @@ export default defineConfig({ ], // markdown: markdownConfig, markdown: { - rehypePlugins: [[rehypeMermaid, { strategy: "img-svg", dark: true }]], - }, + rehypePlugins: [[rehypeMermaid, { strategy: 'img-svg', dark: true }]], + }, vite: defineViteConfig({ ssr: { noExternal: ['path-to-regexp'], - }, + }, + server: { + watch: { + ignored: ['**/*'], + }, + }, build: { rollupOptions: { // maxConcurrency: 2, diff --git a/apps/kbve/kbve.com/src/content/docs/project/brackeys.mdx b/apps/kbve/kbve.com/src/content/docs/project/brackeys.mdx index 9013dcdd0..c120fd55b 100644 --- a/apps/kbve/kbve.com/src/content/docs/project/brackeys.mdx +++ b/apps/kbve/kbve.com/src/content/docs/project/brackeys.mdx @@ -15,6 +15,16 @@ tags: - gaming --- + +import { + Aside, + Steps, + Card, + CardGrid, + Code, + FileTree, +} from '@astrojs/starlight/components'; + ## Barckeys Game Jam @@ -132,4 +142,60 @@ inspired by spaceteam #### Space Shooter Redux The spaceship asset pack that we will be using is from [Kenny Space Shooter Redux](https://kenney.nl/assets/space-shooter-redux), released as a CC0. There are two folders, `_space-shooter-redux` and `space-shooter-redux`, all of the assets from the pack are under the `_space-shooter-redux` and objects that we will use will be copied over to `space-shooter-redux`. -Without having to dump a bunch of assets, I will try to use as many as needed and then going to delete the `_space-shooter-redux` folder. \ No newline at end of file +Without having to dump a bunch of assets, I will try to use as many as needed and then going to delete the `_space-shooter-redux` folder. + +### Layers + +These are the layers that I am thinking we will be operating in: + +``` + +2d_physics/layer_1="timespace" +2d_physics/layer_2="universe" +2d_physics/layer_3="galaxy" +2d_physics/layer_4="environment" +2d_physics/layer_5="planet" +2d_physics/layer_6="spaceship" +2d_physics/layer_7="npc" +2d_physics/layer_8="entity" +2d_physics/layer_9="projectile" + +``` + +The first three layers, `timespace`, `universe` and `galaxy` will act as the background layers and the `environment` will be the first delta-time layer from the client-side point of view. +Using the layer 1 through 3, we can create a parallax style simulation of space. +The actual ship that the player controls will inherit the layer 6 aka `spaceship`. +Finally we would split the `npc` and `entity` layer because we might want the `npc` to have additional abilities, like a star path finding. + + + + +1. Timespace + - Tracks the time without a reference to frames. + +2. Universe + - Client-side background + +3. Galaxy + - Sub-background with the purpose of creating a parallax effect. + +4. Environment + - Tracks the delta-time, with a reference to the client's frame. + +5. Planet + - This layer will include spacestations and presents an entity that has true collision. + - Players will be to enter the planet, which can open up minigames or special UI screens. + +6. Spaceship + - The actual layermask for the player. + +7. NPC + - Layermask for pirates or friendly ships. + +8. Entity + - Layermask for objects that can be mined, cause damage and/or hold any interaction. + +9. Projectile + - Ammo shells and lasers, used to raycast hits as well. + + \ No newline at end of file diff --git a/apps/kbve/kbve.com/src/content/journal/02-18.mdx b/apps/kbve/kbve.com/src/content/journal/02-18.mdx index 5c9135704..70e0fd4ff 100644 --- a/apps/kbve/kbve.com/src/content/journal/02-18.mdx +++ b/apps/kbve/kbve.com/src/content/journal/02-18.mdx @@ -41,6 +41,31 @@ imaginary world problem - Damn, these reusable workflows on the cloud vm are so Next, the focus was getting the `utils-godot-itch-build-pipeline.yml`, which is another reusable workflow that I plan to call during this gamejam. Eventually the goal will be to make this monorepo super modular and easy to build out even faster, there might be a point where we can go from concept to full startup in less than 48 hours. +- 11:58PM + + To test the reusable workflow, we would call it under the `jobs` like this: + +```yaml + +jobs: + trigger-godot-build: + uses: KBVE/kbve/.github/workflows/utils-godot-itch-build-pipeline.yml@main + with: + branch: "dev" + deploy_to_itch: true + godot_version: "4.3" + export_name: "TowerDef" + project_path: "./apps/rust_godot_towerdefense/godot" + build_artifact_name: "towerdefense_web_build" + itch_username: "kbve" + itch_gameid: "tower-defense" + secrets: + butler_api: ${{ secrets.ITCH_API }} + + +``` + + However, I will do this tomorrow, after I finish up the core player script and the movement. ### B13