diff --git a/README.md b/README.md index c61c3ae..881077b 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,95 @@ A sample Godot game called "Sentry Jump". The updated demo project lives in the ![Screenshot](.github/screenshot.png) +## Getting Started (No Godot Experience Required) + +If you're new to Godot, follow these simple steps to run the demo: + +### Prerequisites + +- Download and install [Godot 4.5-dev4](https://godotengine.org/article/dev-snapshot-godot-4-5-dev-4/#downloads) or newer for your operating system +- Extract the Godot executable (Godot.app) to a location on your computer +- Clone this demo repo locally (`git clone git@github.com:sentry-demos/godot.git`) + +### Step 1: Open Godot + +1. Launch Godot from your downloaded location + +### Step 2: Import the Project + +1. In the Project Manager, click the **"Scan"** button (highlighted in the left panel) +2. In the file browser dialog that appears, navigate to the folder containing this project +3. Select/double-click the folder that contains `project.godot`, `README.md`, and the `src` folder +4. Click **"Select Current Folder"** to import the project + +![Godot Project Manager](screenshots/godot_open_project.png) + +![File Selection Dialog](screenshots/select_godot_folder.png) + +### Step 3: Open the Project + +1. Once imported, you'll see "Sentry Jump" appear in your project list +2. Select the "Sentry Jump" project (it will be highlighted) +3. Click **"Edit"** to open the project in the Godot editor + +![Project List with Sentry Jump Selected](screenshots/select_sentry_jump.png) + +### Step 4: Run the Game + +1. In the Godot editor, you'll see various panels and a 3D viewport +2. Look for the **Play button** (▶️) in the top-right corner of the editor +3. Click the **Play button** to start the game + +![Godot Editor with Play Button Highlighted](screenshots/start_sentry_jump_game.png) + +### Step 5: Play the Demo And Trigger a Runtime Error + +**Game Controls:** + +- **Arrow keys**: Move the character left/right +- **Spacebar**: Jump +- **F key**: Toggle fullscreen mode +- **R key**: Reset the scene + +**Objective:** Jump to the red flag on the right. When you reach it, the demo will intentionally cause a runtime error (not crash) to showcase Sentry's error reporting capabilities! + +**Note:** Most errors developers deal with in Godot are runtime non-crash errors. This is because the game logic is usually implemented in a scripting language, and 99% of the time errors don’t cause a crash. + +![Trigger Runtime Error](screenshots/gameplay_instructions_to_trigger_runtime_error.png) + +### (Optional) Step 6: Jump Into the Crash Zone to trigger a crash + +When the player jumps into the "Crash Zone," the game triggers a crash in the `C++` gamelogic library. This is meant to illustrate a crash connected to some native code. + +![Trigger crash](screenshots/gameplay_instructions_to_trigger_crash.png) + +### (Extremely Optional) Step 7: Fall off the platform to trigger another runtime error + +If the player goes off the platform and falls down, they reach the limits of the level, resulting in another runtime error. + +**Note:** (I'd skip this during a live demo. It's redundant since you already jumped to the flag to generate a runtime error, but you can do it if you want an additional runtime error for any reason) + +![Trigger crash](screenshots/fall_off_platform.png) + +### Troubleshooting + +- If you get import errors, ensure you're using Godot 4.5-dev4 or newer +- Make sure you're selecting the folder that contains `project.godot`, not a subfolder +- The game window may appear behind the editor - check your taskbar/dock + +## Advanced Usage + +### Automate the game without opening Godot Studio + +You can also run the game (and make the character jump to the flag) from the command line. This is used to generate bulk demo data, I recommend against running this in a live demo context. + +```bash +# On macOS +$ /Users/yourname/Downloads/Godot.app/Contents/MacOS/Godot --path /path/to/sentry-demos/godot/directory/you/cloned --automate +``` + +![automate flag](screenshots/automate.png) + ## Talk slides https://docs.google.com/presentation/d/1mU0HEeOpR0whLYLtfTzlbiIXN4wYUssLNChutvJAeJQ diff --git a/project.godot b/project.godot index 025217c..c36f164 100644 --- a/project.godot +++ b/project.godot @@ -64,5 +64,9 @@ options/debug_printing=1 options/configuration_script="uid://tltw6k221xjo" options/attach_screenshot=true options/attach_scene_tree=true +options/attach_log=true +options/environment="production" options/screenshot_level=3 logger/include_variables=true +options/logger_enabled=true +options/logger_include_source=true diff --git a/screenshots/automate.png b/screenshots/automate.png new file mode 100644 index 0000000..f9a9f26 Binary files /dev/null and b/screenshots/automate.png differ diff --git a/screenshots/fall_off_platform.png b/screenshots/fall_off_platform.png new file mode 100644 index 0000000..814df05 Binary files /dev/null and b/screenshots/fall_off_platform.png differ diff --git a/screenshots/gameplay_instructions_to_trigger_crash.png b/screenshots/gameplay_instructions_to_trigger_crash.png new file mode 100644 index 0000000..9214bdc Binary files /dev/null and b/screenshots/gameplay_instructions_to_trigger_crash.png differ diff --git a/screenshots/gameplay_instructions_to_trigger_runtime_error.png b/screenshots/gameplay_instructions_to_trigger_runtime_error.png new file mode 100644 index 0000000..f7a23d3 Binary files /dev/null and b/screenshots/gameplay_instructions_to_trigger_runtime_error.png differ diff --git a/screenshots/godot_open_project.png b/screenshots/godot_open_project.png new file mode 100644 index 0000000..6589023 Binary files /dev/null and b/screenshots/godot_open_project.png differ diff --git a/screenshots/select_godot_folder.png b/screenshots/select_godot_folder.png new file mode 100644 index 0000000..43e21fe Binary files /dev/null and b/screenshots/select_godot_folder.png differ diff --git a/screenshots/select_sentry_jump.png b/screenshots/select_sentry_jump.png new file mode 100644 index 0000000..e8f2754 Binary files /dev/null and b/screenshots/select_sentry_jump.png differ diff --git a/screenshots/start_sentry_jump_game.png b/screenshots/start_sentry_jump_game.png new file mode 100644 index 0000000..9b2ee3b Binary files /dev/null and b/screenshots/start_sentry_jump_game.png differ diff --git a/src/game.gd b/src/game.gd index f695a7f..fdfb103 100644 --- a/src/game.gd +++ b/src/game.gd @@ -8,6 +8,9 @@ var level_bottom := 2000 func _ready() -> void: print("Game starting!") SentrySDK.set_tag("level", "clouds") + var user := SentryUser.new() + user.generate_new_id() + SentrySDK.set_user(user) func _process(_delta: float) -> void: @@ -31,3 +34,4 @@ func _physics_process(_delta): # Detect player falling through level boundaries as error. push_error("Player left playable area! Restarting scene.") Global.reset_scene() + diff --git a/src/goal.gd b/src/goal.gd index a345855..7ca3bc2 100644 --- a/src/goal.gd +++ b/src/goal.gd @@ -3,14 +3,14 @@ extends Area2D @export var animation_player: AnimationPlayer -@export var victory_animation: StringName = "Dance" +@export var dance_victory_animation: StringName = "Dance" func _play_victory_animation(): # Results in error since "victory" animation doesn't exist. var goal_name: String = self.name SentrySDK.add_breadcrumb("Reached: " + goal_name, "Milestone") - animation_player.play(victory_animation) + animation_player.play(dance_victory_animation) func _on_body_entered(_player: CharacterBody2D):