Life isn’t about finding yourself. Life is about creating yourself.
― George Bernard Shaw
- Description
- Development Platform
- Software Development
- Platform Tested
- Screenshots
- Chronology of Development Events
- Buy Me a Coffee
- Changelog
- License
- Feedback and Suggestions
Space Invaders Godot 4 code generated by Qwen3.7-plus AI that interfaces with a Raspberry Pi Pico W joystick through WiFi.
The program runs on Raspberry Pi Pico W (WiFi Joystick) and Raspberry Pi 5 with Godot 4 (Space Invaders).
Program code is generated for Godot 4 using GDScript.
I started prompt coding in the morning of 11th June 2026.
It took me quite a few days to complete this.
Qwen3.7-plus generated the Godot code but it has quite a number of major bugs and missing features I wanted.
Ended up I have to debug using DeepSeek as Qwen3.7-plus was unable to fix its own bug.
I have tested on Raspberry Pi Pico W and Raspberry Pi 5 with Godot 4.
On the Raspberry Pi Pico W:
- Do ensure that the Raspberry Pi Pico W is flashed with the correct *.uf2 file
- The RPI_PICO_W-20251209-v1.27.0.uf2 file can be downloaded from resource/Pi Pico W Joystick Godot/ folder in this repository.
- Open Thonny and upload all the files in the repository folder resource/Pi Pico W Joystick Godot/ onto Raspberry Pi Pico W. Program is using MicroPython.
- Open the file Pico_W_Joystick_WiFi_Godot.py. Make sure you update the code with your Wifi SSID, password and Raspberry Pi 5 IP.
# WiFi Configuration - UPDATE THESE
WIFI_SSID = "YOUR_WIFI_SSID"
WIFI_PASSWORD = "YOUR_WIFI_PASSWORD"
# Godot UDP Configuration
GODOT_IP = "192.168.0.23" # Replace with your computer/Godot IP address- Run Pico_W_Joystick_WiFi_Godot.py. The following output will be displayed in the Thonny run window.
Note: You can rename Pico_W_Joystick_WiFi_Godot.py to main.py so that the program will automatically run when Raspberry Pi Pico W power up.
>>> %Run -c $EDITOR_CONTENT
MPY: soft reboot
==================================================
PICO W JOYSTICK - DIRECT TO GODOT
==================================================
Connecting to WiFi: chanhome 2.4GHz
Connecting... 14s left
Connecting... 13s left
Connecting... 12s left
Connecting... 11s left
✓ WiFi connected! IP: 192.168.0.19
✓ UDP socket created
Sending directly to Godot at 192.168.0.23:9000
✓ Ready! Sending joystick data directly to Godot...
Press Ctrl+C to stop
[5] X= 77% (50844), Y= 77% (50860), Button=Released
[10] X= 77% (50812), Y= 77% (50844), Button=Released
[15] X= 77% (50764), Y= 77% (50876), Button=Released
[20] X= 77% (50860), Y= 77% (50844), Button=Released
[25] X= 77% (50844), Y= 77% (50876), Button=Released
[30] X= 77% (50780), Y= 77% (50844), Button=Released
[35] X= 77% (50796), Y= 77% (50796), Button=Released
[40] X= 77% (50796), Y= 77% (50828), Button=Released
[45] X= 77% (50700), Y= 84% (55309), Button=Released
[50] X= 77% (50764), Y= 77% (50924), Button=Pressed
[55] X= 77% (50780), Y= 77% (51020), Button=Pressed
[60] X= 77% (50764), Y= 77% (50860), Button=Pressed
[65] X= 28% (18372), Y= 77% (50732), Button=Released
[70] X= 77% (50796), Y= 80% (52844), Button=Released
[75] X= 77% (50892), Y=100% (65535), Button=Pressed
[80] X= 77% (50764), Y= 78% (51260), Button=Released
[85] X= 77% (50764), Y= 77% (50956), Button=Released
[90] X= 77% (50716), Y= 81% (53277), Button=Pressed
- Raspberry Pi Pico W is now ready and transmitting the Joystick movement data to Raspberry Pi 5.
On the Raspberry Pi 5:
- Git clone all the files in the repository folder onto Raspberry Pi 5 /home/user/GodotProject/ folder. Program is using Godot 4.
- Open the project space-invaders-godot.
- Run code.
Godot 4 code is generated by Qwen3.7-plus AI using the following prompt:
Can you generate code for space invaders game that runs on
Godot game engine that is running on Raspberry Pi 5?
You can refer to the repository:
https://github.com/chanlhock/Space-Invader-with-Pi-Pico-W-Bluetooth-Joystick.git.
You can refer to the Raspberry Pi 5 Python code on how to
communicate with the Raspberry Pi Pico W WiFi and also code
reference on Space Invaders game using Pygame to port to Godot.
Make use of the resources for sound, sprite , etc. in the repository
for your reference. I have sprite spacesprite.png file for invader
and ship.png for space ship. There is no sprite for the laser.
Follow the repository to support WiFi UDP communication with the
Raspberry Pi Pico W WiFi joystick.
Attached are also the screen shots for the splash startup screen,
main game screen and game end screen.
Can you let me know the steps to create the Godot project and
how to setup the code, sprite, sound, etc since I am not
familiar with Godot 4 interface.
Sprite image and sound file obtained from this webside: (https://joecode22.itch.io/space-invaders)
I have tested my code on:
- Raspberry Pi Pico W together with Raspberry Pi 5 running Godot 4.
Splashscreen searching for joystick:
Splashscreen joystick found: Splashscreen joystick not found, switch to keyboard mode: Game screen player firing at invaders: Game screen player fired nnd moved: Game over screen, player loss: Player win game screen:- 11th June 2026: Installation for Godot 4 was very easy on Raspberry Pi 5 using Pi Apps. Started prompt codng of Godot 4 codes using Qwen3.7-plus AI.
- 14th June 2026: Used Qwen3.7-plus to generate the game to run on Godot game engine. The code didn't work first time right, to certain extent it has a lot of bugs and missing features. Prompted it to fix the bugs but there are some bugs after many prompts still unable to fix. Used Github Claude instead to prompt it to fix the bug, voila Github Claude was able to do so. I find that Qwen3.7-plus is not as good as DeepSeek that I used previously to generate the same game in Pygame. Qwen3.7-plus needs another AI to find out itd bugs, it is unable to fix its own shit (bugs). Subsequently I used DeepSeek to fix all the bugs including converting the Pi Pico W existing Bluetooth Joystick code to WiFi UDP communication.
- 15th June 2026: Continue to fix bugs using DeepSeek. Finally completed the Space Invader game on Godot!
If you appreciate my work, do support me by...
This program is licensed under the GNU General Public License v3.0
Permissions of this strong copyleft license are conditioned on making
available complete source code of licensed works and modifications,
which include larger works using a licensed work, under the same
license. Copyright and license notices must be preserved. Contributors
provide an express grant of patent rights.
See the GNU General Public License for more details.
For any feedback or suggestions, feel free to contact me via email:
📧 chanlhock@gmail.com 🐭







