Skip to content

Commit

Permalink
add build.py
Browse files Browse the repository at this point in the history
  • Loading branch information
limuy2022 committed Jun 1, 2024
1 parent d8163ae commit 2c61a83
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Zenith

## Environment
A indie fan game developed in godot engine

## Build Guide

Godot 4.2.2

Because of the godot extensions of Rust and Cpp,you should make sure that the rust and cpp compiler have been installed.

Then you can run ```python script/build.py``` to build the extension (both Debug and Release)

Finally,you can start godot editor and develop or export the game.
2 changes: 1 addition & 1 deletion scenes/fight.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[ext_resource type="Script" path="res://scripts/fight.gd" id="1_fov6f"]
[ext_resource type="Texture2D" uid="uid://cqp3l8q7xbxrt" path="res://resources/images/weapons/Zenith.webp" id="3_2spkb"]
[ext_resource type="Script" path="res://script/Player.gd" id="3_6nc6b"]
[ext_resource type="Script" path="res://scripts/Player.gd" id="3_6nc6b"]
[ext_resource type="PackedScene" uid="uid://dn2ixin15jtt3" path="res://scenes/weapons/star_wrath.tscn" id="4_8ipx5"]

[node name="Fight" type="Control"]
Expand Down
18 changes: 18 additions & 0 deletions script/build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import os

def msg_system(cmd, error_msg):
if os.system(cmd) != 0:
print(error_msg)
exit(1)

def main():
# build rust extension
os.chdir("../gdrust")
msg_system("cargo build", "Failed to build rust extension in debug mode")
msg_system("cargo build --release", "Failed to build rust extension in release mode")
os.chdir("..")
print("Rust extension compilation is success")
print("Build success")

if __name__ == "__main__":
main()
File renamed without changes.

0 comments on commit 2c61a83

Please sign in to comment.