Installa Steam
Accedi
|
Lingua
简体中文 (cinese semplificato)
繁體中文 (cinese tradizionale)
日本語 (giapponese)
한국어 (coreano)
ไทย (tailandese)
Български (bulgaro)
Čeština (ceco)
Dansk (danese)
Deutsch (tedesco)
English (inglese)
Español - España (spagnolo - Spagna)
Español - Latinoamérica (spagnolo dell'America Latina)
Ελληνικά (greco)
Français (francese)
Indonesiano
Magyar (ungherese)
Nederlands (olandese)
Norsk (norvegese)
Polski (polacco)
Português (portoghese - Portogallo)
Português - Brasil (portoghese brasiliano)
Română (rumeno)
Русский (russo)
Suomi (finlandese)
Svenska (svedese)
Türkçe (turco)
Tiếng Việt (vietnamita)
Українська (ucraino)
Segnala un problema nella traduzione
Let's assume this your sprite size is (a, b) and you flip it with your method, it will be (-b, b) and when you flip it again it will still be (-b, b)
You should do it like this
2. your signal connection seem broken, try reconnect it.
3. $Sprite is same as get_node("Sprite"), it is search for direct child node with name "Sprite" of this node. I don't know how you store your Area2d node and Sprite node, you might want try to access parent first
- Enemy (Node2d)
-- Sprite
-- Area2d
--- CollisionShape2d
)
4. global_position return position of Node2d
Note; I am not insult you or something, but I think you should learn more about basic Godot, basic programming (non Godot) and basic game dev. Prefer you to learn from videos not text for now and do along the videos. Good luck
You're doing:
So your width becomes your negative height.
Assuming default values, you went from (1.0, 1.0, 1.0) to (-1.0, 1.0, 1.0)... so the first time, it would seem like it worked.
But then when you run that code again and nothing happens. Because scale.y was never changed, so the negative of it is still -1.0, so scale.x will still become -1.0, not 1.0 like you'd want to.
You just need to do:
Can't connect signal because method is now not found and can't find node in question.
About 4, since you said thing about no existence of coor or coordinate, so I point out proper name of that method.