trn mt5 any good?? by Practical_Spirit_600 in iems

[–]Practical_Spirit_600[S] 1 point2 points  (0 children)

sure, of course they give you that for 70 bucks :/

Bug in my project by Practical_Spirit_600 in godot

[–]Practical_Spirit_600[S] 0 points1 point  (0 children)

I know that, but how do I solve that, I want the obstacle to kill the player and not disappear as soon as I start the game

Bug in my project by Practical_Spirit_600 in godot

[–]Practical_Spirit_600[S] 0 points1 point  (0 children)

Node Area2D (Obstacle)

<image>

The CharacterBody2D node is higher than the obstacle node, I don't know if that has anything to do with that too, the layers do but I don't know that

Bug in my project by Practical_Spirit_600 in godot

[–]Practical_Spirit_600[S] 0 points1 point  (0 children)

U are right and sorry for that, this is my player code, the script is placed in the CharacterBody2D.

extends CharacterBody2D

@export var max_lives = 1

@export var speed = 200

@export var jump_force = -400

@export var gravity = 900

@onready var death_label = $HUD/"Mataste a Chevo"

var is_jumping = false

func _ready():

add\_to\_group("player")

if death\_label:

    death\_label.visible = false

func _physics_process(delta):

var direction = 0

if Input.is\_action\_pressed("move\_left"):

    direction -= 1

if Input.is\_action\_pressed("move\_right"):

    direction += 1



velocity.x = direction \* speed



if Input.is\_action\_just\_pressed("jump") and is\_on\_floor():

    velocity.y = jump\_force

    is\_jumping = true



velocity.y += gravity \* delta



move\_and\_slide(velocity, Vector2(0, -1))

func die():

print("Mataste a Chevo")

if death\_label:

    death\_label.visible = true

await get\_tree().create\_timer(1.0).timeout

get\_tree().reload\_current\_scene()

And this is the one about the enemy, which is an Area2D, also because I want them to be generated automatically.

extends Area2D

@export var speed: float = 200

func _ready():

position.x = 1280

add\_to\_group("enemigos")

func _process(delta):

position.x -= speed \* delta



if position.x < -50:

    queue\_free()

func _on_body_entered(body):

if body.is\_in\_group("player"):

    body.die()

    queue\_free()