Initial Commit

This commit is contained in:
gemdude46 2023-01-26 18:25:40 +00:00
parent 2dce133760
commit dbb0f17743
63 changed files with 2881 additions and 1 deletions

BIN
Graphics/.DS_Store vendored Normal file

Binary file not shown.

View File

@ -0,0 +1,12 @@
[gd_resource type="SpriteFrames" load_steps=3 format=2]
[ext_resource path="res://Graphics/Units/NPCWalk.png" type="Texture" id=1]
[ext_resource path="res://Graphics/Units/NPC.png" type="Texture" id=2]
[resource]
animations = [ {
"frames": [ ExtResource( 2 ), ExtResource( 1 ) ],
"loop": true,
"name": "default",
"speed": 5.0
} ]

View File

@ -0,0 +1,12 @@
[gd_resource type="SpriteFrames" load_steps=3 format=2]
[ext_resource path="res://Graphics/Units/PlayerWalk.png" type="Texture" id=1]
[ext_resource path="res://Graphics/Units/Player.png" type="Texture" id=2]
[resource]
animations = [ {
"frames": [ ExtResource( 2 ), ExtResource( 1 ) ],
"loop": true,
"name": "default",
"speed": 20.0
} ]

View File

@ -0,0 +1,12 @@
[gd_resource type="SpriteFrames" load_steps=3 format=2]
[ext_resource path="res://Graphics/Units/PlayerWalk.png" type="Texture" id=1]
[ext_resource path="res://Graphics/Units/Player.png" type="Texture" id=2]
[resource]
animations = [ {
"frames": [ ExtResource( 2 ), ExtResource( 1 ) ],
"loop": true,
"name": "default",
"speed": 10.0
} ]

BIN
Graphics/Tiles/.DS_Store vendored Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/PalaceTileSet.png-b6855e565d4f2243473eb1aaecf68c90.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Graphics/Tiles/PalaceTileSet.png"
dest_files=[ "res://.import/PalaceTileSet.png-b6855e565d4f2243473eb1aaecf68c90.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/LedgeLeft.png-2775825292c38ce4aee031538f9a8d1a.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Graphics/Tiles/ledge/LedgeLeft.png"
dest_files=[ "res://.import/LedgeLeft.png-2775825292c38ce4aee031538f9a8d1a.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/LedgeMiddle.png-d5b49d2c5e68957aa07502bf0062ad5e.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Graphics/Tiles/ledge/LedgeMiddle.png"
dest_files=[ "res://.import/LedgeMiddle.png-d5b49d2c5e68957aa07502bf0062ad5e.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/LedgeRight.png-2c6c93c700fa63ad5da147390da161ab.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Graphics/Tiles/ledge/LedgeRight.png"
dest_files=[ "res://.import/LedgeRight.png-2c6c93c700fa63ad5da147390da161ab.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/LedgeSingle.png-de1403dec78f2a50996682f24644fe14.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Graphics/Tiles/ledge/LedgeSingle.png"
dest_files=[ "res://.import/LedgeSingle.png-de1403dec78f2a50996682f24644fe14.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

BIN
Graphics/Tiles/slope/.DS_Store vendored Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/SlopeLeft2Borderless.png-19102a916845e610ebf4d804861b1aea.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Graphics/Tiles/slope/SlopeLeft2Borderless.png"
dest_files=[ "res://.import/SlopeLeft2Borderless.png-19102a916845e610ebf4d804861b1aea.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/SlopeLeftBorder.png-ceb89d3b093f46c1d76d2ff348ec679f.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Graphics/Tiles/slope/SlopeLeftBorder.png"
dest_files=[ "res://.import/SlopeLeftBorder.png-ceb89d3b093f46c1d76d2ff348ec679f.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/SlopeRightBorder.png-ef1afb62ea64fbb50d9291353bb9682e.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Graphics/Tiles/slope/SlopeRightBorder.png"
dest_files=[ "res://.import/SlopeRightBorder.png-ef1afb62ea64fbb50d9291353bb9682e.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/SlopeRightBorderless.png-44c3e94f0a25597de76d63bdf0f35bb4.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Graphics/Tiles/slope/SlopeRightBorderless.png"
dest_files=[ "res://.import/SlopeRightBorderless.png-44c3e94f0a25597de76d63bdf0f35bb4.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

BIN
Graphics/Units/.DS_Store vendored Normal file

Binary file not shown.

BIN
Graphics/Units/NPC.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/NPC.png-ca715013d9088b961e084f787518acce.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Graphics/Units/NPC.png"
dest_files=[ "res://.import/NPC.png-ca715013d9088b961e084f787518acce.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

BIN
Graphics/Units/NPCJump1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/NPCJump1.png-7642ac14379c2a312ae5db9fc6caea56.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Graphics/Units/NPCJump1.png"
dest_files=[ "res://.import/NPCJump1.png-7642ac14379c2a312ae5db9fc6caea56.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

BIN
Graphics/Units/NPCJump2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/NPCJump2.png-8f8f5927d711e64760167ae96def1ae6.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Graphics/Units/NPCJump2.png"
dest_files=[ "res://.import/NPCJump2.png-8f8f5927d711e64760167ae96def1ae6.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

BIN
Graphics/Units/NPCWalk.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/NPCWalk.png-f21be3a97228df26acc6200c6f657b43.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Graphics/Units/NPCWalk.png"
dest_files=[ "res://.import/NPCWalk.png-f21be3a97228df26acc6200c6f657b43.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

BIN
Graphics/Units/Player.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Player.png-3bbaf909e595ec78ffb96190a43bc8c2.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Graphics/Units/Player.png"
dest_files=[ "res://.import/Player.png-3bbaf909e595ec78ffb96190a43bc8c2.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/PlayerJump1.png-35abd22d5526cf19e8d6544ce176e9e1.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Graphics/Units/PlayerJump1.png"
dest_files=[ "res://.import/PlayerJump1.png-35abd22d5526cf19e8d6544ce176e9e1.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/PlayerJump2.png-f3d7393823fd58bb3818f8843d6c6e10.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Graphics/Units/PlayerJump2.png"
dest_files=[ "res://.import/PlayerJump2.png-f3d7393823fd58bb3818f8843d6c6e10.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/PlayerRecoil.png-3f8702925aa2548c6daf6c3a606018d2.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Graphics/Units/PlayerRecoil.png"
dest_files=[ "res://.import/PlayerRecoil.png-3f8702925aa2548c6daf6c3a606018d2.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/PlayerWalk.png-97cda3b7502828341bf53a9e56c0f251.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Graphics/Units/PlayerWalk.png"
dest_files=[ "res://.import/PlayerWalk.png-97cda3b7502828341bf53a9e56c0f251.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

172
LICENSE Normal file
View File

@ -0,0 +1,172 @@
Academic Free License ("AFL") v. 3.0
This Academic Free License (the "License") applies to any original work of
authorship (the "Original Work") whose owner (the "Licensor") has placed the
following licensing notice adjacent to the copyright notice for the Original
Work:
Licensed under the Academic Free License version 3.0
1) Grant of Copyright License. Licensor grants You a worldwide, royalty-free,
non-exclusive, sublicensable license, for the duration of the copyright, to do
the following:
a) to reproduce the Original Work in copies, either alone or as part of a
collective work;
b) to translate, adapt, alter, transform, modify, or arrange the Original
Work, thereby creating derivative works ("Derivative Works") based upon
the Original Work;
c) to distribute or communicate copies of the Original Work and
Derivative Works to the public, under any license of your choice that
does not contradict the terms and conditions, including Licensor's
reserved rights and remedies, in this Academic Free License;
d) to perform the Original Work publicly; and
e) to display the Original Work publicly.
2) Grant of Patent License. Licensor grants You a worldwide, royalty-free,
non-exclusive, sublicensable license, under patent claims owned or controlled
by the Licensor that are embodied in the Original Work as furnished by the
Licensor, for the duration of the patents, to make, use, sell, offer for sale,
have made, and import the Original Work and Derivative Works.
3) Grant of Source Code License. The term "Source Code" means the preferred
form of the Original Work for making modifications to it and all available
documentation describing how to modify the Original Work. Licensor agrees to
provide a machine-readable copy of the Source Code of the Original Work along
with each copy of the Original Work that Licensor distributes. Licensor
reserves the right to satisfy this obligation by placing a machine-readable
copy of the Source Code in an information repository reasonably calculated to
permit inexpensive and convenient access by You for as long as Licensor
continues to distribute the Original Work.
4) Exclusions From License Grant. Neither the names of Licensor, nor the names
of any contributors to the Original Work, nor any of their trademarks or
service marks, may be used to endorse or promote products derived from this
Original Work without express prior permission of the Licensor. Except as
expressly stated herein, nothing in this License grants any license to
Licensor's trademarks, copyrights, patents, trade secrets or any other
intellectual property. No patent license is granted to make, use, sell, offer
for sale, have made, or import embodiments of any patent claims other than the
licensed claims defined in Section 2. No license is granted to the trademarks
of Licensor even if such marks are included in the Original Work. Nothing in
this License shall be interpreted to prohibit Licensor from licensing under
terms different from this License any Original Work that Licensor otherwise
would have a right to license.
5) External Deployment. The term "External Deployment" means the use,
distribution, or communication of the Original Work or Derivative Works in any
way such that the Original Work or Derivative Works may be used by anyone
other than You, whether those works are distributed or communicated to those
persons or made available as an application intended for use over a network.
As an express condition for the grants of license hereunder, You must treat
any External Deployment by You of the Original Work or a Derivative Work as a
distribution under section 1(c).
6) Attribution Rights. You must retain, in the Source Code of any Derivative
Works that You create, all copyright, patent, or trademark notices from the
Source Code of the Original Work, as well as any notices of licensing and any
descriptive text identified therein as an "Attribution Notice." You must cause
the Source Code for any Derivative Works that You create to carry a prominent
Attribution Notice reasonably calculated to inform recipients that You have
modified the Original Work.
7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that
the copyright in and to the Original Work and the patent rights granted herein
by Licensor are owned by the Licensor or are sublicensed to You under the
terms of this License with the permission of the contributor(s) of those
copyrights and patent rights. Except as expressly stated in the immediately
preceding sentence, the Original Work is provided under this License on an "AS
IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without
limitation, the warranties of non-infringement, merchantability or fitness for
a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK
IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this
License. No license to the Original Work is granted by this License except
under this disclaimer.
8) Limitation of Liability. Under no circumstances and under no legal theory,
whether in tort (including negligence), contract, or otherwise, shall the
Licensor be liable to anyone for any indirect, special, incidental, or
consequential damages of any character arising as a result of this License or
the use of the Original Work including, without limitation, damages for loss
of goodwill, work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses. This limitation of liability shall not
apply to the extent applicable law prohibits such limitation.
9) Acceptance and Termination. If, at any time, You expressly assented to this
License, that assent indicates your clear and irrevocable acceptance of this
License and all of its terms and conditions. If You distribute or communicate
copies of the Original Work or a Derivative Work, You must make a reasonable
effort under the circumstances to obtain the express assent of recipients to
the terms of this License. This License conditions your rights to undertake
the activities listed in Section 1, including your right to create Derivative
Works based upon the Original Work, and doing so without honoring these terms
and conditions is prohibited by copyright law and international treaty.
Nothing in this License is intended to affect copyright exceptions and
limitations (including "fair use" or "fair dealing"). This License shall
terminate immediately and You may no longer exercise any of the rights granted
to You by this License upon your failure to honor the conditions in Section
1(c).
10) Termination for Patent Action. This License shall terminate automatically
and You may no longer exercise any of the rights granted to You by this
License as of the date You commence an action, including a cross-claim or
counterclaim, against Licensor or any licensee alleging that the Original Work
infringes a patent. This termination provision shall not apply for an action
alleging patent infringement by combinations of the Original Work with other
software or hardware.
11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this
License may be brought only in the courts of a jurisdiction wherein the
Licensor resides or in which Licensor conducts its primary business, and under
the laws of that jurisdiction excluding its conflict-of-law provisions. The
application of the United Nations Convention on Contracts for the
International Sale of Goods is expressly excluded. Any use of the Original
Work outside the scope of this License or after its termination shall be
subject to the requirements and penalties of copyright or patent law in the
appropriate jurisdiction. This section shall survive the termination of this
License.
12) Attorneys' Fees. In any action to enforce the terms of this License or
seeking damages relating thereto, the prevailing party shall be entitled to
recover its costs and expenses, including, without limitation, reasonable
attorneys' fees and costs incurred in connection with such action, including
any appeal of such action. This section shall survive the termination of this
License.
13) Miscellaneous. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent necessary
to make it enforceable.
14) Definition of "You" in This License. "You" throughout this License,
whether in upper or lower case, means an individual or a legal entity
exercising rights under, and complying with all of the terms of, this License.
For legal entities, "You" includes any entity that controls, is controlled by,
or is under common control with you. For purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the direction or
management of such entity, whether by contract or otherwise, or (ii) ownership
of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial
ownership of such entity.
15) Right to Use. You may use the Original Work in all ways not otherwise
restricted or conditioned by this License or by law, and Licensor promises not
to interfere with or be responsible for such uses by You.
16) Modification of This License. This License is Copyright © 2005 Lawrence
Rosen. Permission is granted to copy, distribute, or communicate this License
without modification. Nothing in this License permits You to modify this
License as applied to the Original Work or to Derivative Works. However, You
may modify the text of this License and copy, distribute or communicate your
modified version (the "Modified License") and apply it to other original works
of authorship subject to the following conditions: (i) You may not indicate in
any way that your Modified License is the "Academic Free License" or "AFL" and
you may not use those names in the name of your Modified License; (ii) You
must replace the notice specified in the first paragraph above with the notice
"Licensed under <insert your license name here>" or with a notice of your own
that is not confusingly similar to the notice in this License; and (iii) You
may not claim that your original works are open source software unless your
Modified License has been approved by Open Source Initiative (OSI) and You
comply with its license review and certification process.

View File

@ -1,2 +1,54 @@
# Jam10
<p align="right">
<a href="https://discord.gg/KnJGY9S">
<img src="https://github.com/fenix-hub/ColoredBadges/blob/master/svg/social/discord.svg" alt="react" style="vertical-align:top; margin:6px 4px">
</a>
</p>
This plugin is now supported in [Godot Extended Library Discord](https://discord.gg/JNrcucg), check out the [Godot Extended Library Project](https://github.com/godot-extended-libraries)!
<img src="addons/github-integration/github-logo.png" align="left" width="64" height="64">
# GitHub Integration
A complete GitHub integration for your Godot Editor! Manage your project without even opening your browser.
Author: *"Nicolo (fenix) Santilio"*
Version: *1.4.3*
Godot Version: *3.2.4-rc3*
Wiki: *[supported](https://github.com/fenix-hub/godot-engine.github-integration/wiki)*
<img align="center" src="addons/github-integration/screenshots/banner.png">
## What is this?
*GitHub Integration* is a addon for Godot Engine that I've created mainly for a personal purpose.
Pushing and Pulling repositories while I'm working on Godot (especially if I'm under a GameJam) could take some time and force me to save the project, open the brwoser/git bash/git gui, and do all the stuff.
With this little addon which works directly in the editor, managing all your repositories will be very easy.
## What can it do?
*Github Integration* offers the main functionalities provided by GitHub (and git itself), in a more accessible way.
Currenlty, you can:
- Manage all of your public and private **repositories**, *including* the ones you share with organizations and the ones in which you are a collaborator (with proper permissions): create, delete, push and clone repositories within your Godot project
- Manage all of your public and private **gists**: delete, edit and create gists with a functional text editor
- Manage collaboration invitations, inviting user to your repositories or accept/decline invitations you have received
## How does it work?
I'm currently working on a [Wiki](https://github.com/fenix-hub/godot-engine.github-integration/wiki) for this plugin. It is a process that will take some time to complete since I want to provide a well-organized wiki with some basic explanations about GitHub itself. Anyway, I'm working on a user-friendly plugin, so everything should be the very ease to use for GitHub experienced users, and a little intuitive for people who never used GitHub or are not so experienced.
If you want to see some screenshots you can find them here `addons/github-integration/screenshots`
## Supporters page
<table>
<tr>
<th><img src='https://avatars0.githubusercontent.com/u/9788627?s=64&v=4' alt='@masterworm2' width="64"/><br/><a href="https://github.com/masterworm2">masterworm2</a></th>
<th><img src='https://avatars0.githubusercontent.com/u/48778172?s=64&v=4' alt='@auctru' width="64"/><br/><a href="https://github.com/autcru">autcru</a></th>
</tr>
</table>
## :warning: Disclaimer
As a "work in progress" project, there is *no warranty* for any eventual issue and bug that may broke your project.
I don't assume any responsibility for possible corruptions of your project. It is always advisable to keep a copy of your project and check any changes you make in your Github repository.
-----------------
> This text file was created via [TextEditor Integration](https://github.com/fenix-hub/godot-engine.text-editor) inside Godot Engine's Editor.

36
SUPPORTERS.md Normal file
View File

@ -0,0 +1,36 @@
This is a list of people who decided to support my plugin with donations. Even though they are not explicitly requested, they would help me pay a part of my university fees and also encourage me to keep my projects updated and make new ones.
*A huge thank you to:*
- Russel aka [masterworm2](https://github.com/masterworm2)
- Autcru aka [autcru](https://github.com/autcru)
- Itch.io users (can't publish their name until their agreement)
-----------------
> This text file was created via [TextEditor Integration](https://github.com/fenix-hub/godot-engine.text-editor) inside Godot Engine's Editor.

26
Scenes/SandboxScene.tscn Normal file
View File

@ -0,0 +1,26 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://Tile Sets/TestTileSet.tres" type="TileSet" id=1]
[ext_resource path="res://Scripts/GameScene.gd" type="Script" id=5]
[ext_resource path="res://Units/Player.tscn" type="PackedScene" id=6]
[node name="Scene" type="Node"]
script = ExtResource( 5 )
tile_set_name = "TestTileSet"
spawning = {
Vector2( 12, 3 ): "NPC"
}
[node name="Stage" type="TileMap" parent="."]
tile_set = ExtResource( 1 )
cell_size = Vector2( 20, 20 )
format = 1
tile_data = PoolIntArray( -786410, 0, 0, -786409, 2, 0, -720874, 6, 0, -720873, 8, 0, -655335, 19, 0, -655334, 21, 0, -524272, 0, 0, -524271, 2, 0, -524262, 19, 0, -524261, 20, 0, -524260, 21, 0, -458736, 6, 0, -458735, 8, 0, -393193, 19, 0, -393192, 20, 0, -393191, 20, 0, -393190, 21, 0, -327660, 16, 0, -327648, 0, 0, -327647, 1, 0, -327646, 1, 0, -327645, 2, 0, -262128, 0, 0, -262127, 2, 0, -262126, 9, 0, -262125, 10, 0, -262124, 5, 0, -262113, 15, 0, -262112, 4, 0, -262111, 4, 0, -262110, 4, 0, -262109, 5, 0, -196596, 9, 0, -196595, 10, 0, -196594, 1, 0, -196593, 1, 0, -196592, 4, 0, -196591, 4, 0, -196590, 4, 0, -196589, 4, 0, -196588, 5, 0, -196586, 0, 0, -196585, 2, 0, -196578, 15, 0, -196577, 4, 0, -196576, 4, 0, -196575, 4, 0, -196574, 4, 0, -196573, 5, 0, -131061, 15, 0, -131060, 4, 0, -131059, 4, 0, -131058, 4, 0, -131057, 4, 0, -131056, 4, 0, -131055, 4, 0, -131054, 4, 0, -131053, 4, 0, -131052, 5, 0, -131050, 3, 0, -131049, 5, 0, -131043, 15, 0, -131042, 4, 0, -131041, 4, 0, -131040, 4, 0, -131039, 4, 0, -131038, 4, 0, -131037, 5, 0, -65532, 0, 0, -65531, 2, 0, -65527, 9, 0, -65526, 10, 0, -65525, 4, 0, -65524, 4, 0, -65523, 4, 0, -65522, 4, 0, -65521, 4, 0, -65520, 4, 0, -65519, 4, 0, -65518, 4, 0, -65517, 4, 0, -65516, 5, 0, -65514, 3, 0, -65513, 4, 0, -65512, 13, 0, -65511, 12, 0, -65508, 15, 0, -65507, 4, 0, -65506, 4, 0, -65505, 4, 0, -65504, 4, 0, -65503, 4, 0, -65502, 4, 0, -65501, 5, 0, 0, 0, 0, 1, 1, 0, 2, 1, 0, 3, 1, 0, 4, 4, 0, 5, 5, 0, 6, 22, 0, 7, 22, 0, 8, 0, 0, 9, 4, 0, 10, 4, 0, 11, 4, 0, 12, 4, 0, 13, 4, 0, 14, 4, 0, 15, 4, 0, 16, 4, 0, 17, 4, 0, 18, 4, 0, 19, 4, 0, 20, 5, 0, 22, 3, 0, 23, 4, 0, 24, 4, 0, 25, 4, 0, 26, 1, 0, 27, 1, 0, 28, 4, 0, 29, 4, 0, 30, 4, 0, 31, 4, 0, 32, 4, 0, 33, 4, 0, 34, 4, 0, 35, 5, 0 )
[node name="Player" parent="." instance=ExtResource( 6 )]
position = Vector2( 10, -150 )
[node name="Camera2D" type="Camera2D" parent="Player"]
offset = Vector2( 0, -15 )
smoothing_enabled = true
smoothing_speed = 6.0

197
Scripts/Constants.gd Normal file
View File

@ -0,0 +1,197 @@
enum UnitType {
PLAYER,
NPC,
}
enum ActionType {
JUMP,
MOVE,
RECOIL,
}
enum UnitCondition {
CURRENT_ACTION,
IS_ON_GROUND,
MOVING_STATUS,
IS_INVINCIBLE,
}
enum UnitCurrentAction {
IDLE,
JUMPING,
RECOILING,
}
enum UnitMovingStatus {
IDLE,
MOVING,
}
enum PlayerInput {
UP,
DOWN,
LEFT,
RIGHT,
GBA_A,
GBA_B,
GBA_START,
GBA_SELECT,
}
enum Direction {
UP,
DOWN,
LEFT,
RIGHT,
}
enum MapElemType {
SQUARE,
SLOPE_LEFT,
SLOPE_RIGHT,
SMALL_SLOPE_LEFT_1,
SMALL_SLOPE_LEFT_2,
SMALL_SLOPE_RIGHT_1,
SMALL_SLOPE_RIGHT_2,
LEDGE,
}
enum SpriteClass {
IDLE,
WALK,
JUMP,
RECOIL,
}
const UNIT_TYPE_ACTIONS = {
UnitType.PLAYER: [
ActionType.JUMP,
ActionType.MOVE,
ActionType.RECOIL,
],
UnitType.NPC: [
ActionType.MOVE,
],
}
const UNIT_TYPE_CURRENT_ACTIONS = {
UnitType.PLAYER: [
UnitCurrentAction.IDLE,
UnitCurrentAction.JUMPING,
UnitCurrentAction.RECOILING,
],
UnitType.NPC: [
UnitCurrentAction.IDLE,
],
}
# default conditions
const UNIT_TYPE_CONDITIONS = {
UnitType.PLAYER: {
UnitCondition.CURRENT_ACTION: UnitCurrentAction.IDLE,
UnitCondition.IS_ON_GROUND: false,
UnitCondition.MOVING_STATUS: UnitMovingStatus.IDLE,
UnitCondition.IS_INVINCIBLE: false,
},
UnitType.NPC: {
UnitCondition.CURRENT_ACTION: UnitCurrentAction.IDLE,
UnitCondition.IS_ON_GROUND: false,
UnitCondition.MOVING_STATUS: UnitMovingStatus.IDLE,
},
}
# in seconds
const CURRENT_ACTION_TIMERS = {
UnitType.PLAYER: {
UnitCurrentAction.JUMPING: 0.4,
UnitCurrentAction.RECOILING: 0.67,
},
}
const UNIT_CONDITION_TIMERS = {
# condition type: [duration, on value, off value]
UnitType.PLAYER: {
UnitCondition.IS_INVINCIBLE: [2.5, true, false],
},
UnitType.NPC: {},
}
# Position relative to player's origin, list of directions to check for collision
const ENV_COLLIDERS = {
UnitType.PLAYER: [
[Vector2(0, 1.5), [Direction.LEFT, Direction.UP, Direction.RIGHT]],
[Vector2(-.25, .25), [Direction.LEFT]],
[Vector2(.25, .25), [Direction.RIGHT]],
[Vector2(-.25, 1.25), [Direction.LEFT]],
[Vector2(.25, 1.25), [Direction.RIGHT]],
# contact with ground is at (0, 0)
[Vector2(0, 0), [Direction.LEFT, Direction.DOWN, Direction.RIGHT]],
],
UnitType.NPC: [
[Vector2(0, 1.5), [Direction.LEFT, Direction.UP, Direction.RIGHT]],
[Vector2(-.25, .25), [Direction.LEFT]],
[Vector2(.25, .25), [Direction.RIGHT]],
[Vector2(-.25, 1.25), [Direction.LEFT]],
[Vector2(.25, 1.25), [Direction.RIGHT]],
[Vector2(0, 0), [Direction.LEFT, Direction.DOWN, Direction.RIGHT]],
],
}
const INPUT_MAP = {
PlayerInput.UP: "ui_up",
PlayerInput.DOWN: "ui_down",
PlayerInput.LEFT: "ui_left",
PlayerInput.RIGHT: "ui_right",
PlayerInput.GBA_A: "gba_a",
PlayerInput.GBA_B: "gba_b",
PlayerInput.GBA_START: "gba_start",
PlayerInput.GBA_SELECT: "gba_select",
}
const TILE_SET_MAP_ELEMS = {
"TestTileSet": {
MapElemType.SQUARE: [0, 1, 2, 3, 4, 5, 6, 7, 8],
MapElemType.SLOPE_LEFT: [15, 16],
MapElemType.SLOPE_RIGHT: [17, 18],
MapElemType.SMALL_SLOPE_LEFT_1: [9],
MapElemType.SMALL_SLOPE_LEFT_2: [10, 11],
MapElemType.SMALL_SLOPE_RIGHT_1: [12],
MapElemType.SMALL_SLOPE_RIGHT_2: [13, 14],
MapElemType.LEDGE: [19, 20, 21, 22],
},
}
const UNIT_SPRITES = {
# Sprite-class: [Is-animation?, Nodes]
UnitType.PLAYER: {
SpriteClass.IDLE: [false, ["Idle"]],
SpriteClass.WALK: [true, ["Walk"]],
SpriteClass.JUMP: [false, ["Jump1", "Jump2"]],
SpriteClass.RECOIL: [false, ["Recoil"]],
},
UnitType.NPC: {
SpriteClass.IDLE: [false, ["Idle"]],
SpriteClass.WALK: [true, ["Walk"]],
SpriteClass.JUMP: [false, ["Jump2"]],
},
}
const UNIT_TYPE_MOVE_SPEEDS = {
UnitType.PLAYER: 6,
UnitType.NPC: 3,
}
const UNIT_TYPE_JUMP_SPEEDS = {
UnitType.PLAYER: 5,
}
const SCALE_FACTOR = 3.5
const GRID_SIZE = 20 # pixels
const GRAVITY = 30
const MAX_FALL_SPEED = -12
const ACCELERATION = 35
const QUANTUM_DIST = 0.001
const SPAWN_DISTANCE = 10
# specialized constants
const FLASH_CYCLE = 0.15

153
Scripts/GameScene.gd Normal file
View File

@ -0,0 +1,153 @@
extends Node
# _process(delta) is called by this class
# player input is handled here
# unit declares its intention in process_unit()
# stage environment interacts with the unit in interact()
# unit executes its resulting state in react()
# stage environment interacts with the unit once more in interact_post()
class_name GameScene
export var tile_set_name: String
const Constants = preload("res://Scripts/Constants.gd")
const Unit = preload("res://Scripts/Unit.gd")
const UNIT_DIRECTORY = {
Constants.UnitType.NPC: preload("res://Units/NPC.tscn"),
}
# positions to unit string
export var spawning : Dictionary
var spawning_map = {} # keeps track of what's alive
var paused : bool = false
var units = []
var player : Player
var player_cam : Camera2D
# [pressed?, just pressed?, just released?]
var input_table = {
Constants.PlayerInput.UP: [false, false, false],
Constants.PlayerInput.DOWN: [false, false, false],
Constants.PlayerInput.LEFT: [false, false, false],
Constants.PlayerInput.RIGHT: [false, false, false],
Constants.PlayerInput.GBA_A: [false, false, false],
Constants.PlayerInput.GBA_B: [false, false, false],
Constants.PlayerInput.GBA_SELECT: [false, false, false],
}
const I_T_PRESSED : int = 0
const I_T_JUST_PRESSED : int = 1
const I_T_JUST_RELEASED : int = 2
var stage_env
var time_elapsed : float = 0
var rng = RandomNumberGenerator.new()
# Called when the node enters the scene tree for the first time.
func _ready():
units.append(get_node("Player"))
player = units[0]
player.init_unit_w_scene(self)
player_cam = player.get_node("Camera2D")
player_cam.make_current()
stage_env = load("res://Scripts/StageEnvironment.gd").new(self)
player.get_node("Camera2D").make_current()
for spawning_key in spawning:
spawning_map[spawning_key] = null
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
# visual effects
if (player.facing == Constants.Direction.RIGHT):
player_cam.offset_h = 1
else:
player_cam.offset_h = -1
read_paused()
if not paused:
# game logic
process_spawning()
for unit in units:
unit.reset_actions()
unit.handle_input(delta)
unit.process_unit(delta, time_elapsed)
stage_env.interact(unit, delta)
unit.react(delta)
time_elapsed += delta
func read_paused():
if Input.is_action_just_pressed(Constants.INPUT_MAP[Constants.PlayerInput.GBA_START]):
paused = !paused
func process_spawning():
for one_spawn in spawning.keys():
if spawning_map[one_spawn] != null:
continue
if abs(one_spawn[0] - player.pos.x) >= Constants.SPAWN_DISTANCE + 1 or abs(one_spawn[1] - player.pos.y) >= Constants.SPAWN_DISTANCE + 1:
continue
if abs(one_spawn[0] - player.pos.x) <= Constants.SPAWN_DISTANCE:
continue
# NPCUnit
var npc_scene = UNIT_DIRECTORY[Constants.UnitType.get(spawning[one_spawn])]
var npc_instance = npc_scene.instance()
add_child(npc_instance)
units.append(npc_instance)
npc_instance.spawn_point = one_spawn
spawning_map[one_spawn] = npc_instance
npc_instance.pos.x = one_spawn[0]
npc_instance.pos.y = one_spawn[1]
npc_instance.position.x = npc_instance.pos.x * Constants.GRID_SIZE
npc_instance.position.y = -1 * npc_instance.pos.y * Constants.GRID_SIZE
npc_instance.init_unit_w_scene(self)
func handle_player_input():
# early exit
if player.get_current_action() == Constants.UnitCurrentAction.RECOILING:
player.set_action(Constants.ActionType.RECOIL)
return
for input_num in input_table.keys():
if Input.is_action_pressed(Constants.INPUT_MAP[input_num]):
input_table[input_num][I_T_PRESSED] = true
input_table[input_num][I_T_JUST_RELEASED] = false
if Input.is_action_just_pressed(Constants.INPUT_MAP[input_num]):
input_table[input_num][I_T_JUST_PRESSED] = true
else:
input_table[input_num][I_T_JUST_PRESSED] = false
else:
input_table[input_num][I_T_PRESSED] = false
input_table[input_num][I_T_JUST_PRESSED] = false
if Input.is_action_just_released(Constants.INPUT_MAP[input_num]):
input_table[input_num][I_T_JUST_RELEASED] = true
else:
input_table[input_num][I_T_JUST_RELEASED] = false
# process input_table
if input_table[Constants.PlayerInput.LEFT][I_T_PRESSED] or input_table[Constants.PlayerInput.RIGHT][I_T_PRESSED]:
if input_table[Constants.PlayerInput.LEFT][I_T_PRESSED] and input_table[Constants.PlayerInput.RIGHT][I_T_PRESSED]:
input_table[Constants.PlayerInput.LEFT][I_T_PRESSED] = false
input_table[Constants.PlayerInput.LEFT][I_T_JUST_PRESSED] = false
var input_dir
if input_table[Constants.PlayerInput.LEFT][I_T_PRESSED]:
input_dir = Constants.Direction.LEFT
else:
input_dir = Constants.Direction.RIGHT
# if action-idle or action-jumping
if (player.get_current_action() == Constants.UnitCurrentAction.IDLE
or player.get_current_action() == Constants.UnitCurrentAction.JUMPING):
# set move
player.set_action(Constants.ActionType.MOVE)
# set facing
player.facing = input_dir
if input_table[Constants.PlayerInput.GBA_A][I_T_PRESSED]:
if (player.get_current_action() == Constants.UnitCurrentAction.JUMPING
or (player.get_current_action() == Constants.UnitCurrentAction.IDLE
and player.unit_conditions[Constants.UnitCondition.IS_ON_GROUND]
and input_table[Constants.PlayerInput.GBA_A][I_T_JUST_PRESSED])):
player.set_action(Constants.ActionType.JUMP)

64
Scripts/GameUtils.gd Normal file
View File

@ -0,0 +1,64 @@
extends Node
# also returns x, y of intersection
static func path_intersects_border(path_from : Vector2, path_to : Vector2, border_pt_a : Vector2, border_pt_b : Vector2):
# y = mx + b
# if path is vertical
if path_from.x == path_to.x:
# if border is vertical
if border_pt_a.x == border_pt_b.x:
return [false, Vector2()]
# if border is not vertical
else:
# if path x is not within range
if path_from.x < min(border_pt_a.x, border_pt_b.x) or path_from.x > max(border_pt_a.x, border_pt_b.x):
return [false, Vector2()]
# find m and b and solve for where border intersects with vertical line
var m = get_m(border_pt_b, border_pt_a)
var b = get_b(border_pt_a, m)
var intersect_y = m * path_from.x + b
var intersects : bool = intersect_y >= min(path_from.y, path_to.y) and intersect_y <= max(path_from.y, path_to.y)
return [intersects, Vector2(path_from.x, intersect_y)]
# else if border is vertical
elif border_pt_a.x == border_pt_b.x:
# if border x is not within range
if border_pt_a.x < min(path_from.x, path_to.x) or border_pt_a.x > max(path_from.x, path_to.x):
return [false, Vector2()]
# find m and b and solve for where border intersects with vertical line
var m = get_m(path_to, path_from)
var b = get_b(path_from, m)
var intersect_y = m * border_pt_a.x + b
return [intersect_y >= min(border_pt_a.y, border_pt_b.y) and intersect_y <= max(border_pt_a.y, border_pt_b.y), Vector2(border_pt_a.x, intersect_y)]
# else if path and border are parallel
elif get_m(path_to, path_from) == get_m(border_pt_b, border_pt_a):
return [false, Vector2()]
else:
var path_m = get_m(path_to, path_from)
var path_b = get_b(path_from, path_m)
var border_m = get_m(border_pt_b, border_pt_a)
var border_b = get_b(border_pt_a, border_m)
# m1x + b1 = m2x + b2
# m1x - m2x = b2 - b1
# x = (b2 - b1) / (m1 - m2)
var intersect_x = (border_b - path_b) / (path_m - border_m)
return [(intersect_x >= min(border_pt_a.x, border_pt_b.x) and intersect_x <= max(border_pt_a.x, border_pt_b.x)
and intersect_x >= min(path_from.x, path_to.x) and intersect_x <= max(path_from.x, path_to.x)), Vector2(intersect_x, path_m * intersect_x + path_b)]
static func get_m(pt_a : Vector2, pt_b : Vector2):
return (pt_b.y - pt_a.y) / (pt_b.x - pt_a.x)
static func get_b(pt : Vector2, m : float):
return pt.y - (m * pt.x)
static func reangle_move(unit, angle_helper):
# pythagoras
var unit_magnitude = sqrt(pow(unit.h_speed, 2) + pow(unit.v_speed, 2))
var helper_magnitude = sqrt(pow(angle_helper[1].x - angle_helper[0].x, 2) + pow(angle_helper[1].y - angle_helper[0].y, 2))
if helper_magnitude == 0:
unit.h_speed = 0
unit.v_speed = 0
return
var factor = unit_magnitude / helper_magnitude
unit.h_speed = (angle_helper[1].x - angle_helper[0].x) * factor
unit.v_speed = (angle_helper[1].y - angle_helper[0].y) * factor

306
Scripts/StageEnvironment.gd Normal file
View File

@ -0,0 +1,306 @@
# Handles unit-environment iteraction
extends Object
const GameUtils = preload("res://Scripts/GameUtils.gd")
const Constants = preload("res://Scripts/Constants.gd")
const GameScene = preload("res://Scripts/GameScene.gd")
const Unit = preload("res://Scripts/Unit.gd")
var scene : GameScene
var colliders = []
# if unit's move vector has at least one of these directional components,
# do the collision check
var collision_into_direction_arrays = [] # nested array
var unit_collision_bounds = {} # maps unit type to [upper, lower, left, right]
func _init(the_scene : GameScene):
scene = the_scene
var stage : TileMap = scene.get_node("Stage")
init_stage_grid(stage)
stage.scale.x = Constants.SCALE_FACTOR
stage.scale.y = Constants.SCALE_FACTOR
# populate unit_collision_bounds
for unit_type in Constants.ENV_COLLIDERS.keys():
var initial_detect_pt = Constants.ENV_COLLIDERS[unit_type][0]
var upper : float = initial_detect_pt[0].y
var lower : float = initial_detect_pt[0].y
var left : float = initial_detect_pt[0].x
var right: float = initial_detect_pt[0].x
for detect_pt in Constants.ENV_COLLIDERS[unit_type]:
if (detect_pt[1].find(Constants.Direction.UP) != -1
and detect_pt[0].y > upper):
upper = detect_pt[0].y
if (detect_pt[1].find(Constants.Direction.DOWN) != -1
and detect_pt[0].y < lower):
lower = detect_pt[0].y
if (detect_pt[1].find(Constants.Direction.LEFT) != -1
and detect_pt[0].x < left):
left = detect_pt[0].x
if (detect_pt[1].find(Constants.Direction.RIGHT) != -1
and detect_pt[0].x > right):
right = detect_pt[0].x
unit_collision_bounds[unit_type] = [upper, lower, left, right]
func init_stage_grid(tilemap : TileMap):
for map_elem in tilemap.get_used_cells():
var stage_x = floor(tilemap.map_to_world(map_elem).x / Constants.GRID_SIZE)
var stage_y = floor(-1 * tilemap.map_to_world(map_elem).y / Constants.GRID_SIZE) - 1
var map_elem_type : int
var cellv = tilemap.get_cellv(map_elem)
var found_map_elem_type : bool = false
for test_map_elem_type in [
Constants.MapElemType.SQUARE,
Constants.MapElemType.SLOPE_LEFT,
Constants.MapElemType.SLOPE_RIGHT,
Constants.MapElemType.SMALL_SLOPE_LEFT_1,
Constants.MapElemType.SMALL_SLOPE_LEFT_2,
Constants.MapElemType.SMALL_SLOPE_RIGHT_1,
Constants.MapElemType.SMALL_SLOPE_RIGHT_2,
Constants.MapElemType.LEDGE]:
for test_cell_v in Constants.TILE_SET_MAP_ELEMS[scene.tile_set_name][test_map_elem_type]:
if test_cell_v == cellv:
map_elem_type = test_map_elem_type
found_map_elem_type = true
break
if found_map_elem_type:
break
match map_elem_type:
Constants.MapElemType.SQUARE:
insert_grid_collider(stage_x, stage_y, Constants.Direction.UP, 1)
insert_grid_collider(stage_x, stage_y, Constants.Direction.DOWN, 1)
insert_grid_collider(stage_x, stage_y, Constants.Direction.LEFT, 1)
insert_grid_collider(stage_x, stage_y, Constants.Direction.RIGHT, 1)
Constants.MapElemType.SLOPE_LEFT:
try_insert_collider(
Vector2(stage_x, stage_y),
Vector2(stage_x + 1, stage_y + 1),
[Constants.Direction.RIGHT, Constants.Direction.DOWN]
)
insert_grid_collider(stage_x, stage_y, Constants.Direction.LEFT, 1)
insert_grid_collider(stage_x, stage_y, Constants.Direction.UP, 1)
Constants.MapElemType.SLOPE_RIGHT:
try_insert_collider(
Vector2(stage_x, stage_y + 1),
Vector2(stage_x + 1, stage_y),
[Constants.Direction.LEFT, Constants.Direction.DOWN]
)
insert_grid_collider(stage_x, stage_y, Constants.Direction.RIGHT, 1)
insert_grid_collider(stage_x, stage_y, Constants.Direction.UP, 1)
Constants.MapElemType.SMALL_SLOPE_LEFT_1:
try_insert_collider(
Vector2(stage_x, stage_y),
Vector2(stage_x + 1, stage_y + .5),
[Constants.Direction.RIGHT, Constants.Direction.DOWN]
)
insert_grid_collider(stage_x, stage_y, Constants.Direction.LEFT, .5)
insert_grid_collider(stage_x, stage_y, Constants.Direction.UP, 1)
Constants.MapElemType.SMALL_SLOPE_LEFT_2:
try_insert_collider(
Vector2(stage_x, stage_y + .5),
Vector2(stage_x + 1, stage_y + 1),
[Constants.Direction.RIGHT, Constants.Direction.DOWN]
)
insert_grid_collider(stage_x, stage_y, Constants.Direction.RIGHT, .5)
insert_grid_collider(stage_x, stage_y, Constants.Direction.LEFT, 1)
insert_grid_collider(stage_x, stage_y, Constants.Direction.UP, 1)
Constants.MapElemType.SMALL_SLOPE_RIGHT_1:
try_insert_collider(
Vector2(stage_x, stage_y + .5),
Vector2(stage_x + 1, stage_y),
[Constants.Direction.LEFT, Constants.Direction.DOWN]
)
insert_grid_collider(stage_x, stage_y, Constants.Direction.RIGHT, .5)
insert_grid_collider(stage_x, stage_y, Constants.Direction.UP, 1)
Constants.MapElemType.SMALL_SLOPE_RIGHT_2:
try_insert_collider(
Vector2(stage_x, stage_y + 1),
Vector2(stage_x + 1, stage_y + .5),
[Constants.Direction.LEFT, Constants.Direction.DOWN]
)
insert_grid_collider(stage_x, stage_y, Constants.Direction.RIGHT, 1)
insert_grid_collider(stage_x, stage_y, Constants.Direction.LEFT, .5)
insert_grid_collider(stage_x, stage_y, Constants.Direction.UP, 1)
Constants.MapElemType.LEDGE:
insert_grid_collider(stage_x, stage_y, Constants.Direction.DOWN, 1)
func insert_grid_collider(stage_x, stage_y, direction : int, fractional_height : float):
var check_colliders = []
var insert_colliders = []
var point_a : Vector2
var point_b : Vector2
match direction:
Constants.Direction.UP:
point_a = Vector2(stage_x, stage_y)
point_b = Vector2(stage_x + 1, stage_y)
Constants.Direction.DOWN:
point_a = Vector2(stage_x, stage_y + 1)
point_b = Vector2(stage_x + 1, stage_y + 1)
Constants.Direction.LEFT:
point_a = Vector2(stage_x + 1, stage_y + (1 * fractional_height))
point_b = Vector2(stage_x + 1, stage_y)
Constants.Direction.RIGHT:
point_a = Vector2(stage_x, stage_y + (1 * fractional_height))
point_b = Vector2(stage_x, stage_y)
try_insert_collider(point_a, point_b, [direction])
func try_insert_collider(point_a : Vector2, point_b : Vector2, directions : Array):
if directions.size() == 1:
# aligned with grid
for i in range(len(colliders)):
if (colliders[i][0] == point_a
and colliders[i][1] == point_b
and are_inverse_directions(collision_into_direction_arrays[i][0], directions[0])):
colliders.remove(i)
collision_into_direction_arrays.remove(i)
return
colliders.append([point_a, point_b])
collision_into_direction_arrays.append(directions)
func are_inverse_directions(d1, d2):
return ((d1 == Constants.Direction.LEFT and d2 == Constants.Direction.RIGHT)
or (d1 == Constants.Direction.RIGHT and d2 == Constants.Direction.LEFT)
or (d1 == Constants.Direction.UP and d2 == Constants.Direction.DOWN)
or (d1 == Constants.Direction.DOWN and d2 == Constants.Direction.UP))
func interact(unit : Unit, delta):
if unit.unit_conditions[Constants.UnitCondition.IS_ON_GROUND]:
if unit.v_speed < 0:
# reassign the move speeds so that it reflects the true movement
reangle_grounded_move(unit)
else:
# apply gravity
unit.v_speed = max(unit.v_speed - (Constants.GRAVITY * delta), Constants.MAX_FALL_SPEED)
if not unit.h_speed == 0 or not unit.v_speed == 0:
# regular collision
for i in range(colliders.size()):
if check_collision(unit, colliders[i], collision_into_direction_arrays[i], delta):
break
# Do this a second time in case the unit's new move displacement needs
# fixing
for i in range(colliders.size()):
if check_collision(unit, colliders[i], collision_into_direction_arrays[i], delta):
break
func reangle_grounded_move(unit : Unit):
var has_ground_collision : bool = false
for i in range(colliders.size()):
var collider = colliders[i]
var collision_into_directions = collision_into_direction_arrays[i]
if collider[0].x == collider[1].x:
continue
if collision_early_exit(unit, collider, collision_into_directions):
continue
if collision_into_directions.find(Constants.Direction.DOWN) == -1:
continue
# returns [collision?, x, y]
var intersects_results = GameUtils.path_intersects_border(
Vector2(unit.pos.x, unit.pos.y),
Vector2(unit.pos.x, unit.pos.y - .5),
collider[0],
collider[1])
if intersects_results[0]:
has_ground_collision = true
unit.pos.y = intersects_results[1].y + Constants.QUANTUM_DIST
unit.last_contacted_ground_collider = collider
reangle_move(unit, collider, true)
if !has_ground_collision:
reangle_move(unit, unit.last_contacted_ground_collider, true)
unit.set_unit_condition(Constants.UnitCondition.IS_ON_GROUND, false)
# nullify_h_speed should be true if we are reangling a ground movement vector
func reangle_move(unit : Unit, collider, nullify_h_speed : bool):
var angle_helper
if unit.h_speed > 0:
angle_helper = collider
else:
angle_helper = [collider[1], collider[0]]
if nullify_h_speed:
unit.h_speed = 0
GameUtils.reangle_move(unit, angle_helper)
func check_collision(unit : Unit, collider, collision_into_directions, delta):
if collision_early_exit(unit, collider, collision_into_directions):
return false
var is_ground_collision : bool = collision_into_directions.find(Constants.Direction.DOWN) != -1
for unit_env_collider in Constants.ENV_COLLIDERS[unit.unit_type]:
if unit_env_collider_early_exit(unit_env_collider[1], collision_into_directions):
continue
var collision_check_location : Vector2 = unit.pos + unit_env_collider[0]
var collision_check_try_location : Vector2 = collision_check_location + Vector2(unit.h_speed * delta, unit.v_speed * delta)
# returns [collision?, (x, y)]
var intersects_results = GameUtils.path_intersects_border(
collision_check_location,
collision_check_try_location,
collider[0],
collider[1])
if intersects_results[0]:
if is_ground_collision:
if unit_env_collider[0] == Vector2(0, 0):
unit.pos.y = intersects_results[1].y + Constants.QUANTUM_DIST
unit.pos.x = intersects_results[1].x
if unit.unit_conditions[Constants.UnitCondition.IS_ON_GROUND]:
# preserve magnitude
reangle_move(unit, collider, false)
else:
if unit.get_current_action() != Constants.UnitCurrentAction.JUMPING:
unit.set_unit_condition(Constants.UnitCondition.IS_ON_GROUND, true)
# landed on ground, horizontal component to become magnitude
unit.v_speed = 0
reangle_move(unit, collider, false)
else:
if collider[0].x == collider[1].x:
# vertical wall collision
var new_cc_x : float
if unit.h_speed < 0:
new_cc_x = intersects_results[1].x + Constants.QUANTUM_DIST
else:
new_cc_x = intersects_results[1].x - Constants.QUANTUM_DIST
var target_h_speed : float = (new_cc_x - collision_check_location.x) / delta
var factor : float = target_h_speed / unit.h_speed
unit.h_speed *= factor
if unit.get_condition(Constants.UnitCondition.IS_ON_GROUND, false):
# also shorten vertical component to preserve move vector direction
unit.v_speed *= factor
else:
# ceiling collision (horizontal only for now)
var new_cc_y : float = intersects_results[1].y - Constants.QUANTUM_DIST
unit.v_speed = (new_cc_y - collision_check_location.y) / delta
if unit.get_current_action() == Constants.UnitCurrentAction.JUMPING:
unit.set_current_action(Constants.UnitCurrentAction.IDLE)
if !is_ground_collision or unit_env_collider[0] == Vector2(0, 0):
# return true if there's a collision
# don't return true if it's a ground collision but the unit environment collider is not the (0, 0) collider
return true
return false
func collision_early_exit(unit : Unit, collider, collision_into_directions):
if (collider[0].y > unit.pos.y + unit_collision_bounds[unit.unit_type][0] + 1
and collider[1].y > unit.pos.y + unit_collision_bounds[unit.unit_type][0] + 1):
return true
if (collider[0].y < unit.pos.y + unit_collision_bounds[unit.unit_type][1] - 1
and collider[1].y < unit.pos.y + unit_collision_bounds[unit.unit_type][1] - 1):
return true
if collider[1].x < unit.pos.x + unit_collision_bounds[unit.unit_type][2] - 1:
return true
if collider[0].x > unit.pos.x + unit_collision_bounds[unit.unit_type][3] + 1:
return true
for collision_into_direction in collision_into_directions:
if collision_into_direction == Constants.Direction.UP and unit.v_speed > 0:
return false
if collision_into_direction == Constants.Direction.DOWN and unit.v_speed < 0:
return false
if collision_into_direction == Constants.Direction.LEFT and unit.h_speed < 0:
return false
if collision_into_direction == Constants.Direction.RIGHT and unit.h_speed > 0:
return false
return true
func unit_env_collider_early_exit(env_collider_directions, collision_into_directions):
var found_matching_direction : bool = false
for env_collider_direction in env_collider_directions:
for collision_into_direction in collision_into_directions:
if env_collider_direction == collision_into_direction:
return false
return true

282
Scripts/Unit.gd Normal file
View File

@ -0,0 +1,282 @@
extends Area2D
# base class for units
# we assume every unit can move and jump so we see their handlers here
# sprite management is handled here (and subclasses) as well
class_name Unit
const Constants = preload("res://Scripts/Constants.gd")
const GameUtils = preload("res://Scripts/GameUtils.gd")
var scene
# position
export var unit_type : int
var actions = {}
var unit_conditions = {}
var facing : int = Constants.Direction.RIGHT
var current_action_time_elapsed : float = 0
var unit_condition_timers = {}
var pos : Vector2
var h_speed : float = 0
var v_speed : float = 0
var target_move_speed : float
var last_contacted_ground_collider : Array
var current_sprite : Node2D
var sprite_class_nodes = {} # sprite class to node list dictionary
var hit_queued : bool = false
var hit_dir : int
var time_elapsed : float
var is_flash : bool = false
var flash_start_timestamp : float
# Called when the node enters the scene tree for the first time
func _ready():
for action_num in Constants.UNIT_TYPE_ACTIONS[unit_type]:
actions[action_num] = false
for condition_num in Constants.UNIT_TYPE_CONDITIONS[unit_type].keys():
set_unit_condition(condition_num, Constants.UNIT_TYPE_CONDITIONS[unit_type][condition_num])
for condition_num in Constants.UNIT_CONDITION_TIMERS[unit_type].keys():
unit_condition_timers[condition_num] = 0
target_move_speed = Constants.UNIT_TYPE_MOVE_SPEEDS[unit_type]
# populate sprite_class_nodes
for sprite_class in Constants.UNIT_SPRITES[unit_type]:
sprite_class_nodes[sprite_class] = []
for node_name in Constants.UNIT_SPRITES[unit_type][sprite_class][1]:
sprite_class_nodes[sprite_class].append(get_node(node_name))
pos = Vector2(position.x / Constants.GRID_SIZE, -1 * position.y / Constants.GRID_SIZE)
position.x = position.x * Constants.SCALE_FACTOR
position.y = position.y * Constants.SCALE_FACTOR
scale.x = Constants.SCALE_FACTOR
scale.y = Constants.SCALE_FACTOR
func init_unit_w_scene(scene):
self.scene = scene
func set_action(action : int):
assert(action in Constants.UNIT_TYPE_ACTIONS[unit_type])
actions[action] = true
func set_unit_condition(condition_type : int, condition):
assert(condition_type in Constants.UNIT_TYPE_CONDITIONS[unit_type].keys())
unit_conditions[condition_type] = condition
func set_unit_condition_with_timer(condition_type : int):
assert(condition_type in Constants.UNIT_CONDITION_TIMERS[unit_type].keys())
set_unit_condition(condition_type, Constants.UNIT_CONDITION_TIMERS[unit_type][condition_type][1])
unit_condition_timers[condition_type] = Constants.UNIT_CONDITION_TIMERS[unit_type][condition_type][0]
func get_condition(condition_num : int, default):
if condition_num in Constants.UNIT_TYPE_CONDITIONS[unit_type].keys():
return unit_conditions[condition_num]
else:
return default
func is_current_action_timer_done(current_action : int):
assert(current_action in Constants.CURRENT_ACTION_TIMERS[unit_type].keys())
return current_action_time_elapsed >= Constants.CURRENT_ACTION_TIMERS[unit_type][current_action]
func reset_actions():
for action_num in Constants.UNIT_TYPE_ACTIONS[unit_type]:
actions[action_num] = false
func process_unit(delta, time_elapsed : float):
current_action_time_elapsed += delta
execute_actions(delta)
handle_idle()
advance_timers(delta)
handle_moving_status(delta)
handle_recoil() # must be after handle_moving_status
reset_current_action()
self.time_elapsed = time_elapsed
func advance_timers(delta):
for condition_num in Constants.UNIT_CONDITION_TIMERS[unit_type].keys():
unit_condition_timers[condition_num] = move_toward(unit_condition_timers[condition_num], 0, delta)
if unit_condition_timers[condition_num] == 0:
set_unit_condition(condition_num, Constants.UNIT_CONDITION_TIMERS[unit_type][condition_num][2])
if condition_num == Constants.UnitCondition.IS_INVINCIBLE:
invincibility_ended()
func reset_current_action():
# process CURRENT_ACTION
if get_current_action() == Constants.UnitCurrentAction.JUMPING:
if not actions[Constants.ActionType.JUMP]:
set_current_action(Constants.UnitCurrentAction.IDLE)
# process MOVING_STATUS
if not actions[Constants.ActionType.MOVE]:
set_unit_condition(Constants.UnitCondition.MOVING_STATUS, Constants.UnitMovingStatus.IDLE)
func handle_input(delta):
# implemented in subclass
pass
func get_current_action():
return unit_conditions[Constants.UnitCondition.CURRENT_ACTION]
func set_current_action(current_action : int):
assert(current_action in Constants.UNIT_TYPE_CURRENT_ACTIONS[unit_type])
if get_current_action() != current_action:
current_action_time_elapsed = 0
set_unit_condition(Constants.UnitCondition.CURRENT_ACTION, current_action)
func execute_actions(delta):
for action_num in Constants.UNIT_TYPE_ACTIONS[unit_type]:
if !actions[action_num]:
continue
match action_num:
Constants.ActionType.JUMP:
jump()
Constants.ActionType.MOVE:
move()
func jump():
set_current_action(Constants.UnitCurrentAction.JUMPING)
if (unit_conditions[Constants.UnitCondition.IS_ON_GROUND]):
# hit ground
v_speed = max(Constants.UNIT_TYPE_JUMP_SPEEDS[unit_type], v_speed)
else:
# airborne
v_speed = max(Constants.UNIT_TYPE_JUMP_SPEEDS[unit_type], move_toward(v_speed, Constants.UNIT_TYPE_JUMP_SPEEDS[unit_type], get_process_delta_time() * Constants.GRAVITY))
set_unit_condition(Constants.UnitCondition.IS_ON_GROUND, false)
if get_current_action() == Constants.UnitCurrentAction.JUMPING and v_speed > 0:
set_sprite(Constants.SpriteClass.JUMP, 0)
if is_current_action_timer_done(Constants.UnitCurrentAction.JUMPING):
set_current_action(Constants.UnitCurrentAction.IDLE)
func move():
set_unit_condition(Constants.UnitCondition.MOVING_STATUS, Constants.UnitMovingStatus.MOVING)
if (get_current_action() == Constants.UnitCurrentAction.IDLE
and unit_conditions[Constants.UnitCondition.IS_ON_GROUND]):
set_sprite(Constants.SpriteClass.WALK)
func handle_recoil():
# implemented in subclass
pass
func handle_moving_status(delta):
# what we have: facing, current speed, move status, grounded
# we want: to set the new intended speed
var magnitude : float
if unit_conditions[Constants.UnitCondition.IS_ON_GROUND]:
magnitude = sqrt(pow(v_speed, 2) + pow(h_speed, 2))
else:
magnitude = abs(h_speed)
# if move status is idle
if unit_conditions[Constants.UnitCondition.MOVING_STATUS] == Constants.UnitMovingStatus.IDLE:
# slow down
magnitude = move_toward(magnitude, 0, Constants.ACCELERATION * delta)
# if move status is not idle
else:
# if is facing-aligned
if (h_speed <= 0 and facing == Constants.Direction.LEFT) or (h_speed >= 0 and facing == Constants.Direction.RIGHT):
# speed up
magnitude = move_toward(magnitude, target_move_speed, Constants.ACCELERATION * delta)
# if is not facing-aligned
else:
# slow down
magnitude = move_toward(magnitude, 0, Constants.ACCELERATION * delta)
# if is grounded
if unit_conditions[Constants.UnitCondition.IS_ON_GROUND]:
# make magnitude greater than quantum distance
if magnitude > 0 and magnitude < Constants.QUANTUM_DIST:
magnitude = Constants.QUANTUM_DIST * 2
# make move vector point down
if magnitude > 0:
if h_speed > 0:
h_speed = Constants.QUANTUM_DIST # preserve h direction
elif h_speed < 0:
h_speed = -1 * Constants.QUANTUM_DIST
else:
# from still to moving
if facing == Constants.Direction.RIGHT:
h_speed = Constants.QUANTUM_DIST
else:
h_speed = -1 * Constants.QUANTUM_DIST
else:
h_speed = 0
v_speed = -1 * magnitude
# if is not grounded
else:
# set h_speed
if magnitude > 0:
if h_speed > 0:
h_speed = magnitude
elif h_speed < 0:
h_speed = -1 * magnitude
else:
# from no lateral movement to having lateral movement
if facing == Constants.Direction.RIGHT:
h_speed = magnitude
else:
h_speed = -1 * magnitude
else:
h_speed = 0
func handle_idle():
if get_current_action() == Constants.UnitCurrentAction.IDLE:
if unit_conditions[Constants.UnitCondition.IS_ON_GROUND]:
if unit_conditions[Constants.UnitCondition.MOVING_STATUS] == Constants.UnitMovingStatus.IDLE:
set_sprite(Constants.SpriteClass.IDLE)
elif v_speed > 0:
set_sprite(Constants.SpriteClass.JUMP, 0)
else:
set_sprite(Constants.SpriteClass.JUMP, 1)
func set_sprite(sprite_class : int, index : int = 0):
assert(unit_type in Constants.UNIT_SPRITES)
assert(sprite_class in Constants.UNIT_SPRITES[unit_type])
var node_list = sprite_class_nodes[sprite_class]
var true_index : int = index
if true_index > len(node_list) - 1:
true_index = 0
var new_sprite : Node2D = node_list[true_index]
if (is_flash):
if int((time_elapsed - flash_start_timestamp) / Constants.FLASH_CYCLE) % 2 == 1:
new_sprite.set_modulate(Color(2, 1, 1))
else:
new_sprite.set_modulate(Color(1, .5, .5))
else:
new_sprite.set_modulate(Color(1, 1, 1))
if current_sprite == null or current_sprite != new_sprite:
if current_sprite != null:
current_sprite.visible = false
current_sprite = new_sprite
current_sprite.visible = true
if (Constants.UNIT_SPRITES[unit_type][sprite_class][0]):
current_sprite.set_frame(0)
current_sprite.play()
if facing == Constants.Direction.LEFT:
current_sprite.scale.x = -1
else:
current_sprite.scale.x = 1
func react(delta):
pos.x = pos.x + h_speed * delta
pos.y = pos.y + v_speed * delta
position.x = pos.x * Constants.GRID_SIZE * Constants.SCALE_FACTOR
position.y = -1 * pos.y * Constants.GRID_SIZE * Constants.SCALE_FACTOR
func hit(dir : int):
# implemented in subclass
hit_queued = true
hit_dir = dir
func start_flash():
is_flash = true
flash_start_timestamp = time_elapsed
func invincibility_ended():
# implemented in subclass
pass

View File

@ -0,0 +1,8 @@
extends NPCUnit
func before_tick():
if scene.rng.randf() < 0.5:
facing = Constants.Direction.RIGHT
else:
facing = Constants.Direction.LEFT

79
Scripts/Units/NPCUnit.gd Normal file
View File

@ -0,0 +1,79 @@
extends Unit
class_name NPCUnit
var spawn_point : Vector2
export var tick_duration : float
var tick_timer : float = 0
export(Dictionary) var action_sequence_map # action sequence to weight, [] = do nothing
# action sequence is an array of action type and an array of timestamps
# action type is the string representation of Constants.ActionType
# example action map: {[[action1], [0]]: 1, [[action2, action3], [0, 1]]: 2}
var weight_sum : float
export var action_duration_map = {} # specific durations for given action
var current_npc_action_times_elapsed = {}
var current_npc_action_active = {}
var current_action_sequence = null
var current_action_sequence_time_elapsed : float = 0
var current_action_sequence_index : int = 0
func _ready():
for action_sequence in action_sequence_map.keys():
weight_sum += action_sequence_map[action_sequence]
for action in action_duration_map:
current_npc_action_times_elapsed[action] = 0
current_npc_action_active[action] = false
func before_tick():
pass
func handle_input(delta):
if current_action_sequence != null:
for action in current_npc_action_active:
if current_npc_action_active[action]:
if current_npc_action_times_elapsed[action] < action_duration_map[action]:
set_action(Constants.ActionType.get(action))
current_npc_action_times_elapsed[action] += delta
else:
current_npc_action_active[action] = false
if (current_action_sequence_index < current_action_sequence[1].size()
and current_action_sequence_time_elapsed >= current_action_sequence[1][current_action_sequence_index]):
var action = current_action_sequence[0][current_action_sequence_index]
set_action(Constants.ActionType.get(action))
if action_duration_map.has(action):
current_npc_action_active[action] = true
current_npc_action_times_elapsed[action] = 0
current_action_sequence_index += 1
var current_action_sequence_duration : float = current_action_sequence[1][-1]
if action_duration_map.has(current_action_sequence[0][-1]):
current_action_sequence_duration += action_duration_map[current_action_sequence[0][-1]]
if current_action_sequence_time_elapsed > current_action_sequence_duration:
reset_npc_unit()
current_action_sequence_time_elapsed += delta
else:
if tick_timer == 0:
before_tick()
var rand_num : float = scene.rng.randf() * weight_sum
var temp_sum : float = 0
for action_sequence in action_sequence_map.keys():
temp_sum += action_sequence_map[action_sequence]
if temp_sum >= rand_num:
if action_sequence == []:
tick_timer = tick_duration
else:
current_action_sequence = action_sequence
current_action_sequence_time_elapsed = 0
current_action_sequence_index = 0
break
else:
tick_timer = max(0, tick_timer - delta)
func reset_npc_unit():
current_action_sequence = null
tick_timer = tick_duration
for action in current_npc_action_active:
current_npc_action_active[action] = false

92
Scripts/Units/Player.gd Normal file
View File

@ -0,0 +1,92 @@
extends Unit
# Player-specific code
class_name Player
const RECOIL_PUSHBACK = 15
func _init():
pos = Vector2(position.x / Constants.GRID_SIZE, -1 * position.y / Constants.GRID_SIZE)
position.x = position.x * Constants.SCALE_FACTOR
position.y = position.y * Constants.SCALE_FACTOR
func execute_actions(delta):
.execute_actions(delta)
for action_num in Constants.UNIT_TYPE_ACTIONS[Constants.UnitType.PLAYER]:
if !actions[action_num]:
continue
match action_num:
# handle custom actions
Constants.ActionType.RECOIL:
recoil()
_:
pass
func recoil():
if is_current_action_timer_done(Constants.UnitCurrentAction.RECOILING):
set_current_action(Constants.UnitCurrentAction.IDLE)
else:
set_current_action(Constants.UnitCurrentAction.RECOILING)
set_sprite(Constants.SpriteClass.RECOIL)
func handle_input(delta):
scene.handle_player_input()
func _on_Player_area_entered(area: Area2D) -> void:
if get_condition(Constants.UnitCondition.IS_INVINCIBLE, false):
return
if area is Unit:
hit_from_area(area)
func hit_from_area(other_area : Area2D):
var collision_dir : int
if other_area.position > position:
collision_dir = Constants.Direction.RIGHT
else:
collision_dir = Constants.Direction.LEFT
hit(collision_dir)
func hit(dir : int):
.hit(dir)
set_unit_condition_with_timer(Constants.UnitCondition.IS_INVINCIBLE)
start_flash()
set_action(Constants.ActionType.RECOIL)
set_current_action(Constants.UnitCurrentAction.RECOILING)
set_unit_condition(Constants.UnitCondition.MOVING_STATUS, Constants.UnitMovingStatus.IDLE)
func invincibility_ended():
is_flash = false
if get_overlapping_areas().size() > 0:
if get_overlapping_areas()[0] is Unit:
hit_from_area(get_overlapping_areas()[0])
func handle_recoil():
if not hit_queued:
return
hit_queued = false
if get_condition(Constants.UnitCondition.IS_ON_GROUND, true):
if h_speed > 0:
if hit_dir == Constants.Direction.LEFT:
v_speed -= RECOIL_PUSHBACK
else:
v_speed += RECOIL_PUSHBACK
elif h_speed < 0:
if hit_dir == Constants.Direction.LEFT:
v_speed += RECOIL_PUSHBACK
else:
v_speed -= RECOIL_PUSHBACK
else:
v_speed = -RECOIL_PUSHBACK
if hit_dir == Constants.Direction.LEFT:
h_speed = Constants.QUANTUM_DIST
else:
h_speed = -Constants.QUANTUM_DIST
if v_speed > 0:
h_speed *= -1
v_speed = -v_speed
else:
if hit_dir == Constants.Direction.LEFT:
h_speed += RECOIL_PUSHBACK
else:
h_speed -= RECOIL_PUSHBACK
facing = hit_dir

335
Tile Sets/TestTileSet.tres Normal file
View File

@ -0,0 +1,335 @@
[gd_resource type="TileSet" load_steps=10 format=2]
[ext_resource path="res://Graphics/Tiles/PalaceTileSet.png" type="Texture" id=1]
[ext_resource path="res://Graphics/Tiles/slope/SlopeLeft2Borderless.png" type="Texture" id=2]
[ext_resource path="res://Graphics/Tiles/slope/SlopeLeftBorder.png" type="Texture" id=3]
[ext_resource path="res://Graphics/Tiles/slope/SlopeRightBorder.png" type="Texture" id=4]
[ext_resource path="res://Graphics/Tiles/slope/SlopeRightBorderless.png" type="Texture" id=5]
[ext_resource path="res://Graphics/Tiles/ledge/LedgeLeft.png" type="Texture" id=6]
[ext_resource path="res://Graphics/Tiles/ledge/LedgeMiddle.png" type="Texture" id=7]
[ext_resource path="res://Graphics/Tiles/ledge/LedgeRight.png" type="Texture" id=8]
[ext_resource path="res://Graphics/Tiles/ledge/LedgeSingle.png" type="Texture" id=9]
[resource]
0/name = "PalaceTileSet.png 0"
0/texture = ExtResource( 1 )
0/tex_offset = Vector2( 0, 0 )
0/modulate = Color( 1, 1, 1, 1 )
0/region = Rect2( 276, 20, 20, 20 )
0/tile_mode = 0
0/occluder_offset = Vector2( 0, 0 )
0/navigation_offset = Vector2( 0, 0 )
0/shape_offset = Vector2( 0, 0 )
0/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
0/shape_one_way = false
0/shape_one_way_margin = 0.0
0/shapes = [ ]
0/z_index = 0
1/name = "PalaceTileSet.png 1"
1/texture = ExtResource( 1 )
1/tex_offset = Vector2( 0, 0 )
1/modulate = Color( 1, 1, 1, 1 )
1/region = Rect2( 296, 20, 20, 20 )
1/tile_mode = 0
1/occluder_offset = Vector2( 0, 0 )
1/navigation_offset = Vector2( 0, 0 )
1/shape_offset = Vector2( 0, 0 )
1/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
1/shape_one_way = false
1/shape_one_way_margin = 0.0
1/shapes = [ ]
1/z_index = 0
2/name = "PalaceTileSet.png 2"
2/texture = ExtResource( 1 )
2/tex_offset = Vector2( 0, 0 )
2/modulate = Color( 1, 1, 1, 1 )
2/region = Rect2( 316, 20, 20, 20 )
2/tile_mode = 0
2/occluder_offset = Vector2( 0, 0 )
2/navigation_offset = Vector2( 0, 0 )
2/shape_offset = Vector2( 0, 0 )
2/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
2/shape_one_way = false
2/shape_one_way_margin = 0.0
2/shapes = [ ]
2/z_index = 0
3/name = "PalaceTileSet.png 3"
3/texture = ExtResource( 1 )
3/tex_offset = Vector2( 0, 0 )
3/modulate = Color( 1, 1, 1, 1 )
3/region = Rect2( 276, 40, 20, 20 )
3/tile_mode = 0
3/occluder_offset = Vector2( 0, 0 )
3/navigation_offset = Vector2( 0, 0 )
3/shape_offset = Vector2( 0, 0 )
3/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
3/shape_one_way = false
3/shape_one_way_margin = 0.0
3/shapes = [ ]
3/z_index = 0
4/name = "PalaceTileSet.png 4"
4/texture = ExtResource( 1 )
4/tex_offset = Vector2( 0, 0 )
4/modulate = Color( 1, 1, 1, 1 )
4/region = Rect2( 296, 40, 20, 20 )
4/tile_mode = 0
4/occluder_offset = Vector2( 0, 0 )
4/navigation_offset = Vector2( 0, 0 )
4/shape_offset = Vector2( 0, 0 )
4/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
4/shape_one_way = false
4/shape_one_way_margin = 0.0
4/shapes = [ ]
4/z_index = 0
5/name = "PalaceTileSet.png 5"
5/texture = ExtResource( 1 )
5/tex_offset = Vector2( 0, 0 )
5/modulate = Color( 1, 1, 1, 1 )
5/region = Rect2( 316, 40, 20, 20 )
5/tile_mode = 0
5/occluder_offset = Vector2( 0, 0 )
5/navigation_offset = Vector2( 0, 0 )
5/shape_offset = Vector2( 0, 0 )
5/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
5/shape_one_way = false
5/shape_one_way_margin = 0.0
5/shapes = [ ]
5/z_index = 0
6/name = "PalaceTileSet.png 6"
6/texture = ExtResource( 1 )
6/tex_offset = Vector2( 0, 0 )
6/modulate = Color( 1, 1, 1, 1 )
6/region = Rect2( 276, 60, 20, 20 )
6/tile_mode = 0
6/occluder_offset = Vector2( 0, 0 )
6/navigation_offset = Vector2( 0, 0 )
6/shape_offset = Vector2( 0, 0 )
6/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
6/shape_one_way = false
6/shape_one_way_margin = 0.0
6/shapes = [ ]
6/z_index = 0
7/name = "PalaceTileSet.png 7"
7/texture = ExtResource( 1 )
7/tex_offset = Vector2( 0, 0 )
7/modulate = Color( 1, 1, 1, 1 )
7/region = Rect2( 296, 60, 20, 20 )
7/tile_mode = 0
7/occluder_offset = Vector2( 0, 0 )
7/navigation_offset = Vector2( 0, 0 )
7/shape_offset = Vector2( 0, 0 )
7/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
7/shape_one_way = false
7/shape_one_way_margin = 0.0
7/shapes = [ ]
7/z_index = 0
8/name = "PalaceTileSet.png 8"
8/texture = ExtResource( 1 )
8/tex_offset = Vector2( 0, 0 )
8/modulate = Color( 1, 1, 1, 1 )
8/region = Rect2( 316, 60, 20, 20 )
8/tile_mode = 0
8/occluder_offset = Vector2( 0, 0 )
8/navigation_offset = Vector2( 0, 0 )
8/shape_offset = Vector2( 0, 0 )
8/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
8/shape_one_way = false
8/shape_one_way_margin = 0.0
8/shapes = [ ]
8/z_index = 0
9/name = "PalaceTileSet.png 9"
9/texture = ExtResource( 1 )
9/tex_offset = Vector2( 0, 0 )
9/modulate = Color( 1, 1, 1, 1 )
9/region = Rect2( 336, 0, 20, 20 )
9/tile_mode = 0
9/occluder_offset = Vector2( 0, 0 )
9/navigation_offset = Vector2( 0, 0 )
9/shape_offset = Vector2( 0, 0 )
9/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
9/shape_one_way = false
9/shape_one_way_margin = 0.0
9/shapes = [ ]
9/z_index = 0
10/name = "PalaceTileSet.png 10"
10/texture = ExtResource( 1 )
10/tex_offset = Vector2( 0, 0 )
10/modulate = Color( 1, 1, 1, 1 )
10/region = Rect2( 356, 0, 20, 20 )
10/tile_mode = 0
10/occluder_offset = Vector2( 0, 0 )
10/navigation_offset = Vector2( 0, 0 )
10/shape_offset = Vector2( 0, 0 )
10/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
10/shape_one_way = false
10/shape_one_way_margin = 0.0
10/shapes = [ ]
10/z_index = 0
11/name = "PalaceTileSet.png 11"
11/texture = ExtResource( 1 )
11/tex_offset = Vector2( 0, 0 )
11/modulate = Color( 1, 1, 1, 1 )
11/region = Rect2( 356, 40, 20, 20 )
11/tile_mode = 0
11/occluder_offset = Vector2( 0, 0 )
11/navigation_offset = Vector2( 0, 0 )
11/shape_offset = Vector2( 0, 0 )
11/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
11/shape_one_way = false
11/shape_one_way_margin = 0.0
11/shapes = [ ]
11/z_index = 0
12/name = "PalaceTileSet.png 12"
12/texture = ExtResource( 1 )
12/tex_offset = Vector2( 0, 0 )
12/modulate = Color( 1, 1, 1, 1 )
12/region = Rect2( 396, 0, 20, 20 )
12/tile_mode = 0
12/occluder_offset = Vector2( 0, 0 )
12/navigation_offset = Vector2( 0, 0 )
12/shape_offset = Vector2( 0, 0 )
12/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
12/shape_one_way = false
12/shape_one_way_margin = 0.0
12/shapes = [ ]
12/z_index = 0
13/name = "PalaceTileSet.png 13"
13/texture = ExtResource( 1 )
13/tex_offset = Vector2( 0, 0 )
13/modulate = Color( 1, 1, 1, 1 )
13/region = Rect2( 376, 0, 20, 20 )
13/tile_mode = 0
13/occluder_offset = Vector2( 0, 0 )
13/navigation_offset = Vector2( 0, 0 )
13/shape_offset = Vector2( 0, 0 )
13/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
13/shape_one_way = false
13/shape_one_way_margin = 0.0
13/shapes = [ ]
13/z_index = 0
14/name = "PalaceTileSet.png 14"
14/texture = ExtResource( 1 )
14/tex_offset = Vector2( 0, 0 )
14/modulate = Color( 1, 1, 1, 1 )
14/region = Rect2( 376, 40, 20, 20 )
14/tile_mode = 0
14/occluder_offset = Vector2( 0, 0 )
14/navigation_offset = Vector2( 0, 0 )
14/shape_offset = Vector2( 0, 0 )
14/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
14/shape_one_way = false
14/shape_one_way_margin = 0.0
14/shapes = [ ]
14/z_index = 0
15/name = "SlopeLeft2Borderless.png 15"
15/texture = ExtResource( 2 )
15/tex_offset = Vector2( 0, 0 )
15/modulate = Color( 1, 1, 1, 1 )
15/region = Rect2( 0, 0, 20, 20 )
15/tile_mode = 0
15/occluder_offset = Vector2( 0, 0 )
15/navigation_offset = Vector2( 0, 0 )
15/shape_offset = Vector2( 0, 0 )
15/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
15/shape_one_way = false
15/shape_one_way_margin = 0.0
15/shapes = [ ]
15/z_index = 0
16/name = "SlopeLeftBorder.png 16"
16/texture = ExtResource( 3 )
16/tex_offset = Vector2( 0, 0 )
16/modulate = Color( 1, 1, 1, 1 )
16/region = Rect2( 0, 0, 20, 20 )
16/tile_mode = 0
16/occluder_offset = Vector2( 0, 0 )
16/navigation_offset = Vector2( 0, 0 )
16/shape_offset = Vector2( 0, 0 )
16/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
16/shape_one_way = false
16/shape_one_way_margin = 0.0
16/shapes = [ ]
16/z_index = 0
17/name = "SlopeRightBorder.png 17"
17/texture = ExtResource( 4 )
17/tex_offset = Vector2( 0, 0 )
17/modulate = Color( 1, 1, 1, 1 )
17/region = Rect2( 0, 0, 20, 20 )
17/tile_mode = 0
17/occluder_offset = Vector2( 0, 0 )
17/navigation_offset = Vector2( 0, 0 )
17/shape_offset = Vector2( 0, 0 )
17/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
17/shape_one_way = false
17/shape_one_way_margin = 0.0
17/shapes = [ ]
17/z_index = 0
18/name = "SlopeRightBorderless.png 18"
18/texture = ExtResource( 5 )
18/tex_offset = Vector2( 0, 0 )
18/modulate = Color( 1, 1, 1, 1 )
18/region = Rect2( 0, 0, 20, 20 )
18/tile_mode = 0
18/occluder_offset = Vector2( 0, 0 )
18/navigation_offset = Vector2( 0, 0 )
18/shape_offset = Vector2( 0, 0 )
18/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
18/shape_one_way = false
18/shape_one_way_margin = 0.0
18/shapes = [ ]
18/z_index = 0
19/name = "LedgeLeft.png 19"
19/texture = ExtResource( 6 )
19/tex_offset = Vector2( 0, 0 )
19/modulate = Color( 1, 1, 1, 1 )
19/region = Rect2( 0, 0, 20, 20 )
19/tile_mode = 0
19/occluder_offset = Vector2( 0, 0 )
19/navigation_offset = Vector2( 0, 0 )
19/shape_offset = Vector2( 0, 0 )
19/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
19/shape_one_way = false
19/shape_one_way_margin = 0.0
19/shapes = [ ]
19/z_index = 0
20/name = "LedgeMiddle.png 20"
20/texture = ExtResource( 7 )
20/tex_offset = Vector2( 0, 0 )
20/modulate = Color( 1, 1, 1, 1 )
20/region = Rect2( 0, 0, 20, 20 )
20/tile_mode = 0
20/occluder_offset = Vector2( 0, 0 )
20/navigation_offset = Vector2( 0, 0 )
20/shape_offset = Vector2( 0, 0 )
20/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
20/shape_one_way = false
20/shape_one_way_margin = 0.0
20/shapes = [ ]
20/z_index = 0
21/name = "LedgeRight.png 21"
21/texture = ExtResource( 8 )
21/tex_offset = Vector2( 0, 0 )
21/modulate = Color( 1, 1, 1, 1 )
21/region = Rect2( 0, 0, 20, 20 )
21/tile_mode = 0
21/occluder_offset = Vector2( 0, 0 )
21/navigation_offset = Vector2( 0, 0 )
21/shape_offset = Vector2( 0, 0 )
21/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
21/shape_one_way = false
21/shape_one_way_margin = 0.0
21/shapes = [ ]
21/z_index = 0
22/name = "LedgeSingle.png 22"
22/texture = ExtResource( 9 )
22/tex_offset = Vector2( 0, 0 )
22/modulate = Color( 1, 1, 1, 1 )
22/region = Rect2( 0, 0, 20, 20 )
22/tile_mode = 0
22/occluder_offset = Vector2( 0, 0 )
22/navigation_offset = Vector2( 0, 0 )
22/shape_offset = Vector2( 0, 0 )
22/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
22/shape_one_way = false
22/shape_one_way_margin = 0.0
22/shapes = [ ]
22/z_index = 0

46
Units/NPC.tscn Normal file
View File

@ -0,0 +1,46 @@
[gd_scene load_steps=7 format=2]
[ext_resource path="res://Scripts/Units/NPCExample.gd" type="Script" id=1]
[ext_resource path="res://Graphics/Units/NPC.png" type="Texture" id=2]
[ext_resource path="res://Graphics/Animations/NPCWalk.tres" type="SpriteFrames" id=3]
[ext_resource path="res://Graphics/Units/NPCJump2.png" type="Texture" id=4]
[ext_resource path="res://Graphics/Units/NPCJump1.png" type="Texture" id=5]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 6, 14 )
[node name="NPC" type="Area2D"]
collision_mask = 2
script = ExtResource( 1 )
unit_type = 1
tick_duration = 2.0
action_sequence_map = {
[ [ "MOVE" ], [ 0.0 ] ]: 1
}
action_duration_map = {
"MOVE": 1.0
}
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2( 0, -14 )
shape = SubResource( 1 )
[node name="Idle" type="Sprite" parent="."]
visible = false
texture = ExtResource( 2 )
offset = Vector2( 0, -15 )
[node name="Jump1" type="Sprite" parent="."]
visible = false
texture = ExtResource( 5 )
offset = Vector2( 0, -15 )
[node name="Jump2" type="Sprite" parent="."]
visible = false
texture = ExtResource( 4 )
offset = Vector2( 0, -15 )
[node name="Walk" type="AnimatedSprite" parent="."]
visible = false
frames = ExtResource( 3 )
offset = Vector2( 0, -15 )

47
Units/Player.tscn Normal file
View File

@ -0,0 +1,47 @@
[gd_scene load_steps=8 format=2]
[ext_resource path="res://Scripts/Units/Player.gd" type="Script" id=1]
[ext_resource path="res://Graphics/Units/Player.png" type="Texture" id=2]
[ext_resource path="res://Graphics/Units/PlayerJump2.png" type="Texture" id=3]
[ext_resource path="res://Graphics/Units/PlayerJump1.png" type="Texture" id=4]
[ext_resource path="res://Graphics/Animations/PlayerWalk.tres" type="SpriteFrames" id=5]
[ext_resource path="res://Graphics/Units/PlayerRecoil.png" type="Texture" id=6]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 6, 14 )
[node name="Player" type="Area2D"]
z_index = 1
collision_layer = 0
script = ExtResource( 1 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2( 0, -14 )
shape = SubResource( 1 )
[node name="Idle" type="Sprite" parent="."]
visible = false
texture = ExtResource( 2 )
offset = Vector2( 0, -15 )
[node name="Walk" type="AnimatedSprite" parent="."]
visible = false
frames = ExtResource( 5 )
offset = Vector2( 0, -15 )
[node name="Jump1" type="Sprite" parent="."]
visible = false
texture = ExtResource( 4 )
offset = Vector2( 0, -15 )
[node name="Jump2" type="Sprite" parent="."]
visible = false
texture = ExtResource( 3 )
offset = Vector2( 0, -15 )
[node name="Recoil" type="Sprite" parent="."]
visible = false
texture = ExtResource( 6 )
offset = Vector2( 0, -15 )
[connection signal="area_entered" from="." to="." method="_on_Player_area_entered"]

205
VERSION.md Normal file
View File

@ -0,0 +1,205 @@
**version 0.1.5**
*added*
+ Light code clean
+ Some Bugfix
+ Plugin output for debug of some of the operations
+ Automatic Filling of sign in fields
+ Multiple files commit and changes commit
+ Every text and image file format supported
+ Filtering in committing
+ Autoload branches content
*removed*
+ Single file commit
+ Only text file commit
----------------------
**version 0.2.5**
*added*
+ Code clean
+ Chose branch to commit
+ Delete resource selected in repository
+ Filters: Exceptions, Only, Start from
----------------------
**version 0.2.7**
*added*
+ Code clean
+ Fix some little animations
+ New commit method: tree created from blobs, creates a single commit with more files
*removed*
+ Old commit method
----------------------
**version 0.2.9**
*added*
+ Code clean
+ Bugfix with commits
+ A marker next to "Sign-in" buttons appears if a logfile is found
----------------------
**version 0.3.1**
*added*
+ Several bugfixes
--------------------
**version 0.3.2**
*added*
+ New folder organization (whole plugin in *addon* folder)
+ New install method (AssetLib from GodotEngine Editor)
--------------------
**version 0.6.0**
*removed*
- old position:
- the plugin doesn't appear in docs anymore. Instead, it will load a new tool in the top toolbar
- old layout:
- RepositoryList and GistList now show more informations about their contents
- old repository's content system:
- Repositories contents are now listed in a tree way
- old "commit to repository" system and FILTERS:
- The old system was based on a Filtering system: I introduced filters to help people choose which file to exclude from your commit, which files should negate an exclusion, and eventually from which path to start. This system was based on the conception that the whole commit started from the `res://` path. Now, you can select in a more interactive way all files and folders you want to commit, and exclude them with a .gitignore system.
*added*
+ Informations about repositories:
+ Repositories now have their own icons: *lock* for private, *fork* for forked repositories, *gray repo* for own public repositories
+ Repositories show their forked times and stars
+ License templates: new repositories can now be created with a license template from all availables github supported licenses
+ Repository contents system:
+ files are now displayed in a compact, more readable tree system. Files and folders are differentiated, and folders can be folded and unfolded to show their contents
+ you can now delete multiple files just CTRL/SHIFT selecting them. **remember:** folders cannot be deleted by github integrity rules. Delete all folder's contents to delete the folder itself
+ you can now create a new branch from all selectable branches in your repository
+ **!Repository committing system**:
+ [filtering]
+ Since FILTERS are not supported anymore, the usage of `.gitignore` is now implemented.
+ a `.gitignore` file is loaded from the repository you want to commit to. If this repository doesn't have a gitignore, an empty and new gitignore can be created and committed.
+ the "gitignore editor" is shown next to the "committing tree" so you can procedurally select files and folders, and exclude/include them with the gitignore. *if you don't know how to use a gitignore, I recommend you to click on the `?` button in the bottom-right of the gitignore editor*
+ the "edit .gitignore" button will prevent any unwanted modifications to be applied by any chance (miss-typing, or you just don't need to edit the gitignore since it was loaded from the repository)
+ [file choosing]
+ Since FILTERS are not supported anymore, the commit process won't start from the project folder.
+ Now you can select multiple files and directories you want to commit through a file dialog showing your whole project folder.
+ Files and directories can always be removed before committing
**Please, note that the gitignore filtering method is custom made. To fully support the same gitignore method applied by GitHub some tests are needed**
+ **Gists** can now be opened, edited, and pushed with a cusotm GitEditor. Gists which contain more than one file are supported, and you can edit more files at the same time.
--------------------
**version 0.6.2**
*fixed*
- new method to show contents of repositories: faster code and works better. Empty repositories won't be loaded
- now each loading has a loading screen covering the whole scene: no more missclicks during a repository loading or a commit
- new icons in repositories to visually show what's the content type ( adapted to Godot Engine's file types)
--------------------
**version 0.7.0**
*added*
- **pull / clone button** : you can now pull from any branch of a selected repository. A local copy of your repository with files relative to the selected branch will be created in a .zip file inside your 'res://' folder. In this way you will be able to manage your repository's files in the way you prefer. Pulling/Cloning works on public, private and forked repositories.
--------------------
**version 0.7.2**
*added*
- **debug messages checkbox** : a new checkbox will appear on the top-left corner of the GUI. With this checkbox you can decide if you want to get debug messages from this plugin or not. You can enable/disable it in any plugin tab
*fidex*
- **deleting repository's resources** : with the previous version a bug occured and it wasn't possible to delete resources within a repository.
--------------------
**version 0.7.4**
*added*
- **auto extraction** : the plugin is now able to auto-extract downloaded archives automatically. _your OS needs python_ to run the extraction script since it is not currently built in Godot Engine. It is still a beta script, so it is highly recommended to use it inside empty projects and have some tests. You can always report issues and contact me for any bug.
- **sing up link** : if you don't have an account, or want to create a new one, you can click on the *'Don't have a GitHub account yet?'* button in the main tab of the plugin
--------------------
**version 0.7.5**
*fixed*
- **minor bugs**
--------------------
**version 0.7.8**
*fixed*
- *[!] icon for log file* appeared even though there weren't log files already stored
- increased the number of repositories that will be listed. Default GitHub repository listing provides only 30 repositories at time. Now the limit is increased to 100.
*added*
- user's datas are now stored in an **encrypted file**, and datas are shared on an upper level folder. Now you won't need to save the same datas for each 'github integration' plugin you install in your new projects, but all the projects you have and in which you use this plugin will always use the same log file. This log file will be stored at `<path_to_user>/AppData/Roaming/Godot/github_integration/`
- the plugin now supports two different unzipping methods, one with a *Python script* and one with a *GDScript*. The second one is offered by an external plugin, which is the [gdunzip](https://github.com/jellehermsen/gdunzip) plugin developed by [jellehermsen](https://github.com/jellehermsen) (please, check it out!!). **NOTE:** If you've got Python installed on your PC, it is recommended using the Python one, since the GDScript one is not developed by me and may not work. In that case, please make an issue with specific informations about the problem you've encountered, and I'll make sure to discuss about it with the developer.
--------------------
**version 0.8.2**
*fixed*
- autoload errors with 3.2 beta versions (and so on)
- some interface bugs
- minor bugfixes
*added*
- **new authentication method** : it is now possible to log into your GitHub profile with an *Access Token*. Since GitHub will deprecate the basic authentication method (which consists of `your e-mail : your password`) this plugin will **only work** with your personal access token.
Please, visit [this site](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) to understand what a Personal Access Token is, and how to use it. You will also find this link as a button in the plugin.
--------------------
**version 0.8.4**
*fixed*
- plugin ui
- extraction methods
*added*
- introduced a java extraction method for zip files.
-------------------
**version 0.9.0**
*fixed*
- opening shared repositories
*added*
- new repositories explorer
- search bar for repositories
-----------------
**version 1.0.0**
*fixed*
- overall fixes
- *infinite loading after commit/push:* fixed an issue that blocked commiting and pushing an entire project or some specific files. Now everything should be committed fine. A whole project can be committed just selecting "Select current directory"
- *.gitignore handling:* fixed gitignore handling, sometimes they were empty or overwritten randomly
*added*
- *new UI:* now the plugin follows the official GitHub color palette and interface
- *gist searchbar:* it is now possible to use the searchbar for gist
- *autolog:* now an auto login option is available. When activated, the plugin will automatically log inside user's github profile
- **darkmode:** it is now available a darkmode. Both light and dark modes respect github color palette. The dark mode can be activated anytime during the plugin usage
-----------------
**version 1.1.0**
*fixed*
- *faster login and auto-login*
- *minor errors with nodes*
*added*
- *fast social button to header:* you can now join the social I share in the README with some buttons in the header.
-----------------
**version 1.2.0**
*fixed*
- dark theme fixed
*added*
- *collaborations:* you can now invite other users for a collaboration in your repositories. If the user has been invited successfully, they will receive an email with an invitation to accept/decline. Users that have repositories in collaboration will see these repositories marked with a new icon inside their repositories list. Collaborators can work with this repositories as they are their own repositories (based on the permissions granted), so teamworking will be much faster.
> This text file was created via [TextEditor Integration](https://github.com/fenix-hub/godot-engine.text-editor) inside Godot Engine's Editor.

7
default_env.tres Normal file
View File

@ -0,0 +1,7 @@
[gd_resource type="Environment" load_steps=2 format=2]
[sub_resource type="ProceduralSky" id=1]
[resource]
background_mode = 2
background_sky = SubResource( 1 )

BIN
icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

35
icon.png.import Normal file
View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://icon.png"
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

90
project.godot Normal file
View File

@ -0,0 +1,90 @@
; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=4
_global_script_classes=[ {
"base": "Node",
"class": "GameScene",
"language": "GDScript",
"path": "res://Scripts/GameScene.gd"
}, {
"base": "Unit",
"class": "NPCUnit",
"language": "GDScript",
"path": "res://Scripts/Units/NPCUnit.gd"
}, {
"base": "Unit",
"class": "Player",
"language": "GDScript",
"path": "res://Scripts/Units/Player.gd"
}, {
"base": "Area2D",
"class": "Unit",
"language": "GDScript",
"path": "res://Scripts/Unit.gd"
} ]
_global_script_class_icons={
"GameScene": "",
"NPCUnit": "",
"Player": "",
"Unit": ""
}
[application]
config/name="Kinematically Reinterpreted Implementation Needing Godot Engine"
run/main_scene="res://Scenes/SandboxScene.tscn"
config/icon="res://icon.png"
[display]
window/size/width=840
window/size/height=560
[input]
gba_b={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":88,"unicode":0,"echo":false,"script":null)
]
}
gba_a={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":90,"unicode":0,"echo":false,"script":null)
]
}
gba_start={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777221,"unicode":0,"echo":false,"script":null)
]
}
gba_select={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777220,"unicode":0,"echo":false,"script":null)
]
}
[layer_names]
2d_physics/layer_1="Player Hit"
2d_physics/layer_2="Enemy Hit"
[network]
limits/debugger_stdout/max_chars_per_second=4096
limits/debugger_stdout/max_messages_per_frame=2048
[physics]
common/enable_pause_aware_picking=true
[rendering]
2d/snapping/use_gpu_pixel_snap=true
environment/default_environment="res://default_env.tres"