Compare commits
1 Commits
enemy+wrap
...
d3eac34147
| Author | SHA1 | Date | |
|---|---|---|---|
| d3eac34147 |
Binary file not shown.
|
Before Width: | Height: | Size: 37 KiB |
@@ -1,40 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://bsjn11wcewgya"
|
|
||||||
path="res://.godot/imported/Blob.png-3a1a5deaf3590dc1853ac0b0bd158753.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://Assets/PlaceHolders/Blob.png"
|
|
||||||
dest_files=["res://.godot/imported/Blob.png-3a1a5deaf3590dc1853ac0b0bd158753.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
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 224 KiB |
@@ -1,40 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://xg0mu5mtpcgo"
|
|
||||||
path="res://.godot/imported/BuffMonk.png-1bcf3f620dedfe8f64fe9de0addc56fe.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://Assets/PlaceHolders/BuffMonk.png"
|
|
||||||
dest_files=["res://.godot/imported/BuffMonk.png-1bcf3f620dedfe8f64fe9de0addc56fe.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
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 470 KiB |
@@ -1,40 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://dfo7q0g3skud5"
|
|
||||||
path="res://.godot/imported/FallGuy.png-02f4a1ba0f67e389b5e6e02f7fee4c6c.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://Assets/PlaceHolders/FallGuy.png"
|
|
||||||
dest_files=["res://.godot/imported/FallGuy.png-02f4a1ba0f67e389b5e6e02f7fee4c6c.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
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
[gd_scene format=3 uid="uid://db1oeukux1376"]
|
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://xg0mu5mtpcgo" path="res://Assets/PlaceHolders/BuffMonk.png" id="1_g6sln"]
|
|
||||||
[ext_resource type="Script" uid="uid://dm8ytxk67ejef" path="res://Scenes/enemy_1.gd" id="1_s7od6"]
|
|
||||||
|
|
||||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_g6sln"]
|
|
||||||
|
|
||||||
[node name="Enemy1" type="CharacterBody2D" unique_id=1765361359]
|
|
||||||
script = ExtResource("1_s7od6")
|
|
||||||
|
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=93765061]
|
|
||||||
position = Vector2(22, -29)
|
|
||||||
scale = Vector2(0.3, 0.3)
|
|
||||||
texture = ExtResource("1_g6sln")
|
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1856443411]
|
|
||||||
scale = Vector2(6, 6)
|
|
||||||
shape = SubResource("CapsuleShape2D_g6sln")
|
|
||||||
|
|
||||||
[node name="DirectionTimer" type="Timer" parent="." unique_id=509704860]
|
|
||||||
autostart = true
|
|
||||||
|
|
||||||
[connection signal="timeout" from="DirectionTimer" to="." method="_on_timer_timeout"]
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
[gd_scene format=3 uid="uid://d3m22yqoyvo4t"]
|
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://b448mpav6ek52" path="res://Scenes/arena_game_manager.tscn" id="1_0tjoe"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://db1oeukux1376" path="res://Scenes/Enemy1.tscn" id="2_pddb8"]
|
|
||||||
|
|
||||||
[node name="MapTest" type="Node2D" unique_id=2115555896]
|
|
||||||
|
|
||||||
[node name="ArenaGameManager" parent="." unique_id=1024187604 instance=ExtResource("1_0tjoe")]
|
|
||||||
|
|
||||||
[node name="Enemy1" parent="." unique_id=1765361359 instance=ExtResource("2_pddb8")]
|
|
||||||
position = Vector2(379, 168)
|
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
extends CharacterBody2D
|
|
||||||
|
|
||||||
class_name Enemy1
|
|
||||||
enum States
|
|
||||||
{
|
|
||||||
IDLE,
|
|
||||||
ROAM,
|
|
||||||
CHASE,
|
|
||||||
ATTACK,
|
|
||||||
TAKING_DAMMAGE,
|
|
||||||
DEAD
|
|
||||||
}
|
|
||||||
const max_distance = 750
|
|
||||||
const SPEED = 300.0
|
|
||||||
var is_enemy_chase: bool
|
|
||||||
|
|
||||||
var health = 100
|
|
||||||
var health_max = 100
|
|
||||||
var health_min = 0
|
|
||||||
|
|
||||||
var attack_dammage = 10
|
|
||||||
|
|
||||||
var dir: Vector2
|
|
||||||
var knockback = 200
|
|
||||||
var current_state = States.IDLE
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@onready var player: CharacterBody2D = get_tree().get_first_node_in_group("player")
|
|
||||||
|
|
||||||
func _on_timer_timeout() -> void:
|
|
||||||
$DirectionTimer.wait_time = chose([1,2,3])
|
|
||||||
if current_state !=States.CHASE:
|
|
||||||
dir = chose([Vector2.RIGHT, Vector2.LEFT])
|
|
||||||
|
|
||||||
func chose(array):
|
|
||||||
array.shuffle()
|
|
||||||
return array.front()
|
|
||||||
|
|
||||||
func wraparound():
|
|
||||||
var direction = global_position.direction_to(player.global_position)
|
|
||||||
global_position += direction * max_distance*2
|
|
||||||
|
|
||||||
|
|
||||||
func _process(delta: float) -> void:
|
|
||||||
look_at(player.global_position)
|
|
||||||
print(player.global_position)
|
|
||||||
var distance = global_position.distance_to(player.global_position)
|
|
||||||
if distance>max_distance:
|
|
||||||
wraparound()
|
|
||||||
|
|
||||||
|
|
||||||
"""
|
|
||||||
if (global_position.x-player.global_position.x)>600:#player to the right
|
|
||||||
global_position.x=player.global_position.x-600#move right
|
|
||||||
elif(global_position.x-player.global_position.x)<-600:#player to the left
|
|
||||||
global_position.x=player.global_position.x+600#move left
|
|
||||||
|
|
||||||
if (global_position.y-player.global_position.y)>600:#player to the up
|
|
||||||
global_position.y=player.global_position.y-600#move up
|
|
||||||
elif(global_position.y-player.global_position.y)<-600:#player to the down
|
|
||||||
global_position.y=player.global_position.y+600#move down
|
|
||||||
"""
|
|
||||||
"""
|
|
||||||
func _physics_process(delta: float) -> void:
|
|
||||||
# Add the gravity.
|
|
||||||
if not is_on_floor():
|
|
||||||
velocity += get_gravity() * delta
|
|
||||||
# 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()
|
|
||||||
"""
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://dm8ytxk67ejef
|
|
||||||
@@ -1,11 +1,7 @@
|
|||||||
[gd_scene format=3 uid="uid://du7hapc7kscm6"]
|
[gd_scene format=3 uid="uid://du7hapc7kscm6"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://b448mpav6ek52" path="res://Scenes/arena_game_manager.tscn" id="1_ebmjs"]
|
[ext_resource type="PackedScene" uid="uid://b448mpav6ek52" path="res://Scenes/arena_game_manager.tscn" id="1_ebmjs"]
|
||||||
[ext_resource type="PackedScene" uid="uid://db1oeukux1376" path="res://Scenes/Enemy1.tscn" id="2_qxrlw"]
|
|
||||||
|
|
||||||
[node name="Game" type="Node2D" unique_id=850692785]
|
[node name="Game" type="Node2D" unique_id=850692785]
|
||||||
|
|
||||||
[node name="ArenaGameManager" parent="." unique_id=1024187604 instance=ExtResource("1_ebmjs")]
|
[node name="ArenaGameManager" parent="." unique_id=1024187604 instance=ExtResource("1_ebmjs")]
|
||||||
|
|
||||||
[node name="Enemy1" parent="." unique_id=1765361359 instance=ExtResource("2_qxrlw")]
|
|
||||||
position = Vector2(297, 101)
|
|
||||||
|
|||||||
@@ -2,31 +2,16 @@
|
|||||||
|
|
||||||
[ext_resource type="Script" uid="uid://bah031ailk0ha" path="res://Scenes/player.gd" id="1_cvnsp"]
|
[ext_resource type="Script" uid="uid://bah031ailk0ha" path="res://Scenes/player.gd" id="1_cvnsp"]
|
||||||
[ext_resource type="Texture2D" uid="uid://g0m835iol4mp" path="res://Assets/PlaceHolders/Screenshot 2024-11-24 210808.png" id="1_v0iea"]
|
[ext_resource type="Texture2D" uid="uid://g0m835iol4mp" path="res://Assets/PlaceHolders/Screenshot 2024-11-24 210808.png" id="1_v0iea"]
|
||||||
[ext_resource type="Texture2D" uid="uid://bcmuqd6p3jhdw" path="res://Assets/PlaceHolders/Elmo.png" id="3_6t5aa"]
|
|
||||||
|
|
||||||
[sub_resource type="CircleShape2D" id="CircleShape2D_v0iea"]
|
[sub_resource type="CircleShape2D" id="CircleShape2D_v0iea"]
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_6t5aa"]
|
[node name="CharacterBody2D" type="CharacterBody2D" unique_id=1419412180]
|
||||||
|
|
||||||
[node name="Player" type="CharacterBody2D" unique_id=1419412180 groups=["player"]]
|
|
||||||
script = ExtResource("1_cvnsp")
|
script = ExtResource("1_cvnsp")
|
||||||
|
|
||||||
[node name="Body" type="Sprite2D" parent="." unique_id=719417979]
|
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=719417979]
|
||||||
scale = Vector2(0.114894986, 0.11449075)
|
scale = Vector2(0.114894986, 0.11449075)
|
||||||
texture = ExtResource("1_v0iea")
|
texture = ExtResource("1_v0iea")
|
||||||
|
|
||||||
[node name="BodyColision" type="CollisionShape2D" parent="." unique_id=1477808378]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1477808378]
|
||||||
scale = Vector2(4.2653956, 4.2653956)
|
scale = Vector2(4.2653956, 4.2653956)
|
||||||
shape = SubResource("CircleShape2D_v0iea")
|
shape = SubResource("CircleShape2D_v0iea")
|
||||||
|
|
||||||
[node name="Shield" type="Sprite2D" parent="." unique_id=212386399]
|
|
||||||
position = Vector2(0, -50)
|
|
||||||
rotation = 1.5707964
|
|
||||||
scale = Vector2(0.15, 0.15)
|
|
||||||
texture = ExtResource("3_6t5aa")
|
|
||||||
|
|
||||||
[node name="ShieldColision" type="CollisionShape2D" parent="." unique_id=948717563]
|
|
||||||
position = Vector2(0, -50)
|
|
||||||
rotation = 1.5707964
|
|
||||||
scale = Vector2(2.5, 6)
|
|
||||||
shape = SubResource("RectangleShape2D_6t5aa")
|
|
||||||
|
|||||||
@@ -15,10 +15,6 @@ run/main_scene="uid://du7hapc7kscm6"
|
|||||||
config/features=PackedStringArray("4.6", "Forward Plus")
|
config/features=PackedStringArray("4.6", "Forward Plus")
|
||||||
config/icon="res://icon.svg"
|
config/icon="res://icon.svg"
|
||||||
|
|
||||||
[global_group]
|
|
||||||
|
|
||||||
player="Making this for an easy reference to the player in the enemies code"
|
|
||||||
|
|
||||||
[input]
|
[input]
|
||||||
|
|
||||||
move_up={
|
move_up={
|
||||||
|
|||||||
Reference in New Issue
Block a user