diff --git a/README.md b/README.md index c2736cb..554167e 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/scenes/fight.tscn b/scenes/fight.tscn index 15d4d11..9653d59 100644 --- a/scenes/fight.tscn +++ b/scenes/fight.tscn @@ -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"] diff --git a/script/build.py b/script/build.py new file mode 100644 index 0000000..9ac5916 --- /dev/null +++ b/script/build.py @@ -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() \ No newline at end of file diff --git a/script/Player.gd b/scripts/Player.gd similarity index 100% rename from script/Player.gd rename to scripts/Player.gd