lopodyr 🎸

22 Followers
4 Following
62 Posts
moosic maker, illustrator and game developer of municipal fame.
PronounsHe/Him
Websitehttps://lopodyr.com
@syntaxseed When people say "the economy is doing great" they mean "money" is doing great.

@Natanox

Please please please check documentation for actual syntax and appropriate calling of functions. I wrote this on my phone super quickly.

Check the docs for Custom Signals, as well as functions emit() and connect()

Hopefully the logic makes some sense. It has been working great for me!

Hope that helps!

@Natanox
Example fake code - 2/2

Script on Manager:

signal score_changed
var score:int = 0

coin_collected(score_increase):
score += score_increase
score_changed().emit(score)

Script on Score_UI:

_ready():
Manager.score_changed().connect(update_score(score))

update_score(score):
text = score

@Natanox
Example fake code - 1/2

This example code increases a global score value by one (1) every time a coin is collected. Then, it updates the UI counter accordingly.

- « Manager Â» is autoloaded
- An instance of « Coin Â» is loaded every time an enemy dies
- « Score_UI Â» is a Label2D on the main scene

Script on Coin:

var score_increase: int = 1

_whatever_you_use_to_check_collisions():
when_collected()

when_collected():
Manager.coin_collected(score_increase)

@Natanox
Functions on autoloads can be called from any scene in the Scene Tree. Like:

AutoloadName.a_function_inside_the_autoload_script()

You can pass variables to the autoload in the parenthesis.

The Autoload however should send signals to trigger functions in other scenes. These target scenes should call the connect() function inside of their _ready() function.

When using connect(), you need to tell the code which function in the scene is called every time the signal is emitted.

@couchchilis if your engine supports building to Linux x86_64, you can just run the Linux executable in the Deck’s desktop environment. You can even add it to your Steam library to play it from Gaming Mode
@doomski it gives it a fun pachinko machine look :D
@raccoonformality clicking sticks are an abomination. Followed closely by mapping timing sensitive input on analog triggers.

@raccoonformality True story: I love to give my games 3D+Pixel art artstyles (think PS1 or NDS, not "HD2D").

So, I almost always run them at multiples of standard modern resolutions to give them pixel perfect low res.

It makes it look authentic, but also runs smoothly everywhere. If the aesthetics give you the option, I think it's a great choice.

Dunno who needs to hear this but:

Game dev articles a lot of times say "nobody wants to play this kind of game anymore" or "we have to do it this way now because," and

just ignore those bits. They're talking about AAA, if not F2P gamers, and seriously: who cares?

Make games for YOUR audience.

#GameDev