Initial commit

This commit is contained in:
2020-10-01 19:53:08 +02:00
parent dea479a784
commit ace4593b46
82 changed files with 2570 additions and 0 deletions

BIN
Characters/Kek/Idle_01.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Idle_01.png-af98f07b125195850281aae5917a68dc.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Characters/Kek/Idle_01.png"
dest_files=[ "res://.import/Idle_01.png-af98f07b125195850281aae5917a68dc.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=true
svg/scale=1.0

BIN
Characters/Kek/Idle_01.xcf Normal file

Binary file not shown.

BIN
Characters/Kek/Idle_02.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Idle_02.png-d0e53a50db12af9436fbb7806f10fa51.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Characters/Kek/Idle_02.png"
dest_files=[ "res://.import/Idle_02.png-d0e53a50db12af9436fbb7806f10fa51.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
Characters/Kek/Idle_03.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Idle_03.png-a4814ee812b51479b3fb7150c2bc8ab0.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Characters/Kek/Idle_03.png"
dest_files=[ "res://.import/Idle_03.png-a4814ee812b51479b3fb7150c2bc8ab0.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=true
svg/scale=1.0

22
Characters/Kek/Kek.tscn Normal file
View File

@@ -0,0 +1,22 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://Characters/Kek/Idle_01.png" type="Texture" id=1]
[ext_resource path="res://Characters/Kek/Idle_02.png" type="Texture" id=2]
[ext_resource path="res://Characters/Kek/Idle_03.png" type="Texture" id=3]
[sub_resource type="SpriteFrames" id=1]
animations = [ {
"frames": [ ExtResource( 1 ), ExtResource( 2 ), ExtResource( 3 ) ],
"loop": true,
"name": "idle",
"speed": 2.0
} ]
[node name="KinematicBody2D" type="KinematicBody2D"]
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
frames = SubResource( 1 )
animation = "idle"
playing = true

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Run_01.png-22b341c31e1acc050309d331123c9ad7.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Characters/Player/Aimo/Run_01.png"
dest_files=[ "res://.import/Run_01.png-22b341c31e1acc050309d331123c9ad7.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=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 691 B

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Run_02.png-c1da789cc8533b88c225beb556589805.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Characters/Player/Aimo/Run_02.png"
dest_files=[ "res://.import/Run_02.png-c1da789cc8533b88c225beb556589805.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=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 720 B

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Run_03.png-c615c086917a91d2f26a550ffc8be947.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Characters/Player/Aimo/Run_03.png"
dest_files=[ "res://.import/Run_03.png-c615c086917a91d2f26a550ffc8be947.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=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 568 B

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Run_04.png-927ff860d3bbb32392b12b7860ee5012.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Characters/Player/Aimo/Run_04.png"
dest_files=[ "res://.import/Run_04.png-927ff860d3bbb32392b12b7860ee5012.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=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 B

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Run_05.png-aaf97dcbb273cb54d79bdba861970ac8.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Characters/Player/Aimo/Run_05.png"
dest_files=[ "res://.import/Run_05.png-aaf97dcbb273cb54d79bdba861970ac8.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=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 587 B

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Run_06.png-28a77d88dd0ba0c1a28387c110b92c2f.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Characters/Player/Aimo/Run_06.png"
dest_files=[ "res://.import/Run_06.png-28a77d88dd0ba0c1a28387c110b92c2f.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=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Idle_01.png-697718a653e9730ffa60e19cf3c510a4.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Characters/Player/Bit/Idle_01.png"
dest_files=[ "res://.import/Idle_01.png-697718a653e9730ffa60e19cf3c510a4.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=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Idle_02.png-8077daaf15e82f7c9a9e5afd2d2872b2.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Characters/Player/Bit/Idle_02.png"
dest_files=[ "res://.import/Idle_02.png-8077daaf15e82f7c9a9e5afd2d2872b2.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=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 B

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Idle_03.png-affb442aa95274285dab4251345184e4.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Characters/Player/Bit/Idle_03.png"
dest_files=[ "res://.import/Idle_03.png-affb442aa95274285dab4251345184e4.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=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Idle_04.png-462140885ad5cccfcef4c070c2b6aa68.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Characters/Player/Bit/Idle_04.png"
dest_files=[ "res://.import/Idle_04.png-462140885ad5cccfcef4c070c2b6aa68.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=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Jump_01.png-e25a7966d8c4a2c2fb2593fa07510ff6.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Characters/Player/Bit/Jump_01.png"
dest_files=[ "res://.import/Jump_01.png-e25a7966d8c4a2c2fb2593fa07510ff6.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=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 418 B

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Run_01.png-ee592032d720a597fdd2f19f54874e1d.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Characters/Player/Bit/Run_01.png"
dest_files=[ "res://.import/Run_01.png-ee592032d720a597fdd2f19f54874e1d.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: 489 B

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Run_02.png-16f845953710f5859b4ce9f04d6606a5.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Characters/Player/Bit/Run_02.png"
dest_files=[ "res://.import/Run_02.png-16f845953710f5859b4ce9f04d6606a5.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=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 575 B

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Run_03.png-a983debcb92f828ef4989f6ea2cad9ec.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Characters/Player/Bit/Run_03.png"
dest_files=[ "res://.import/Run_03.png-a983debcb92f828ef4989f6ea2cad9ec.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=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 B

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Run_04.png-4aa78c5c5d86fbabf4f9fff6b0eb6385.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Characters/Player/Bit/Run_04.png"
dest_files=[ "res://.import/Run_04.png-4aa78c5c5d86fbabf4f9fff6b0eb6385.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=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 445 B

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Run_05.png-83aa92aa8c2ddefb873fb1db2ebab99c.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Characters/Player/Bit/Run_05.png"
dest_files=[ "res://.import/Run_05.png-83aa92aa8c2ddefb873fb1db2ebab99c.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=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 494 B

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Run_06.png-d2f9d398d1ced6442ed7699b5f4d7f54.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Characters/Player/Bit/Run_06.png"
dest_files=[ "res://.import/Run_06.png-d2f9d398d1ced6442ed7699b5f4d7f54.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=true
svg/scale=1.0

View File

@@ -0,0 +1,110 @@
[gd_scene load_steps=19 format=2]
[ext_resource path="res://Characters/Player/player.gd" type="Script" id=1]
[ext_resource path="res://Characters/Player/Bit/Idle_01.png" type="Texture" id=2]
[ext_resource path="res://Characters/Player/Bit/Idle_02.png" type="Texture" id=3]
[ext_resource path="res://Characters/Player/Bit/Idle_03.png" type="Texture" id=4]
[ext_resource path="res://Characters/Player/Bit/Idle_04.png" type="Texture" id=5]
[ext_resource path="res://Characters/Player/Bit/Jump_01.png" type="Texture" id=6]
[ext_resource path="res://Characters/Player/Bit/Run_01.png" type="Texture" id=7]
[ext_resource path="res://Characters/Player/Bit/Run_02.png" type="Texture" id=8]
[ext_resource path="res://Characters/Player/Bit/Run_03.png" type="Texture" id=9]
[ext_resource path="res://Characters/Player/Bit/Run_04.png" type="Texture" id=10]
[ext_resource path="res://Characters/Player/Bit/Run_05.png" type="Texture" id=11]
[ext_resource path="res://Characters/Player/Bit/Run_06.png" type="Texture" id=12]
[ext_resource path="res://Lightmaps/PlayerLight.png" type="Texture" id=13]
[ext_resource path="res://Lightmaps/CompleteWhite.png" type="Texture" id=14]
[sub_resource type="CapsuleShape2D" id=1]
radius = 11.2128
height = 0.0
[sub_resource type="SpriteFrames" id=2]
animations = [ {
"frames": [ ExtResource( 2 ), ExtResource( 3 ), ExtResource( 4 ), ExtResource( 5 ) ],
"loop": true,
"name": "idle",
"speed": 3.0
}, {
"frames": [ ExtResource( 6 ) ],
"loop": true,
"name": "jump",
"speed": 0.0
}, {
"frames": [ ExtResource( 7 ), ExtResource( 8 ), ExtResource( 9 ), ExtResource( 10 ), ExtResource( 11 ), ExtResource( 12 ) ],
"loop": true,
"name": "run",
"speed": 10.0
} ]
[sub_resource type="CircleShape2D" id=3]
radius = 121.239
[sub_resource type="CircleShape2D" id=4]
radius = 139.247
[node name="Player" type="KinematicBody2D"]
position = Vector2( 0.377872, 0.100608 )
script = ExtResource( 1 )
__meta__ = {
"_edit_group_": true
}
BASE_CAMERA_ZOOM = 0.4
VIEW_SMOOTH_FACTOR = 0.1
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2( -1.38898, 7.56054 )
rotation = 1.5708
scale = Vector2( 0.574, 0.604 )
shape = SubResource( 1 )
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
position = Vector2( -1.21067, 0.601201 )
frames = SubResource( 2 )
animation = "idle"
frame = 1
playing = true
[node name="Label" type="Label" parent="."]
margin_left = -61.0
margin_top = -35.0
margin_right = 64.0
margin_bottom = -21.0
text = "SIXTEENCHARACTER"
align = 1
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Light2D" type="Light2D" parent="."]
position = Vector2( -0.495953, 13.2623 )
z_index = 2
texture = ExtResource( 13 )
texture_scale = 0.95
energy = 0.7
shadow_enabled = true
shadow_filter = 4
shadow_filter_smooth = 4.9
[node name="Darken" type="Light2D" parent="."]
texture = ExtResource( 14 )
texture_scale = 7.7
energy = 0.7
mode = 1
shadow_filter = 2
[node name="View" type="Area2D" parent="."]
modulate = Color( 0.192157, 0.239216, 0.713726, 1 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="View"]
shape = SubResource( 3 )
disabled = true
[node name="Receive" type="Area2D" parent="."]
modulate = Color( 0.658824, 0.984314, 0.227451, 1 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="Receive"]
modulate = Color( 0.439216, 0.427451, 0.427451, 1 )
shape = SubResource( 4 )
[connection signal="body_entered" from="View" to="." method="_on_Area2D_body_entered"]
[connection signal="body_exited" from="View" to="." method="_on_Area2D_body_exited"]

158
Characters/Player/player.gd Normal file
View File

@@ -0,0 +1,158 @@
extends KinematicBody2D
# Constains for movement
const MOVE_SPEED = 3.0
const RUN_MULTIPLIER = 2
const GRAVITY = 10
const JUMP_POWER = -180
const FLOOR = Vector2(0, -1)
export var BASE_CAMERA_ZOOM: float = 0.7
export var VIEW_SMOOTH_FACTOR: float = 0.5
enum MoveDirection { UP, DOWN, LEFT, RIGHT, NONE }
# Networking
slave var slave_position = Vector2()
slave var slave_movement = MoveDirection.NONE
slave var slave_transparency = 0
slave var slave_gone = false
var velocity = Vector2()
var isRunning = false
var look_direction = Vector2(1, 0)
var minimap = false
var zoom_interpolation = 0
# Get camara
onready var camera_focus = $"/root/Node2D/Game/Focus" as Position2D
onready var camera = $"/root/Node2D/Game/Focus/Camera" as Camera2D
onready var gui = $"/root/Node2D/GUI" as CanvasLayer
onready var client = $"/root/Node2D/Game/Connection" as Node2D
func _process(delta):
pass
func _physics_process(delta):
# Check if game is visable
if(get_node("../../Game").is_visible() == false):
return
for player in Networking.players:
if player != int(name):
var p = (get_node("/root/Node2D/Game/" + String(player)) as KinematicBody2D)
if p != self:
var distance = p.position.distance_to(position)
var transparency = (distance - ($View/CollisionShape2D as CollisionShape2D).shape.radius + 10) * VIEW_SMOOTH_FACTOR
# Clip values
if transparency > 1:
transparency = 1
if transparency < 0:
transparency = 0
rset_id(player, "slave_transparency", transparency)
modulate.a = 1-slave_transparency
"""
MAP OVERVIEW
"""
# Put focus on player if not in minimap
var start = Vector2(BASE_CAMERA_ZOOM, BASE_CAMERA_ZOOM)
var end = Vector2(1.5, 1.5)
if !minimap:
camera_focus.position = position
if zoom_interpolation <= 1.1:
zoom_interpolation -= 0.05
camera.set_zoom(start.cubic_interpolate(end, start/2, end/2, zoom_interpolation))
# Stop zooming in
if zoom_interpolation <= 0:
camera.smoothing_speed = 6
zoom_interpolation = 0
else:
# Update camera zoom
if zoom_interpolation <= 1:
zoom_interpolation += 0.05
camera.set_zoom(start.cubic_interpolate(end, start/2, end/2, zoom_interpolation))
# View map
if Input.is_action_just_pressed("minimap"):
if !minimap:
minimap = true
camera.smoothing_speed = 2
camera_focus.position = get_node("/root/Node2D").position
else:
minimap = false
"""
MOVEMENT
"""
var direction = MoveDirection.NONE
var RIGHT = Input.is_action_pressed("ui_right")
var LEFT = Input.is_action_pressed("ui_left")
var JUMP = Input.is_action_pressed("ui_up")
var SNEAK = Input.is_action_pressed("ui_down")
var RUN = Input.is_action_pressed("ui_shift")
if get_tree().network_peer != null and is_network_master():
if LEFT:
direction = MoveDirection.LEFT
elif RIGHT:
direction = MoveDirection.RIGHT
elif JUMP:
direction = MoveDirection.UP
elif SNEAK:
direction = MoveDirection.DOWN
"""
for player in Networking.players:
if player != int(name):
var p = Networking.get_player_node(int(player))
if $Receive.overlaps_body(p):
# Send everyone in receive area the current position
rset_unreliable_id(int(player), 'slave_position', position)
rset_id(int(player), 'slave_movement', direction)
else:
# Hide from everyone else
rset_id(int(player), 'slave_movement', MoveDirection.NONE)"""
if Networking.move:
rset_unreliable('slave_position', position)
rset('slave_movement', direction)
_move(direction)
else:
_move(slave_movement)
position = slave_position
if get_tree().network_peer != null and get_tree().is_network_server():
Networking.update_position(int(name), position)
func _move(direction):
match direction:
MoveDirection.NONE:
return
MoveDirection.UP:
move_and_collide(Vector2(0, -MOVE_SPEED))
$AnimatedSprite.play("jump")
MoveDirection.DOWN:
move_and_collide(Vector2(0, MOVE_SPEED))
velocity.x = 0
$AnimatedSprite.play("idle")
MoveDirection.LEFT:
move_and_collide(Vector2(-MOVE_SPEED, 0))
$AnimatedSprite.play("run")
$AnimatedSprite.set_flip_h(true);
look_direction = Vector2(-1, 0)
MoveDirection.RIGHT:
move_and_collide(Vector2(MOVE_SPEED, 0))
look_direction = Vector2(1, 0)
$AnimatedSprite.play("run")
$AnimatedSprite.set_flip_h(false);
if(isRunning):
velocity.x = MOVE_SPEED*RUN_MULTIPLIER
else:
velocity.x = MOVE_SPEED