Skip to content

Commit

Permalink
58-migrate-to-42 (#59)
Browse files Browse the repository at this point in the history
* Editor convert, updated gitignore

* Laser ray

* Laser reciever and mergable

* player and smr

* switcher

* Reformatted and linted

* Applied new scripts to scenes

* Fixing tweens

* Re-link regions to player

* Fix laser tester scene

* Load and unload light_only material in editor

* Add base layer to merges

* Renamed laser folder, used $ to referece beam

* Resets beam on ready

* Update workflows, disable testing

* Attempt to fix md deps

* Remove markdown formatting

* add setuptools
  • Loading branch information
microBob authored Dec 12, 2023
1 parent e3006f6 commit 2ee8a36
Show file tree
Hide file tree
Showing 30 changed files with 424 additions and 476 deletions.
4 changes: 0 additions & 4 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# PR Summary

## Addressed Issues (Fixes/Closes)

- Closes #

## Brief summary of changes

-
Expand Down
6 changes: 2 additions & 4 deletions .github/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
gdtoolkit==3.5.0
mdformat-gfm==0.3.5
mdformat_footnote==0.1.1
mdformat_frontmatter==2.0.1
gdtoolkit==4.2.2
setuptools==69.0.2
7 changes: 2 additions & 5 deletions .github/workflows/autoformat-and-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

- name: 🛎 Checkout
if: github.event.pull_request.user.login != 'dependabot[bot]'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.WORKFLOW_COMMIT }}
Expand All @@ -39,12 +39,9 @@ jobs:
- name: 🧼 Format code
run: gdformat scripts/ tests/

- name: 🧼 Format Markdown
run: mdformat .

- name: ✅ Commit code format changes
if: github.event.pull_request.user.login != 'dependabot[bot]'
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Autoformat scripts"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: 'Dependency Review'
uses: actions/dependency-review-action@v3
File renamed without changes.
17 changes: 8 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
# Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode,godot,macos,linux,windows
# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode,godot,macos,linux,windows
# Created by https://www.toptal.com/developers/gitignore/api/macos,linux,windows,godot,visualstudiocode
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,linux,windows,godot,visualstudiocode

### Godot ###
# Godot 4+ specific ignores
.godot/

# Godot-specific ignores
.import/
export.cfg
export_presets.cfg

# Imported translations (automatically generated from CSV files)
*.translation

# Mono-specific ignores
.mono/
data_*/
mono_crash.*.json

### Linux ###
*~
Expand Down Expand Up @@ -80,12 +85,6 @@ Temporary Items
.history
.ionide

# Support for Project snippet scope
.vscode/*.code-snippets

# Ignore code-workspaces
*.code-workspace

### Windows ###
# Windows thumbnail cache files
Thumbs.db
Expand All @@ -112,7 +111,7 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk

# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,godot,macos,linux,windows
# End of https://www.toptal.com/developers/gitignore/api/macos,linux,windows,godot,visualstudiocode

# Assets and addons
assets/
Expand Down
20 changes: 20 additions & 0 deletions objects/laser/laser_emitter.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[gd_scene load_steps=4 format=3 uid="uid://gsxbxdxg05i7"]

[ext_resource type="Texture2D" uid="uid://cfg25djsh1m3h" path="res://assets/laser/laser.webp" id="1"]
[ext_resource type="PackedScene" uid="uid://crroxg17rip0j" path="res://objects/laser/laser_ray.tscn" id="2"]
[ext_resource type="Script" path="res://scripts/laser/laser_emitter.gd" id="3"]

[node name="LaserEmitter" type="StaticBody2D"]
collision_mask = 4113
script = ExtResource("3")
ray_object = ExtResource("2")

[node name="Collider" type="CollisionPolygon2D" parent="."]
use_parent_material = true
polygon = PackedVector2Array(0, -50, 18, -50, 94, 0, 18, 50, 0, 50)

[node name="Shape3D" type="Sprite2D" parent="."]
show_behind_parent = true
use_parent_material = true
texture = ExtResource("1")
offset = Vector2(50, 0)
15 changes: 15 additions & 0 deletions objects/laser/laser_ray.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[gd_scene load_steps=2 format=3 uid="uid://crroxg17rip0j"]

[ext_resource type="Script" path="res://scripts/laser/laser_ray.gd" id="1_iqyuj"]

[node name="LaserRay" type="RayCast2D"]
target_position = Vector2(10000, 0)
collide_with_areas = true
script = ExtResource("1_iqyuj")

[node name="Beam" type="Line2D" parent="."]
use_parent_material = true
points = PackedVector2Array(0, 0, 100, 0)
width = 25.0
begin_cap_mode = 2
end_cap_mode = 2
22 changes: 22 additions & 0 deletions objects/laser/laser_receiver.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[gd_scene load_steps=4 format=3 uid="uid://b4eks38ui1ucu"]

[ext_resource type="Texture2D" uid="uid://jweaw2pllh3b" path="res://assets/laser/receiver.webp" id="1"]
[ext_resource type="Script" path="res://scripts/laser/laser_receiver.gd" id="2"]

[sub_resource type="RectangleShape2D" id="1"]
size = Vector2(42, 100)

[node name="LaserReceiver" type="StaticBody2D"]
collision_mask = 4113
script = ExtResource("2")

[node name="Collider" type="CollisionShape2D" parent="."]
use_parent_material = true
position = Vector2(21, 0)
shape = SubResource("1")

[node name="Shape3D" type="Sprite2D" parent="."]
show_behind_parent = true
use_parent_material = true
texture = ExtResource("1")
offset = Vector2(50, 0)
23 changes: 0 additions & 23 deletions objects/lasers/laser_emitter.tscn

This file was deleted.

19 changes: 0 additions & 19 deletions objects/lasers/laser_ray.tscn

This file was deleted.

23 changes: 0 additions & 23 deletions objects/lasers/laser_receiver.tscn

This file was deleted.

36 changes: 16 additions & 20 deletions objects/mirror.tscn
Original file line number Diff line number Diff line change
@@ -1,46 +1,42 @@
[gd_scene load_steps=5 format=2]
[gd_scene load_steps=4 format=3 uid="uid://3m5n5ogdfwma"]

[ext_resource path="res://scripts/mergable.gd" type="Script" id=1]
[ext_resource path="res://shaders/light_only_canvas_item.tres" type="Material" id=2]
[ext_resource type="Script" path="res://scripts/mergable.gd" id="1"]

[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 50, 50 )
[sub_resource type="RectangleShape2D" id="1"]
size = Vector2(100, 100)

[sub_resource type="SegmentShape2D" id=2]
a = Vector2( -100, 100 )
b = Vector2( 100, -100 )
[sub_resource type="SegmentShape2D" id="2"]
a = Vector2(-100, 100)
b = Vector2(100, -100)

[node name="Mirror" type="RigidBody2D"]
material = ExtResource( 2 )
use_parent_material = true
collision_layer = 4096
collision_mask = 4113
script = ExtResource( 1 )
script = ExtResource("1")
physics_object_type = 4096

[node name="Shape" type="Polygon2D" parent="."]
[node name="Shape3D" type="Polygon2D" parent="."]
use_parent_material = true
color = Color( 1, 1, 1, 0.196078 )
polygon = PoolVector2Array( -50, -50, 50, -50, 50, 50, -50, 50 )
color = Color(1, 1, 1, 0.196078)
polygon = PackedVector2Array(-50, -50, 50, -50, 50, 50, -50, 50)

[node name="MirrorCollider" type="CollisionShape2D" parent="."]
use_parent_material = true
shape = SubResource( 1 )
shape = SubResource("1")

[node name="Reflector" type="Area2D" parent="." groups=["mirror_reflector"]]
use_parent_material = true
collision_mask = 4113
script = ExtResource( 1 )
script = ExtResource("1")

[node name="ReflectorCollider" type="CollisionShape2D" parent="Reflector"]
use_parent_material = true
scale = Vector2( 0.5, 0.5 )
shape = SubResource( 2 )
scale = Vector2(0.5, 0.5)
shape = SubResource("2")
one_way_collision_margin = 10.0

[node name="ReflectorShape" type="Line2D" parent="Reflector"]
use_parent_material = true
points = PoolVector2Array( -45, 45, 45, -45 )
default_color = Color( 1, 1, 1, 1 )
points = PackedVector2Array(-45, 45, 45, -45)
begin_cap_mode = 2
end_cap_mode = 2
45 changes: 24 additions & 21 deletions objects/player.tscn
Original file line number Diff line number Diff line change
@@ -1,44 +1,47 @@
[gd_scene load_steps=5 format=2]
[gd_scene load_steps=5 format=3 uid="uid://cgla7xvrqq7wy"]

[ext_resource path="res://objects/spectrum_merge_region.tscn" type="PackedScene" id=1]
[ext_resource path="res://objects/spectrum_switcher.tscn" type="PackedScene" id=2]
[ext_resource path="res://scripts/player.gd" type="Script" id=3]
[ext_resource type="PackedScene" uid="uid://bc3vxsludc7lq" path="res://objects/spectrum_merge_region.tscn" id="1"]
[ext_resource type="PackedScene" uid="uid://dur7cmriwxkrp" path="res://objects/spectrum_switcher.tscn" id="2"]
[ext_resource type="Script" path="res://scripts/player.gd" id="3"]

[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 50, 50 )
[sub_resource type="RectangleShape2D" id="1"]
size = Vector2(100, 100)

[node name="Player" type="KinematicBody2D"]
[node name="Player" type="CharacterBody2D" node_paths=PackedStringArray("red_region", "green_region", "blue_region")]
collision_mask = 4113
script = ExtResource( 3 )
__meta__ = {
"_edit_group_": true
}
node_paths = [ NodePath("RedRegion"), NodePath("GreenRegion"), NodePath("BlueRegion") ]
script = ExtResource("3")
red_region = NodePath("RedRegion")
green_region = NodePath("GreenRegion")
blue_region = NodePath("BlueRegion")

[node name="Collider" type="CollisionShape2D" parent="."]
shape = SubResource( 1 )
shape = SubResource("1")

[node name="Body" type="Polygon2D" parent="."]
polygon = PoolVector2Array( -50, -50, 50, -50, 50, 50, -50, 50 )
polygon = PackedVector2Array(-50, -50, 50, -50, 50, 50, -50, 50)

[node name="RedRegion" parent="." instance=ExtResource( 1 )]
[node name="RedRegion" parent="." instance=ExtResource("1")]
modulate = Color(0.780392, 0.305882, 0.32549, 1)
rotation = 1.59649
scale = Vector2( 1e-05, 1e-05 )
scale = Vector2(1e-05, 1e-05)
collision_mask = 12339
spectrum = 1

[node name="GreenRegion" parent="." instance=ExtResource( 1 )]
[node name="GreenRegion" parent="." instance=ExtResource("1")]
modulate = Color(0.32549, 0.780392, 0.305882, 1)
rotation = -0.00387989
scale = Vector2( 1e-05, 1e-05 )
scale = Vector2(1e-05, 1e-05)
collision_mask = 20565
spectrum = 2

[node name="BlueRegion" parent="." instance=ExtResource( 1 )]
[node name="BlueRegion" parent="." instance=ExtResource("1")]
modulate = Color(0.305882, 0.32549, 0.780392, 1)
rotation = 5.42466
scale = Vector2( 1e-05, 1e-05 )
scale = Vector2(1e-05, 1e-05)
collision_mask = 37017
spectrum = 3

[node name="SpectrumSwitcher" parent="." instance=ExtResource( 2 )]
[node name="SpectrumSwitcher" parent="." instance=ExtResource("2")]
position = Vector2(300, 2.08165e-12)

[connection signal="spectrum_switched" from="SpectrumSwitcher" to="." method="_on_SpectrumSwitcher_spectrum_switched"]
Loading

0 comments on commit 2ee8a36

Please sign in to comment.