Godot Version
4.6.2 stable
Question
Hey folks, I’m very new to Godot and programming but have encountered an issue/ bug that I couldn’t find a solid answer to. I’m making a flappy bird clone. I’m looking for an answer to why the software does this, not so much as a fix (although that would also be nice).
The issue: I have my main scene set as so:
extends Node2D
var score
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
new_game()
func new_game():
score = 0
$Control/Popup.hide()
func game_over():
$Control/Score/ScoreTimer.stop()
$Control/GameOver.visible = true
$Control/Popup.show()
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(_delta: float) -> void:
$Control/Score.text = str(score)
# For resetting the game
func _on_button_pressed() -> void:
print("button pressed")
$Control/GameOver.visible = false
get_tree().reload_current_scene()
func _on_score_timer_timeout() -> void:
score += 1
func _on_hurdle_game_over() -> void:
game_over()
and a separate .tscn called Wall that is an incredibly simple Area2D node with a sprite and collisionn2D.
When I start up my game in both F5 and F6 mode it returns ‘wall entered’ immediately. Even though I’ve taken care to keep the collision2D in Wall scaled properly and zero-ed.
It’s an issue because, as per Flappy Bird, the moment you contact a collider the game stops, resets, and you play again. I’ve remade this issue twice now so something is up. I’ll most likely restart the game since it’s so small scale but want to have reference to this issue. I’m curious why this is and how to fix it! There was a post that kinda had the same problem from 2024 but the fix worked around this issue entirely, hoping that this is such a small game this can provide a clear view of the issue.
Thank you for your time.
-Themesong


