Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add two scripts that simplify browser testing #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ flycheck_*.el
# Godot-specific ignores
.import/
export.cfg
export_presets.cfg
#export_presets.cfg

# Imported translations (automatically generated from CSV files)
*.translation
Expand Down Expand Up @@ -86,3 +86,8 @@ tags
[._]*.un~

# End of https://www.toptal.com/developers/gitignore/api/godot,vim,emacs

game/*
!game/.gitkeep

node_modules/
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,22 @@ Check out this demo on the asset library: https://godotengine.org/asset-library/
## Screenshots

![Screenshot](screenshots/spectrum.png)

## Running and exporting

There are two scripts:

```
./server.sh
```

This one starts a HTML server (via browsersync) that shows the `game`
directory, where game can be exported.

```
./export.sh
```

This one rebuilds the game, provided that you have `godot` in your PATH.
It exports the HTML5 preset into the `game` directory, which triggers browser
reload.
11 changes: 11 additions & 0 deletions export.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

set -v

if [ ! -d game ]; then
mkdir game
fi

rm -rf game/*

godot --export HTML5 game/index.html
24 changes: 24 additions & 0 deletions export_presets.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[preset.0]

name="HTML5"
platform="HTML5"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path=""
script_export_mode=1
script_encryption_key=""

[preset.0.options]

custom_template/debug=""
custom_template/release=""
variant/export_type=0
vram_texture_compression/for_desktop=true
vram_texture_compression/for_mobile=false
html/custom_html_shell=""
html/head_include=""
html/canvas_resize_policy=2
html/experimental_virtual_keyboard=false
Empty file added game/.gitkeep
Empty file.
Loading