Skip to content

Commit

Permalink
Updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
kiwijuice56 committed Nov 4, 2022
1 parent ad5e038 commit efaa1d7
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 4 deletions.
Binary file modified .sconsign.dblite
Binary file not shown.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ state from surrounding cells. You can get information and manipulate the simulat
const double FLAME = 1 / 64.0;

void process(SandSimulation *sim, int row, int col) override {
// randf is a helper method defined within element.h that returns a random number [0, 1)
if (randf() < FLAME && sim->is_on_fire(row, col)) {
// randf is a helper method defined within sand_simulation.h that returns a random number [0, 1)
if (sim->randf() < FLAME && sim->is_on_fire(row, col)) {
// Set this cell to glass when on fire
sim->set_cell(row, col, 25); // 25 is the ID of glass, as explained further below
return;
Expand All @@ -56,3 +56,8 @@ is replaced with glass. Glass is placed at the 25th spot of the `elements` vecto
In the godot project, add your element name to the `ELEMENT_INDEX` list within `game\main.gd` at the same index you placed it within `elements`.
The visuals of your element can be modified through the `game\canvas\element_shader.gd` file.
Finally, create a button with the matching name that you put within the list.
## Save Files
The game allows you to manage save files. Files are stored in `user:\\` which is `%APPDATA%\Godot\app_userdata\Sand Slide` on Windows.
Each folder corresponds to a save file and contains a Godot resource and an image. Each luminosity value in the texture represents an element,
so you can edit the file in an external editor and load it back into the game.
Binary file modified extension/src/register_types.windows.template_release.x86_64.obj
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 2 additions & 1 deletion game/main.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[ext_resource type="Script" path="res://ui/ui.gd" id="2_27ols"]
[ext_resource type="FontFile" uid="uid://b8lxwo5dkwrs4" path="res://ui/font/Poppins-Regular.ttf" id="2_iejaa"]
[ext_resource type="Script" path="res://ui/canvas/canvas.gd" id="3_b35ov"]
[ext_resource type="Material" uid="uid://c4yk1luulvf23" path="res://ui/canvas/element_painter.tres" id="4_gkdgx"]
[ext_resource type="Material" path="res://ui/canvas/element_painter.tres" id="4_gkdgx"]
[ext_resource type="Script" path="res://ui/help_label.gd" id="4_vr722"]
[ext_resource type="Script" path="res://ui/element_selector/element_selector.gd" id="5_waeqw"]
[ext_resource type="Script" path="res://ui/fps_label.gd" id="6_wixoe"]
Expand Down Expand Up @@ -971,6 +971,7 @@ offset_right = 1000.0
offset_bottom = 501.0
size_flags_vertical = 3
script = ExtResource("3_b35ov")
px_scale = 3

[node name="HelpLabel" type="Label" parent="UI/ScreenContainer/Canvas" node_paths=PackedStringArray("sim_holder", "canvas", "splash_screen")]
layout_mode = 1
Expand Down
3 changes: 2 additions & 1 deletion game/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,13 @@ boot_splash/show_image=false
boot_splash/bg_color=Color(0, 0, 0, 1)
config/icon="res://icon.png"
config/windows_native_icon="res://favicon.ico"
config/version="1.0"
config/version="1.1"

[display]

window/size/viewport_width=1000
window/size/viewport_height=800
window/size/mode=2
window/vsync/vsync_mode=0
window/stretch/aspect="ignore"

Expand Down
2 changes: 2 additions & 0 deletions game/save_file/save_file_manager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ func overwrite_save_file(file: SaveFile) -> void:
var path: String = file.get_path()
var folder: String = path.substr(0, path.rfind("/") + 1)
sim_holder.save_image(folder + "/img.png")
file.version = ProjectSettings.get_setting("application/config/version")
ResourceSaver.save(file, path)

update_files()

Expand Down

0 comments on commit efaa1d7

Please sign in to comment.