Howdy! This is my first time making a game without a tutorial and yesterday I spent the entire day trying to work out the basic flow of my game, but I kept overthinking it. I am just wondering if what I came up with is a reasonable and efficient way to do what I am trying to do.
The game idea is basically Lara Croft GO and Hitman GO, but it’ll be 2-D. If you aren’t aware, it’s a puzzle game where you need to make it to the end gate, but enemies are in your path. The only way to get past them is to attack them from behind, get them to kill each other, or kill them with the environment. When the player makes their one movement, the enemies will respond by doing nothing, or if the player is in their line of sight, they’ll move/attack. I would also like environmental variables like flowing water, rolling boulders, or traps to move next. Then it loops back to the player’s turn if they’re alive.
extends Node
var my_turn : bool = true
func _process(delta):
if Input.is_action_just_pressed("ui_right") and my_turn:
player_turn()
func player_turn():
print("I took my turn")
my_turn = false
turn_cycle()
func turn_cycle(): #This outlines everything else that gets to happen after the player has made their move
enemy_turn()
environment_turn()
#after everything has gone, it is now the player's turn again
my_turn = true
func enemy_turn():
print("enemy took their turn")
func environment_turn():
print("environment did their thing")
I’m sad to say that this took over 8 hours to come up with. I started small and simple, but when I Googled my problem, I was convinced I needed a TurnQueue. I made an array and put the children in it, then I got stuck when I found out yeild was deprecated, then I tried using await, then I tried signals. Once I remembered that the order will never changed, I scrapped the array and TurnQueue idea. Moral of the story is KISS.