Compare commits
2 Commits
75bbe25929
...
ef3045b3d2
| Author | SHA1 | Date | |
|---|---|---|---|
| ef3045b3d2 | |||
| 2d2dea616c |
241
Scenes/Characters/Capricorn/CapricornP1.tscn
Normal file
241
Scenes/Characters/Capricorn/CapricornP1.tscn
Normal file
@@ -0,0 +1,241 @@
|
||||
[gd_scene load_steps=34 format=3 uid="uid://crkon4c8ah1a2"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://utm2g5q7m2b3" path="res://Scenes/Characters/Capricorn/GameJam_DevilCapricorn_WalkForward.png" id="1_6gj6x"]
|
||||
[ext_resource type="Script" path="res://Scripts/Capricorn.cs" id="1_rngpf"]
|
||||
[ext_resource type="Texture2D" uid="uid://c5t256wcykb47" path="res://Scenes/Characters/Capricorn/GameJam_DevilCapricorn_WalkSide.png" id="2_7kuua"]
|
||||
[ext_resource type="Texture2D" uid="uid://w444vcu8rvae" path="res://Scenes/Characters/Capricorn/GameJam_DevilCapricorn_WalkBehind.png" id="3_jo3tm"]
|
||||
[ext_resource type="Texture2D" uid="uid://cju5ycxiuwy25" path="res://Scenes/Characters/Capricorn/GameJam_DevilCapricorn_AttackSide.png" id="4_o173h"]
|
||||
[ext_resource type="Texture2D" uid="uid://s0j0kj4ila8s" path="res://Scenes/Characters/Capricorn/GameJam_DevilCapricorn_AttackForward.png" id="5_gjitx"]
|
||||
[ext_resource type="Texture2D" uid="uid://dchysrwcxhfvx" path="res://Scenes/Characters/Capricorn/GameJam_DevilCapricorn_AttackBehind.png" id="6_yx7kq"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_njxhk"]
|
||||
atlas = ExtResource("5_gjitx")
|
||||
region = Rect2(0, 0, 120, 140)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_bmuvx"]
|
||||
atlas = ExtResource("5_gjitx")
|
||||
region = Rect2(120, 0, 120, 140)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_14ft5"]
|
||||
atlas = ExtResource("5_gjitx")
|
||||
region = Rect2(240, 0, 120, 140)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_olmdj"]
|
||||
atlas = ExtResource("5_gjitx")
|
||||
region = Rect2(360, 0, 120, 140)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_qaudm"]
|
||||
atlas = ExtResource("6_yx7kq")
|
||||
region = Rect2(0, 0, 120, 144)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_a52sr"]
|
||||
atlas = ExtResource("6_yx7kq")
|
||||
region = Rect2(120, 0, 120, 144)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_qkrgl"]
|
||||
atlas = ExtResource("6_yx7kq")
|
||||
region = Rect2(240, 0, 120, 144)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_k5oj5"]
|
||||
atlas = ExtResource("6_yx7kq")
|
||||
region = Rect2(360, 0, 120, 144)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_6iqcx"]
|
||||
atlas = ExtResource("4_o173h")
|
||||
region = Rect2(0, 0, 113, 142)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_kiiv3"]
|
||||
atlas = ExtResource("4_o173h")
|
||||
region = Rect2(113, 0, 113, 142)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_up4ur"]
|
||||
atlas = ExtResource("4_o173h")
|
||||
region = Rect2(226, 0, 113, 142)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_hvxie"]
|
||||
atlas = ExtResource("4_o173h")
|
||||
region = Rect2(339, 0, 113, 142)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_vc5hj"]
|
||||
atlas = ExtResource("1_6gj6x")
|
||||
region = Rect2(0, 0, 120, 128)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_672u0"]
|
||||
atlas = ExtResource("1_6gj6x")
|
||||
region = Rect2(120, 0, 120, 128)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_po3o8"]
|
||||
atlas = ExtResource("1_6gj6x")
|
||||
region = Rect2(240, 0, 120, 128)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_v0my0"]
|
||||
atlas = ExtResource("1_6gj6x")
|
||||
region = Rect2(360, 0, 120, 128)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_fge82"]
|
||||
atlas = ExtResource("3_jo3tm")
|
||||
region = Rect2(0, 0, 120, 132)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_v2d05"]
|
||||
atlas = ExtResource("3_jo3tm")
|
||||
region = Rect2(120, 0, 120, 132)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_mkdc6"]
|
||||
atlas = ExtResource("3_jo3tm")
|
||||
region = Rect2(240, 0, 120, 132)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_0nnnw"]
|
||||
atlas = ExtResource("3_jo3tm")
|
||||
region = Rect2(360, 0, 120, 132)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_sjqet"]
|
||||
atlas = ExtResource("2_7kuua")
|
||||
region = Rect2(0, 0, 113, 130)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_l8c3l"]
|
||||
atlas = ExtResource("2_7kuua")
|
||||
region = Rect2(113, 0, 113, 130)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_a72tn"]
|
||||
atlas = ExtResource("2_7kuua")
|
||||
region = Rect2(226, 0, 113, 130)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_s2v14"]
|
||||
atlas = ExtResource("2_7kuua")
|
||||
region = Rect2(339, 0, 113, 130)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_h2iud"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_njxhk")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_bmuvx")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_14ft5")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_olmdj")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"AttackBack",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_qaudm")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_a52sr")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_qkrgl")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_k5oj5")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"AttackForward",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_6iqcx")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_kiiv3")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_up4ur")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_hvxie")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"AttackSide",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_vc5hj")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_672u0")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_po3o8")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_v0my0")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"WalkBack",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_fge82")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_v2d05")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_mkdc6")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_0nnnw")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"WalkForward",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_sjqet")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_l8c3l")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_a72tn")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_s2v14")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"WalkSide",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_r4spg"]
|
||||
size = Vector3(1, 5, 1)
|
||||
|
||||
[node name="Capricorn" type="CharacterBody3D" groups=["Player"]]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, 0)
|
||||
script = ExtResource("1_rngpf")
|
||||
|
||||
[node name="Pivot" type="Node3D" parent="."]
|
||||
|
||||
[node name="Sprite" type="AnimatedSprite3D" parent="Pivot"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.778099, 0.160949, 0.291765)
|
||||
centered = false
|
||||
billboard = 1
|
||||
sprite_frames = SubResource("SpriteFrames_h2iud")
|
||||
animation = &"WalkSide"
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
shape = SubResource("BoxShape3D_r4spg")
|
||||
|
||||
[node name="Area3D" type="Area3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.75657e-15, 0, 0)
|
||||
disable_mode = 2
|
||||
collision_layer = 16
|
||||
collision_mask = 4100
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"]
|
||||
transform = Transform3D(0.999665, -0.0258978, -7.10543e-15, 0.0258978, 0.999665, 0, 0, 0, 1, 0, 0, 0)
|
||||
shape = SubResource("BoxShape3D_r4spg")
|
||||
|
||||
[connection signal="body_entered" from="Area3D" to="." method="OnHit"]
|
||||
244
Scenes/Characters/Capricorn/CapricornP2.tscn
Normal file
244
Scenes/Characters/Capricorn/CapricornP2.tscn
Normal file
@@ -0,0 +1,244 @@
|
||||
[gd_scene load_steps=35 format=3 uid="uid://kd7mdmo5i7nw"]
|
||||
|
||||
[ext_resource type="Script" path="res://Scripts/Capricorn2.cs" id="1_iu20s"]
|
||||
[ext_resource type="Texture2D" uid="uid://s0j0kj4ila8s" path="res://Scenes/Characters/Capricorn/GameJam_DevilCapricorn_AttackForward.png" id="2_chht3"]
|
||||
[ext_resource type="Texture2D" uid="uid://dchysrwcxhfvx" path="res://Scenes/Characters/Capricorn/GameJam_DevilCapricorn_AttackBehind.png" id="3_5nvnq"]
|
||||
[ext_resource type="Texture2D" uid="uid://cju5ycxiuwy25" path="res://Scenes/Characters/Capricorn/GameJam_DevilCapricorn_AttackSide.png" id="4_y2kns"]
|
||||
[ext_resource type="Texture2D" uid="uid://utm2g5q7m2b3" path="res://Scenes/Characters/Capricorn/GameJam_DevilCapricorn_WalkForward.png" id="5_65b4c"]
|
||||
[ext_resource type="Texture2D" uid="uid://w444vcu8rvae" path="res://Scenes/Characters/Capricorn/GameJam_DevilCapricorn_WalkBehind.png" id="6_y20id"]
|
||||
[ext_resource type="Texture2D" uid="uid://c5t256wcykb47" path="res://Scenes/Characters/Capricorn/GameJam_DevilCapricorn_WalkSide.png" id="7_pfrtm"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_njxhk"]
|
||||
atlas = ExtResource("2_chht3")
|
||||
region = Rect2(0, 0, 120, 140)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_bmuvx"]
|
||||
atlas = ExtResource("2_chht3")
|
||||
region = Rect2(120, 0, 120, 140)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_14ft5"]
|
||||
atlas = ExtResource("2_chht3")
|
||||
region = Rect2(240, 0, 120, 140)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_olmdj"]
|
||||
atlas = ExtResource("2_chht3")
|
||||
region = Rect2(360, 0, 120, 140)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_qaudm"]
|
||||
atlas = ExtResource("3_5nvnq")
|
||||
region = Rect2(0, 0, 120, 144)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_a52sr"]
|
||||
atlas = ExtResource("3_5nvnq")
|
||||
region = Rect2(120, 0, 120, 144)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_qkrgl"]
|
||||
atlas = ExtResource("3_5nvnq")
|
||||
region = Rect2(240, 0, 120, 144)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_k5oj5"]
|
||||
atlas = ExtResource("3_5nvnq")
|
||||
region = Rect2(360, 0, 120, 144)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_6iqcx"]
|
||||
atlas = ExtResource("4_y2kns")
|
||||
region = Rect2(0, 0, 113, 142)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_kiiv3"]
|
||||
atlas = ExtResource("4_y2kns")
|
||||
region = Rect2(113, 0, 113, 142)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_up4ur"]
|
||||
atlas = ExtResource("4_y2kns")
|
||||
region = Rect2(226, 0, 113, 142)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_hvxie"]
|
||||
atlas = ExtResource("4_y2kns")
|
||||
region = Rect2(339, 0, 113, 142)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_vc5hj"]
|
||||
atlas = ExtResource("5_65b4c")
|
||||
region = Rect2(0, 0, 120, 128)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_672u0"]
|
||||
atlas = ExtResource("5_65b4c")
|
||||
region = Rect2(120, 0, 120, 128)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_po3o8"]
|
||||
atlas = ExtResource("5_65b4c")
|
||||
region = Rect2(240, 0, 120, 128)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_v0my0"]
|
||||
atlas = ExtResource("5_65b4c")
|
||||
region = Rect2(360, 0, 120, 128)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_fge82"]
|
||||
atlas = ExtResource("6_y20id")
|
||||
region = Rect2(0, 0, 120, 132)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_v2d05"]
|
||||
atlas = ExtResource("6_y20id")
|
||||
region = Rect2(120, 0, 120, 132)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_mkdc6"]
|
||||
atlas = ExtResource("6_y20id")
|
||||
region = Rect2(240, 0, 120, 132)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_0nnnw"]
|
||||
atlas = ExtResource("6_y20id")
|
||||
region = Rect2(360, 0, 120, 132)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_sjqet"]
|
||||
atlas = ExtResource("7_pfrtm")
|
||||
region = Rect2(0, 0, 113, 130)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_l8c3l"]
|
||||
atlas = ExtResource("7_pfrtm")
|
||||
region = Rect2(113, 0, 113, 130)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_a72tn"]
|
||||
atlas = ExtResource("7_pfrtm")
|
||||
region = Rect2(226, 0, 113, 130)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_s2v14"]
|
||||
atlas = ExtResource("7_pfrtm")
|
||||
region = Rect2(339, 0, 113, 130)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_h2iud"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_njxhk")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_bmuvx")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_14ft5")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_olmdj")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"AttackBack",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_qaudm")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_a52sr")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_qkrgl")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_k5oj5")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"AttackForward",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_6iqcx")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_kiiv3")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_up4ur")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_hvxie")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"AttackSide",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_vc5hj")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_672u0")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_po3o8")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_v0my0")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"WalkBack",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_fge82")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_v2d05")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_mkdc6")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_0nnnw")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"WalkForward",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_sjqet")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_l8c3l")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_a72tn")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_s2v14")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"WalkSide",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_r4spg"]
|
||||
size = Vector3(1, 1.04415, 1)
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_yilru"]
|
||||
size = Vector3(1, 5, 1)
|
||||
|
||||
[node name="Capricorn" type="CharacterBody3D" groups=["Player"]]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, 0)
|
||||
script = ExtResource("1_iu20s")
|
||||
|
||||
[node name="Pivot" type="Node3D" parent="."]
|
||||
|
||||
[node name="Sprite" type="AnimatedSprite3D" parent="Pivot"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.778099, 0.160949, 0.291765)
|
||||
centered = false
|
||||
billboard = 1
|
||||
sprite_frames = SubResource("SpriteFrames_h2iud")
|
||||
animation = &"WalkSide"
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
shape = SubResource("BoxShape3D_r4spg")
|
||||
|
||||
[node name="Area3D" type="Area3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.75657e-15, 0, 0)
|
||||
disable_mode = 2
|
||||
collision_layer = 16
|
||||
collision_mask = 4100
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"]
|
||||
transform = Transform3D(0.999665, -0.0258978, -7.10543e-15, 0.0258978, 0.999665, 0, 0, 0, 1, 0, 0, 0)
|
||||
shape = SubResource("BoxShape3D_yilru")
|
||||
|
||||
[connection signal="body_entered" from="Area3D" to="." method="OnHit"]
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 7.1 KiB |
@@ -0,0 +1,35 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dchysrwcxhfvx"
|
||||
path.s3tc="res://.godot/imported/GameJam_DevilCapricorn_AttackBehind.png-2dedb3ea6438a8ab592c9463443895e6.s3tc.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Scenes/Characters/Capricorn/GameJam_DevilCapricorn_AttackBehind.png"
|
||||
dest_files=["res://.godot/imported/GameJam_DevilCapricorn_AttackBehind.png-2dedb3ea6438a8ab592c9463443895e6.s3tc.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=2
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 7.7 KiB |
@@ -0,0 +1,35 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://s0j0kj4ila8s"
|
||||
path.s3tc="res://.godot/imported/GameJam_DevilCapricorn_AttackForward.png-5cd2b9ad587c18483b1471d2381bdd24.s3tc.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Scenes/Characters/Capricorn/GameJam_DevilCapricorn_AttackForward.png"
|
||||
dest_files=["res://.godot/imported/GameJam_DevilCapricorn_AttackForward.png-5cd2b9ad587c18483b1471d2381bdd24.s3tc.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=2
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 7.0 KiB |
@@ -0,0 +1,35 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cju5ycxiuwy25"
|
||||
path.s3tc="res://.godot/imported/GameJam_DevilCapricorn_AttackSide.png-9745c4c92d833e08a2b7664e3b485677.s3tc.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Scenes/Characters/Capricorn/GameJam_DevilCapricorn_AttackSide.png"
|
||||
dest_files=["res://.godot/imported/GameJam_DevilCapricorn_AttackSide.png-9745c4c92d833e08a2b7664e3b485677.s3tc.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=2
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 6.1 KiB |
@@ -0,0 +1,35 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://w444vcu8rvae"
|
||||
path.s3tc="res://.godot/imported/GameJam_DevilCapricorn_WalkBehind.png-b5848bc12395edd15ea1ca6c4be63815.s3tc.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Scenes/Characters/Capricorn/GameJam_DevilCapricorn_WalkBehind.png"
|
||||
dest_files=["res://.godot/imported/GameJam_DevilCapricorn_WalkBehind.png-b5848bc12395edd15ea1ca6c4be63815.s3tc.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=2
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 6.8 KiB |
@@ -0,0 +1,35 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://utm2g5q7m2b3"
|
||||
path.s3tc="res://.godot/imported/GameJam_DevilCapricorn_WalkForward.png-e31a9733ef747e6a48a09158cba5b8fe.s3tc.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Scenes/Characters/Capricorn/GameJam_DevilCapricorn_WalkForward.png"
|
||||
dest_files=["res://.godot/imported/GameJam_DevilCapricorn_WalkForward.png-e31a9733ef747e6a48a09158cba5b8fe.s3tc.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=2
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
BIN
Scenes/Characters/Capricorn/GameJam_DevilCapricorn_WalkSide.png
Normal file
BIN
Scenes/Characters/Capricorn/GameJam_DevilCapricorn_WalkSide.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.1 KiB |
@@ -0,0 +1,35 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://c5t256wcykb47"
|
||||
path.s3tc="res://.godot/imported/GameJam_DevilCapricorn_WalkSide.png-bc552e0a2810d82181477202397018e1.s3tc.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Scenes/Characters/Capricorn/GameJam_DevilCapricorn_WalkSide.png"
|
||||
dest_files=["res://.godot/imported/GameJam_DevilCapricorn_WalkSide.png-bc552e0a2810d82181477202397018e1.s3tc.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=2
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
File diff suppressed because one or more lines are too long
@@ -103,6 +103,7 @@ libraries = {
|
||||
}
|
||||
|
||||
[node name="Area3D" type="Area3D" parent="." index="4"]
|
||||
disable_mode = 2
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D" index="0"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.11619)
|
||||
|
||||
@@ -35,4 +35,7 @@ shape = SubResource("CylinderShape3D_kv6vl")
|
||||
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -3.17988, 0, 0)
|
||||
gizmo_extents = 1.0
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.37194, 6.02102)
|
||||
|
||||
[connection signal="body_entered" from="Area3D2" to="." method="OnExitEntered"]
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://xcmspevaqcrc"]
|
||||
[gd_scene load_steps=7 format=3 uid="uid://xcmspevaqcrc"]
|
||||
|
||||
[ext_resource type="Script" path="res://Scripts/Player.cs" id="1_ctl2x"]
|
||||
[ext_resource type="PackedScene" uid="uid://b38hcomu4tpm5" path="res://Scenes/Characters/P1PiscesWitch.tscn" id="2_7c6mk"]
|
||||
[ext_resource type="Script" path="res://Scripts/SpawnPoint.cs" id="2_mkhuu"]
|
||||
[ext_resource type="PackedScene" uid="uid://iempdafdn6ct" path="res://Scenes/Characters/P1PlayerScorpio.tscn" id="3_mtqa2"]
|
||||
[ext_resource type="PackedScene" uid="uid://bgkqfamdiwrrw" path="res://Scenes/Characters/P1Megami.tscn" id="4_1xs5f"]
|
||||
[ext_resource type="PackedScene" uid="uid://crkon4c8ah1a2" path="res://Scenes/Characters/Capricorn/CapricornP1.tscn" id="5_tfkdo"]
|
||||
|
||||
[node name="Player1" type="Node3D" node_paths=PackedStringArray("SpawnPoint")]
|
||||
script = ExtResource("1_ctl2x")
|
||||
SpawnPoint = NodePath("Marker3D")
|
||||
PlayableCharacterScenes = Array[PackedScene]([ExtResource("2_7c6mk"), ExtResource("3_mtqa2"), ExtResource("4_1xs5f")])
|
||||
PlayableCharacterScenes = Array[PackedScene]([ExtResource("2_7c6mk"), ExtResource("3_mtqa2"), ExtResource("4_1xs5f"), ExtResource("5_tfkdo")])
|
||||
|
||||
[node name="Marker3D" type="Marker3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.5, 0.123, 5.513)
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.5, 0, 5.513)
|
||||
gizmo_extents = 1.0
|
||||
script = ExtResource("2_mkhuu")
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://jircpua5fl80"]
|
||||
[gd_scene load_steps=7 format=3 uid="uid://jircpua5fl80"]
|
||||
|
||||
[ext_resource type="Script" path="res://Scripts/Player.cs" id="1_k788q"]
|
||||
[ext_resource type="Script" path="res://Scripts/SpawnPoint.cs" id="1_xs6nn"]
|
||||
[ext_resource type="PackedScene" uid="uid://dfanwejjy3iue" path="res://Scenes/Characters/P2PiscesWitch.tscn" id="2_w2id2"]
|
||||
[ext_resource type="PackedScene" uid="uid://cg6hdoeq70ke8" path="res://Scenes/Characters/P2PlayerScorpio.tscn" id="3_8owb2"]
|
||||
[ext_resource type="PackedScene" uid="uid://dk65etf7r8bm6" path="res://Scenes/Characters/P2Megami.tscn" id="4_w8v7n"]
|
||||
[ext_resource type="PackedScene" uid="uid://kd7mdmo5i7nw" path="res://Scenes/Characters/Capricorn/CapricornP2.tscn" id="5_ef5xs"]
|
||||
|
||||
[node name="Player2" type="Node3D" node_paths=PackedStringArray("SpawnPoint")]
|
||||
script = ExtResource("1_k788q")
|
||||
SpawnPoint = NodePath("Marker3D")
|
||||
PlayableCharacterScenes = Array[PackedScene]([ExtResource("2_w2id2"), ExtResource("3_8owb2"), ExtResource("4_w8v7n")])
|
||||
PlayableCharacterScenes = Array[PackedScene]([ExtResource("2_w2id2"), ExtResource("3_8owb2"), ExtResource("4_w8v7n"), ExtResource("5_ef5xs")])
|
||||
|
||||
[node name="Marker3D" type="Marker3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.5, 0, 5.609)
|
||||
|
||||
@@ -18,9 +18,9 @@ public partial class AreaExit : Node3D
|
||||
{
|
||||
if (node is Character)
|
||||
{
|
||||
if (node.GetType() == typeof(Character1))
|
||||
if (node.GetType() == typeof(Character1) || node.GetType() == typeof(Capricorn))
|
||||
_gameManager.RemoveCharacterAndAddToExit((Character1)node);
|
||||
if (node.GetType() == typeof(Character2))
|
||||
if (node.GetType() == typeof(Character2) || node.GetType() == typeof(Capricorn2))
|
||||
_gameManager.RemoveCharacterAndAddToExit((Character2)node);
|
||||
|
||||
GD.Print("Exit reached");
|
||||
|
||||
147
Scripts/Capricorn.cs
Normal file
147
Scripts/Capricorn.cs
Normal file
@@ -0,0 +1,147 @@
|
||||
using Godot;
|
||||
|
||||
public partial class Capricorn : Character1
|
||||
{
|
||||
private AnimatedSprite3D _sprite;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
_sprite = GetNode<AnimatedSprite3D>("Pivot/Sprite");
|
||||
CanShoot = true;
|
||||
_gameManager = GetTree().Root.GetNode<GameManager>("Main/GameManager");
|
||||
}
|
||||
|
||||
[Export]
|
||||
private PackedScene _fireProjectile;
|
||||
[Export]
|
||||
private PackedScene _altFireProjectile;
|
||||
|
||||
[Export]
|
||||
private float _speed = 3.0f;
|
||||
|
||||
public bool CanShoot { get; private set; }
|
||||
|
||||
public bool IsShooting = false;
|
||||
|
||||
private GameManager _gameManager;
|
||||
|
||||
public override void _PhysicsProcess(double delta)
|
||||
{
|
||||
Velocity = CalculateCharacterMovement(delta);
|
||||
MoveAndSlide();
|
||||
}
|
||||
|
||||
public override void _UnhandledInput(InputEvent @event)
|
||||
{
|
||||
if (Input.IsActionJustPressed("exit"))
|
||||
GetTree().Quit();
|
||||
|
||||
if (Input.IsActionJustPressed($"p1_fire") && CanShoot)
|
||||
Fire();
|
||||
if (Input.IsActionJustPressed($"p1_altfire") && CanShoot)
|
||||
AltFire();
|
||||
}
|
||||
|
||||
private Vector3 CalculateCharacterMovement(double delta)
|
||||
{
|
||||
var velocity = Velocity;
|
||||
|
||||
var inputDir = Input.GetVector($"p1_left", $"p1_right", $"p1_up", $"p1_down");
|
||||
var direction = (Transform.Basis * new Vector3(inputDir.X, 0, inputDir.Y)).Normalized();
|
||||
if (direction != Vector3.Zero)
|
||||
{
|
||||
velocity.X = direction.X * _speed;
|
||||
velocity.Z = direction.Z * _speed;
|
||||
}
|
||||
else
|
||||
{
|
||||
velocity.X = Mathf.MoveToward(Velocity.X, 0, _speed);
|
||||
velocity.Z = Mathf.MoveToward(Velocity.Z, 0, _speed);
|
||||
}
|
||||
|
||||
if (IsShooting)
|
||||
AttackSprite(direction);
|
||||
else
|
||||
WalkSprite(direction);
|
||||
|
||||
if (!IsShooting && direction.IsEqualApprox(Vector3.Zero))
|
||||
{
|
||||
_sprite.Play("WalkForward");
|
||||
_sprite.Stop();
|
||||
}
|
||||
|
||||
return velocity;
|
||||
}
|
||||
|
||||
private void WalkSprite(Vector3 direction)
|
||||
{
|
||||
var roundedDirection = direction.Round();
|
||||
|
||||
if (roundedDirection == Vector3.Right)
|
||||
{
|
||||
_sprite.Play("WalkSide");
|
||||
_sprite.FlipH = false;
|
||||
}
|
||||
if (roundedDirection == Vector3.Left)
|
||||
{
|
||||
_sprite.Play("WalkSide");
|
||||
_sprite.FlipH = true;
|
||||
}
|
||||
if (roundedDirection == Vector3.Forward)
|
||||
_sprite.Play("WalkForward");
|
||||
if (roundedDirection == Vector3.Back)
|
||||
_sprite.Play("WalkBack");
|
||||
}
|
||||
|
||||
private async void Fire()
|
||||
{
|
||||
IsShooting = true;
|
||||
//var projectile = _fireProjectile.Instantiate<Projectile>();
|
||||
//projectile.Position = Position + new Vector3(0f, 1f, 0f);
|
||||
//GetParent().AddChild(projectile);
|
||||
CanShoot = false;
|
||||
await ToSignal(GetTree().CreateTimer(2.0f), "timeout");
|
||||
CanShoot = true;
|
||||
IsShooting = false;
|
||||
}
|
||||
|
||||
private async void AltFire()
|
||||
{
|
||||
IsShooting = true;
|
||||
//var projectile = _altFireProjectile.Instantiate<Projectile>();
|
||||
//projectile.Position = Position + new Vector3(0f, 1f, 0f);
|
||||
//GetParent().AddChild(projectile);
|
||||
CanShoot = false;
|
||||
await ToSignal(GetTree().CreateTimer(2.0f), "timeout");
|
||||
CanShoot = true;
|
||||
IsShooting = false;
|
||||
}
|
||||
|
||||
private void AttackSprite(Vector3 direction)
|
||||
{
|
||||
var roundedDirection = direction.Round();
|
||||
|
||||
if (roundedDirection == Vector3.Right)
|
||||
{
|
||||
_sprite.Play("AttackSide");
|
||||
_sprite.FlipH = false;
|
||||
}
|
||||
if (roundedDirection == Vector3.Left)
|
||||
{
|
||||
_sprite.Play("AttackSide");
|
||||
_sprite.FlipH = true;
|
||||
}
|
||||
if (roundedDirection == Vector3.Forward)
|
||||
_sprite.Play("AttackForward");
|
||||
if (roundedDirection == Vector3.Back)
|
||||
_sprite.Play("AttackBack");
|
||||
|
||||
if (direction.IsEqualApprox(Vector3.Zero))
|
||||
_sprite.Play("AttackForward");
|
||||
}
|
||||
|
||||
public void OnHit(Node3D node)
|
||||
{
|
||||
_gameManager.CallDeferred(GameManager.MethodName.RemoveCharacter, this);
|
||||
}
|
||||
}
|
||||
147
Scripts/Capricorn2.cs
Normal file
147
Scripts/Capricorn2.cs
Normal file
@@ -0,0 +1,147 @@
|
||||
using Godot;
|
||||
|
||||
public partial class Capricorn2 : Character2
|
||||
{
|
||||
private AnimatedSprite3D _sprite;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
_sprite = GetNode<AnimatedSprite3D>("Pivot/Sprite");
|
||||
CanShoot = true;
|
||||
_gameManager = GetTree().Root.GetNode<GameManager>("Main/GameManager");
|
||||
}
|
||||
|
||||
[Export]
|
||||
private PackedScene _fireProjectile;
|
||||
[Export]
|
||||
private PackedScene _altFireProjectile;
|
||||
|
||||
[Export]
|
||||
private float _speed = 3.0f;
|
||||
|
||||
public bool CanShoot { get; private set; }
|
||||
|
||||
public bool IsShooting = false;
|
||||
|
||||
private GameManager _gameManager;
|
||||
|
||||
public override void _PhysicsProcess(double delta)
|
||||
{
|
||||
Velocity = CalculateCharacterMovement(delta);
|
||||
MoveAndSlide();
|
||||
}
|
||||
|
||||
public override void _UnhandledInput(InputEvent @event)
|
||||
{
|
||||
if (Input.IsActionJustPressed("exit"))
|
||||
GetTree().Quit();
|
||||
|
||||
if (Input.IsActionJustPressed($"p2_fire") && CanShoot)
|
||||
Fire();
|
||||
if (Input.IsActionJustPressed($"p2_altfire") && CanShoot)
|
||||
AltFire();
|
||||
}
|
||||
|
||||
private Vector3 CalculateCharacterMovement(double delta)
|
||||
{
|
||||
var velocity = Velocity;
|
||||
|
||||
var inputDir = Input.GetVector($"p2_left", $"p2_right", $"p2_up", $"p2_down");
|
||||
var direction = (Transform.Basis * new Vector3(inputDir.X, 0, inputDir.Y)).Normalized();
|
||||
if (direction != Vector3.Zero)
|
||||
{
|
||||
velocity.X = direction.X * _speed;
|
||||
velocity.Z = direction.Z * _speed;
|
||||
}
|
||||
else
|
||||
{
|
||||
velocity.X = Mathf.MoveToward(Velocity.X, 0, _speed);
|
||||
velocity.Z = Mathf.MoveToward(Velocity.Z, 0, _speed);
|
||||
}
|
||||
|
||||
if (IsShooting)
|
||||
AttackSprite(direction);
|
||||
else
|
||||
WalkSprite(direction);
|
||||
|
||||
if (!IsShooting && direction.IsEqualApprox(Vector3.Zero))
|
||||
{
|
||||
_sprite.Play("WalkForward");
|
||||
_sprite.Stop();
|
||||
}
|
||||
|
||||
return velocity;
|
||||
}
|
||||
|
||||
private void WalkSprite(Vector3 direction)
|
||||
{
|
||||
var roundedDirection = direction.Round();
|
||||
|
||||
if (roundedDirection == Vector3.Right)
|
||||
{
|
||||
_sprite.Play("WalkSide");
|
||||
_sprite.FlipH = false;
|
||||
}
|
||||
if (roundedDirection == Vector3.Left)
|
||||
{
|
||||
_sprite.Play("WalkSide");
|
||||
_sprite.FlipH = true;
|
||||
}
|
||||
if (roundedDirection == Vector3.Forward)
|
||||
_sprite.Play("WalkForward");
|
||||
if (roundedDirection == Vector3.Back)
|
||||
_sprite.Play("WalkBack");
|
||||
}
|
||||
|
||||
private async void Fire()
|
||||
{
|
||||
IsShooting = true;
|
||||
var projectile = _fireProjectile.Instantiate<Projectile>();
|
||||
projectile.Position = Position + new Vector3(0f, 1f, 0f);
|
||||
GetParent().AddChild(projectile);
|
||||
CanShoot = false;
|
||||
await ToSignal(GetTree().CreateTimer(2.0f), "timeout");
|
||||
CanShoot = true;
|
||||
IsShooting = false;
|
||||
}
|
||||
|
||||
private async void AltFire()
|
||||
{
|
||||
IsShooting = true;
|
||||
var projectile = _altFireProjectile.Instantiate<Projectile>();
|
||||
projectile.Position = Position + new Vector3(0f, 1f, 0f);
|
||||
GetParent().AddChild(projectile);
|
||||
CanShoot = false;
|
||||
await ToSignal(GetTree().CreateTimer(2.0f), "timeout");
|
||||
CanShoot = true;
|
||||
IsShooting = false;
|
||||
}
|
||||
|
||||
private void AttackSprite(Vector3 direction)
|
||||
{
|
||||
var roundedDirection = direction.Round();
|
||||
|
||||
if (roundedDirection == Vector3.Right)
|
||||
{
|
||||
_sprite.Play("AttackSide");
|
||||
_sprite.FlipH = false;
|
||||
}
|
||||
if (roundedDirection == Vector3.Left)
|
||||
{
|
||||
_sprite.Play("AttackSide");
|
||||
_sprite.FlipH = true;
|
||||
}
|
||||
if (roundedDirection == Vector3.Forward)
|
||||
_sprite.Play("AttackForward");
|
||||
if (roundedDirection == Vector3.Back)
|
||||
_sprite.Play("AttackBack");
|
||||
|
||||
if (direction.IsEqualApprox(Vector3.Zero))
|
||||
_sprite.Play("AttackForward");
|
||||
}
|
||||
|
||||
public void OnHit(Node3D node)
|
||||
{
|
||||
_gameManager.CallDeferred(GameManager.MethodName.RemoveCharacter, this);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using Godot;
|
||||
using System.Linq;
|
||||
|
||||
public partial class Character1 : Character
|
||||
{
|
||||
|
||||
@@ -88,7 +88,7 @@ public partial class GameManager : Node
|
||||
if (!P1CharactersOut.Any() && !Players.ElementAt(0).CharactersLeftOnStage.Any())
|
||||
SetGameOver(Players.ElementAt(0), true);
|
||||
|
||||
if (!P2CharactersOut.Any() && !Players.ElementAt(1).CharactersLeftOnStage.Any())
|
||||
if (Players.Count() == 2 && !P2CharactersOut.Any() && !Players.ElementAt(1).CharactersLeftOnStage.Any())
|
||||
SetGameOver(Players.ElementAt(1), true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user