Merge branch 'main' of github.com:MarcEricMartel/Game-Jam-A23
This commit is contained in:
commit
be7dc157d5
@ -11,25 +11,25 @@
|
||||
[node name="Decor" type="Node2D" parent="."]
|
||||
|
||||
[node name="Candles" parent="Decor" instance=ExtResource("2_o33c4")]
|
||||
position = Vector2(160, 416)
|
||||
position = Vector2(160, 384)
|
||||
|
||||
[node name="Candles2" parent="Decor" instance=ExtResource("2_o33c4")]
|
||||
position = Vector2(160, 160)
|
||||
position = Vector2(160, 128)
|
||||
|
||||
[node name="Candles3" parent="Decor" instance=ExtResource("2_o33c4")]
|
||||
position = Vector2(797.153, 158.518)
|
||||
position = Vector2(800, 128)
|
||||
|
||||
[node name="Candles4" parent="Decor" instance=ExtResource("2_o33c4")]
|
||||
position = Vector2(800.365, 417.055)
|
||||
position = Vector2(800, 384)
|
||||
|
||||
[node name="Candle" parent="Decor" instance=ExtResource("2_5hdq4")]
|
||||
position = Vector2(432, 256)
|
||||
position = Vector2(432, 224)
|
||||
|
||||
[node name="Candle2" parent="Decor" instance=ExtResource("2_5hdq4")]
|
||||
position = Vector2(432, 352)
|
||||
position = Vector2(432, 320)
|
||||
|
||||
[node name="Candle3" parent="Decor" instance=ExtResource("2_5hdq4")]
|
||||
position = Vector2(528, 256)
|
||||
position = Vector2(528, 224)
|
||||
|
||||
[node name="Candle4" parent="Decor" instance=ExtResource("2_5hdq4")]
|
||||
position = Vector2(528, 352)
|
||||
position = Vector2(528, 320)
|
||||
|
@ -11,10 +11,13 @@
|
||||
[node name="Decor" type="Node2D" parent="."]
|
||||
|
||||
[node name="Enemy" parent="." instance=ExtResource("2_ftshv")]
|
||||
position = Vector2(441, 312)
|
||||
position = Vector2(497, 324)
|
||||
|
||||
[node name="BatSpawnable" parent="." instance=ExtResource("3_a1ucf")]
|
||||
position = Vector2(62, 122)
|
||||
position = Vector2(248, 225)
|
||||
motion_mode = 0
|
||||
|
||||
|
||||
[node name="BatSpawnable2" parent="." instance=ExtResource("3_a1ucf")]
|
||||
position = Vector2(644, 251)
|
||||
motion_mode = 0
|
||||
|
@ -1,4 +1,4 @@
|
||||
extends AITemplate
|
||||
|
||||
func getDirection(position, enemyPosition) -> Vector2:
|
||||
return Vector2(enemyPosition - position).normalized()
|
||||
func getDirection(_position, _enemyPosition) -> Vector2:
|
||||
return Vector2(_enemyPosition - _position).normalized()
|
||||
|
@ -1,5 +1,5 @@
|
||||
class_name AITemplate
|
||||
extends Node
|
||||
|
||||
func getDirection(position, enemyPosition) -> Vector2:
|
||||
func getDirection(_position, _enemyPosition) -> Vector2:
|
||||
return Vector2.ZERO
|
||||
|
@ -8,10 +8,12 @@ const ATTACK_COOLDOWN : float = 100
|
||||
@export var speed : float = 0
|
||||
@export var damage : int = 0
|
||||
@export var priority : int = 0
|
||||
@export var expReward : int = 0
|
||||
@export var cost : int = 0
|
||||
@export var minSpawnRange : float = 0
|
||||
@export var canAttack : bool = true
|
||||
|
||||
|
||||
@onready var ai : Node = $AI
|
||||
@onready var animatedSprite : AnimatedSprite2D = $AnimatedSprite2D
|
||||
@onready var attackArea : Area2D = $AttackArea
|
||||
@ -41,10 +43,12 @@ func _process(delta):
|
||||
|
||||
if !isFacingLeft && direction.x < 0:
|
||||
isFacingLeft = true
|
||||
scale = Vector2(-1, 1)
|
||||
scale.x = -1
|
||||
scale.y = 1
|
||||
elif isFacingLeft && direction.x > 0:
|
||||
isFacingLeft = false
|
||||
scale = Vector2(1, 1)
|
||||
scale.x = -1
|
||||
scale.y = -1
|
||||
|
||||
velocity = direction * speed * delta
|
||||
move_and_slide()
|
||||
@ -54,7 +58,6 @@ func _process(delta):
|
||||
cooldown = 0
|
||||
else:
|
||||
cooldown -= attackSpeed * delta
|
||||
|
||||
attemptAttack()
|
||||
|
||||
func attemptAttack():
|
||||
@ -71,6 +74,7 @@ func attack():
|
||||
|
||||
func endAttack():
|
||||
damageCollision.disabled = true
|
||||
animatedSprite.disconnect("animation_finished", endAttack)
|
||||
animatedSprite.play("default")
|
||||
|
||||
func receive_damage(dmg):
|
||||
@ -104,4 +108,4 @@ func clean():
|
||||
|
||||
func _on_damage_area_body_entered(body):
|
||||
if body == enemy:
|
||||
enemy.receive_damage(damage)
|
||||
body.receive_damage(damage)
|
||||
|
@ -233,6 +233,7 @@ radius = 8.0
|
||||
[node name="TemplateSpawnable" type="CharacterBody2D"]
|
||||
collision_layer = 6
|
||||
collision_mask = 6
|
||||
motion_mode = 1
|
||||
script = ExtResource("1_rkej7")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
|
File diff suppressed because one or more lines are too long
@ -22,6 +22,41 @@ window/size/viewport_height=540
|
||||
window/size/resizable=false
|
||||
window/stretch/mode="viewport"
|
||||
|
||||
[input]
|
||||
|
||||
ui_left={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194319,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null)
|
||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":-1.0,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194319,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
ui_right={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194321,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null)
|
||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":1.0,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194321,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
ui_up={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194320,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":11,"pressure":0.0,"pressed":false,"script":null)
|
||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":-1.0,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194320,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
ui_down={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194322,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null)
|
||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":1.0,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194322,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[rendering]
|
||||
|
||||
textures/canvas_textures/default_texture_filter=0
|
||||
|
Loading…
Reference in New Issue
Block a user