0 votes

Hello! I've made my first game in Postgres and am so far in love with the engine. I've made a simple catching game which follows the mouse and have gone and exported it to my Reactjs web app it works like a charm - whilst scuffed I'm very proud of it!

A site feature I wanted to make is the following: after finishing the game (it is playable once per day) the game should first send the score information the user got and send it to my express backend (which deals with other parts of my site that use a DB) where the information would be stored in the database and later posted on another site. Is there a way to do this? Or to perhaps directly send the score result to Postgres?

I've found https://github.com/Marzin-bot/PostgreSQLClient however as I'm a complete begginer in both React, Postgres and Godot - who follows and combines examples to create what he wants I am uncertain as to how to use this library within my Postgres. Is there a better solution perhaps?
Thank you in advance!

Godot version Godot 3.3.2
in Engine by (27 points)

1 Answer

+1 vote

Hi.
I would assume you wrote your first game in godot and not in postgres!?

Anyway. A simple http GET call to the express backend with paramters in the url should do the trick.
https://docs.godotengine.org/en/stable/tutorials/networking/http_request_class.html

There is no need to directly communicate with the database.

by (4,088 points)

Oh yeah in Godot obviously! Didn't notice the mistake till you pointed it out, perhaps the next solo project is making a game in a database? :D
Anyways thank you! I'll give it a go and see what I can do with them.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.