ConditionalCoder

20 Followers
3 Following
161 Posts

Something I find helpful when developing a game: write down ideas/improvements you have in a todo list, rather than implementing them straight away. That way you won't lose track of what you're currently working on, and won't end up refactoring your game part-way through adding a new feature.

#BeenThereDoneThat #GameDev

#Godot's `wrap()` function is useful for when you have a list of players (e.g. blue, green, red, etc.) and you want to change whose turn it is:

```
# Next player's turn.
current_player = wrap(current_player + 1, 0, PLAYERS.size())
```

https://docs.godotengine.org/en/stable/classes/[email protected]#class-globalscope-method-wrap

#Godot4 #GDScript #GameDev #Programming

@GlobalScope

Global scope constants and functions. Description: A list of global scope enumerated constants and built-in functions. This is all that resides in the globals, constants regarding error codes, keyc...

Godot Engine documentation

Anyone else annoyed by how many constants/variables they have to create just to avoid having magic numbers in their code...?

#GameDev #Porgramming #Godot #Godot4 #GDScript

Is there a better way to write the following?

```
var piece = get_piece_on_marker(marker)
if piece:
piece.move()
```

Something like:

```
if (piece = get_piece_on_marker(marker)):
piece.move()
```

i.e. It assigns the variable, and tests it, all on the same line. Is something like that possible in #Godot?

#GDScript #Godot4 #GameDev

Add "Ignore Comments" option to Find & Replace by nonunknown · Pull Request #67796 · godotengine/godot

This PR add a new checkbox to find tool to allow ignoring comments 2022-10-24.08-33-17.mp4

GitHub

I wish there were a way to filter searches in #Godot's code editor to matches that aren't in a comment...

#Godot4 #GDScript #GameDev #FOSS

It kinda feels weird adding a signal to my global script (#autoload), as I've always heard the phrase "Call down, signal up", and a global script feels like it is (should be) at the top of the tree. So it should call down to everything else, right?

But really it's a sibling to the root node, so it can't really call down. Sending a signal that other nodes can connect to when something changes instead makes more sense.

#Godot #Godot4 #GDScript #GameDev

My board game's coming along! Haven't coded any win logic yet, so pieces just move around and try to capture each other for fun.

Captured pieces get sent back to their base and are locked (so need to roll a 6 to re-enter the game). Two of a player's pieces on the same tile create a blockage that other pieces cannot pass (or capture).

I have various ideas for different game modes: last man standing, capture the flag, jailbreak, etc. And various maps too.

#GameDev #Godot #Godot4

Exclude files from git revision without adding to .gitignore

Exclude files from git revision without adding them to .gitignore

Gourav Goyal

Is there a way in #git to prevent a file being added to the repo, but without listing it in `.gitignore`?

Currently I'm just adding all files each commit except one particular one, but it's tedious and I have to remember not to just do `git add .`

#VersionControl #Repository