Introduction
Want to create a game with a robust backend but hate complex setups? HyperShip’s WordPress plugin turns your WordPress site into a Backend-as-a-Service (BaaS), letting you define custom API endpoints and data types with ease. In this tutorial, we’ll build a simple game backend for a Godot/Redot-based 2D RPG.
Prerequisites
- WordPress site with HyperShip plugin installed
- Godot/Redot Engine
- Basic PHP and WordPress knowledge
Step 1: Install HyperShip
- Download the HyperShip plugin from GitHub.
- Upload and activate it in your WordPress admin panel.
- Navigate to the HyperShip dashboard to create your first app.
Step 2: Define Data Types with ACF
- Install the Advanced Custom Fields (ACF) plugin.
- Create a field group for your game (e.g., “Player Data” with fields like username, score, level).
- Enable “Show in REST API” in ACF settings.
- Add the types in the App Dashboart (TODO: make this better)
Step 3: Create a Custom API Endpoint
- In the HyperShip dashboard, select your app and add a new endpoint (e.g., /players).
- Write PHP code to fetch player data:
$players = get_posts([
'post_type' => 'hypership-app',
'numberposts' => -1,
'post_status' => 'publish'
]);
$data = [];
foreach ($players as $player) {
$data[] = get_fields($player->ID);
}
return rest_ensure_response($data);
- Test the endpoint at yoursite.com/wp-json/hypership/v1/players.
Step 4: Connect to Godot/Redot
- In Godot, use the HTTPRequest node to fetch data from your endpoint.
- Parse the JSON response to display player scores.
Conclusion
With HyperShip, you’ve created a game backend in under an hour! Join our Discord community to share your project and get feedback.
Want to try it? Download HyperShip free on GitHub or get a managed server for $17/month.