Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]: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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Automate the game without opening Godot Studio
### Automate the game without opening Godot Engine

No such thing as "Godot Studio". We usually refer to editor as "Godot editor" or just "Godot Engine". You can pick whichever you like :)


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
4 changes: 4 additions & 0 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -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
Binary file added screenshots/automate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/fall_off_platform.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/godot_open_project.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/select_godot_folder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/select_sentry_jump.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/start_sentry_jump_game.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/game.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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()

4 changes: 2 additions & 2 deletions src/goal.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(this is only updated because we want the suspect commit to show something as recent as possible)



func _on_body_entered(_player: CharacterBody2D):
Expand Down