Commit of existing data.
This commit is contained in:
Executable
+26
@@ -0,0 +1,26 @@
|
||||
class_name Zombie
|
||||
extends CharacterBody2D
|
||||
|
||||
|
||||
const SPEED = 300.0
|
||||
const JUMP_VELOCITY = -400.0
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
# Add the gravity.
|
||||
if not is_on_floor():
|
||||
velocity += get_gravity() * delta
|
||||
|
||||
# Handle jump.
|
||||
if Input.is_action_just_pressed("ui_accept") and is_on_floor():
|
||||
velocity.y = JUMP_VELOCITY
|
||||
|
||||
# Get the input direction and handle the movement/deceleration.
|
||||
# As good practice, you should replace UI actions with custom gameplay actions.
|
||||
var direction := Input.get_axis("ui_left", "ui_right")
|
||||
if direction:
|
||||
velocity.x = direction * SPEED
|
||||
else:
|
||||
velocity.x = move_toward(velocity.x, 0, SPEED)
|
||||
|
||||
move_and_slide()
|
||||
Executable
+1
@@ -0,0 +1 @@
|
||||
uid://bw8t7n771m0b4
|
||||
Executable
BIN
Binary file not shown.
|
After Width: | Height: | Size: 6.3 KiB |
Executable
+40
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://c8v7mt7kbv7k5"
|
||||
path="res://.godot/imported/zombie.png-cd8c3c30f31f1b01ad0e7564be92c691.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://objects/npcs/zombie.png"
|
||||
dest_files=["res://.godot/imported/zombie.png-cd8c3c30f31f1b01ad0e7564be92c691.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
Executable
+203
@@ -0,0 +1,203 @@
|
||||
[gd_scene load_steps=28 format=3 uid="uid://enj7slqj7o2o"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://c8v7mt7kbv7k5" path="res://objects/npcs/zombie.png" id="1_8psf6"]
|
||||
[ext_resource type="Script" uid="uid://bw8t7n771m0b4" path="res://objects/npcs/zombie.gd" id="1_qml1x"]
|
||||
[ext_resource type="Script" uid="uid://bsveyr6o3li86" path="res://objects/npcs/zombie_sprite.gd" id="3_8bxsl"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_qml1x"]
|
||||
atlas = ExtResource("1_8psf6")
|
||||
region = Rect2(0, 122, 52, 61)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_8bxsl"]
|
||||
atlas = ExtResource("1_8psf6")
|
||||
region = Rect2(52, 122, 52, 61)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_nyp6s"]
|
||||
atlas = ExtResource("1_8psf6")
|
||||
region = Rect2(104, 122, 52, 61)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_knvin"]
|
||||
atlas = ExtResource("1_8psf6")
|
||||
region = Rect2(156, 122, 52, 61)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_0k1nj"]
|
||||
atlas = ExtResource("1_8psf6")
|
||||
region = Rect2(208, 122, 52, 61)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_4k8tf"]
|
||||
atlas = ExtResource("1_8psf6")
|
||||
region = Rect2(260, 122, 52, 61)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_fljd2"]
|
||||
atlas = ExtResource("1_8psf6")
|
||||
region = Rect2(312, 122, 52, 61)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_hci6t"]
|
||||
atlas = ExtResource("1_8psf6")
|
||||
region = Rect2(364, 122, 52, 61)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_apr15"]
|
||||
atlas = ExtResource("1_8psf6")
|
||||
region = Rect2(416, 122, 52, 61)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_gigwc"]
|
||||
atlas = ExtResource("1_8psf6")
|
||||
region = Rect2(0, 0, 52, 61)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_5qsks"]
|
||||
atlas = ExtResource("1_8psf6")
|
||||
region = Rect2(52, 0, 52, 61)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ys0de"]
|
||||
atlas = ExtResource("1_8psf6")
|
||||
region = Rect2(0, 183, 52, 61)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_kni6o"]
|
||||
atlas = ExtResource("1_8psf6")
|
||||
region = Rect2(52, 183, 52, 61)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_8lesc"]
|
||||
atlas = ExtResource("1_8psf6")
|
||||
region = Rect2(104, 183, 52, 61)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ai73t"]
|
||||
atlas = ExtResource("1_8psf6")
|
||||
region = Rect2(156, 183, 52, 61)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_hmrhp"]
|
||||
atlas = ExtResource("1_8psf6")
|
||||
region = Rect2(208, 183, 52, 61)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_reymy"]
|
||||
atlas = ExtResource("1_8psf6")
|
||||
region = Rect2(260, 183, 52, 61)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_wifnu"]
|
||||
atlas = ExtResource("1_8psf6")
|
||||
region = Rect2(0, 61, 52, 61)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_frsw6"]
|
||||
atlas = ExtResource("1_8psf6")
|
||||
region = Rect2(52, 61, 52, 61)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_8n4lj"]
|
||||
atlas = ExtResource("1_8psf6")
|
||||
region = Rect2(104, 61, 52, 61)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_sqw4r"]
|
||||
atlas = ExtResource("1_8psf6")
|
||||
region = Rect2(156, 61, 52, 61)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_4jgel"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_qml1x")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_8bxsl")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_nyp6s")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_knvin")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_0k1nj")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_4k8tf")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_fljd2")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_hci6t")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_apr15")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"attack",
|
||||
"speed": 12.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_gigwc")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_5qsks")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"default",
|
||||
"speed": 3.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ys0de")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_kni6o")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_8lesc")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ai73t")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_hmrhp")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_reymy")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"die",
|
||||
"speed": 24.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_wifnu")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_frsw6")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_8n4lj")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_sqw4r")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"walk",
|
||||
"speed": 6.0
|
||||
}]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_8psf6"]
|
||||
radius = 6.0
|
||||
height = 24.0
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_8bxsl"]
|
||||
size = Vector2(8, 13)
|
||||
|
||||
[node name="Zombie" type="CharacterBody2D"]
|
||||
script = ExtResource("1_qml1x")
|
||||
|
||||
[node name="Sprite" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(0, -10.5)
|
||||
sprite_frames = SubResource("SpriteFrames_4jgel")
|
||||
animation = &"attack"
|
||||
frame = 5
|
||||
script = ExtResource("3_8bxsl")
|
||||
|
||||
[node name="Collision" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(0, -12)
|
||||
shape = SubResource("CapsuleShape2D_8psf6")
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
|
||||
[node name="CollisionAttack" type="CollisionShape2D" parent="Area2D"]
|
||||
position = Vector2(10, -11.5)
|
||||
shape = SubResource("RectangleShape2D_8bxsl")
|
||||
debug_color = Color(0.9942227, 0, 0.23271917, 0.41960785)
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
extends AnimatedSprite2D
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
||||
Executable
+1
@@ -0,0 +1 @@
|
||||
uid://bsveyr6o3li86
|
||||
Reference in New Issue
Block a user