Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab9be2e79d | ||
|
|
3e4f49cef7 | ||
|
|
a3c35ce2be | ||
|
|
74a5c91794 | ||
|
|
9ac0b6f58b | ||
|
|
6501f329b7 | ||
|
|
8cbfd92486 | ||
|
|
e113915c80 | ||
|
|
ef5cec6aaf |
2
.gitattributes
vendored
@@ -1,4 +1,2 @@
|
||||
# Normalize EOL for all files that Git considers text files.
|
||||
* text=auto eol=lf
|
||||
|
||||
*.hdr binary
|
||||
|
||||
13
.github/CODEOWNERS
vendored
@@ -1,13 +0,0 @@
|
||||
# Lines starting with '#' are comments.
|
||||
# Each line is a file pattern followed by one or more owners.
|
||||
# Owners can be @users, @org/teams or emails
|
||||
|
||||
/.github/dist/ @Calinou
|
||||
|
||||
/3d/voxel/ @aaronfranke
|
||||
/misc/matrix_transform/ @aaronfranke
|
||||
/misc/2.5d/ @aaronfranke
|
||||
/mono/2.5d/ @aaronfranke
|
||||
|
||||
/2d/physics_tests/ @pouleyKetchoupp
|
||||
/3d/physics_tests/ @pouleyKetchoupp
|
||||
34
.github/ISSUE_TEMPLATE/bug-report.md
vendored
@@ -1,34 +0,0 @@
|
||||
---
|
||||
name: Bug Report
|
||||
about: Report a bug with one of the demo projects.
|
||||
title: ""
|
||||
labels: bug
|
||||
assignees: ""
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
Please search existing issues for potential duplicates before filing yours:
|
||||
https://github.com/godotengine/godot-demo-projects/issues?q=is%3Aissue
|
||||
|
||||
Only submit an issue if it is reproducible with the latest stable Godot version.
|
||||
-->
|
||||
|
||||
**Which demo project is affected:**
|
||||
<!-- Specify the project name or path. -->
|
||||
|
||||
|
||||
**OS/device including version:**
|
||||
<!-- Specify GPU model and drivers if graphics-related. -->
|
||||
|
||||
|
||||
**Issue description:**
|
||||
<!-- What happened, what was expected, and what went wrong. -->
|
||||
|
||||
|
||||
**Screenshots of issue:**
|
||||
<!--
|
||||
This section is optional.
|
||||
Drag in an image, or post an image with a link in the form of:
|
||||

|
||||
-->
|
||||
@@ -1,19 +0,0 @@
|
||||
---
|
||||
name: Feature / Enhancement Request
|
||||
about: Adding new features or improving existing ones.
|
||||
title: ""
|
||||
labels: enhancement
|
||||
assignees: ""
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
Please search existing issues for potential duplicates before filing yours:
|
||||
https://github.com/godotengine/godot-demo-projects/issues?q=is%3Aissue
|
||||
-->
|
||||
|
||||
**Which demo project is affected:**
|
||||
<!-- Specify the project name or path. -->
|
||||
|
||||
|
||||
**Description:**
|
||||
7
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -1,7 +0,0 @@
|
||||
<!--
|
||||
Please target the `master` branch in priority.
|
||||
PRs can target `3.x` if the same change was done in `master`, or is not relevant there.
|
||||
|
||||
Relevant fixes are cherry-picked for stable branches as needed by maintainers.
|
||||
You can mention in the description if the change is compatible with `3.x`.
|
||||
-->
|
||||
6
.github/dependabot.yml
vendored
@@ -1,6 +0,0 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
0
.github/dist/.nojekyll
vendored
23
.github/dist/export_presets.cfg
vendored
@@ -1,23 +0,0 @@
|
||||
[preset.0]
|
||||
|
||||
name="HTML5"
|
||||
platform="HTML5"
|
||||
runnable=true
|
||||
custom_features=""
|
||||
export_filter="all_resources"
|
||||
include_filter="*.json"
|
||||
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/full_window_size=true
|
||||
20
.github/dist/footer.html
vendored
@@ -1,20 +0,0 @@
|
||||
<!-- The list of demos will be inserted above by the CI process. -->
|
||||
</ul>
|
||||
<h2>Unavailable demos</h2>
|
||||
<ul>
|
||||
<li><code>2d/hdr/</code>: Not supported on HTML5 yet.</li>
|
||||
<li><code>3d/global_illumination/</code>: Not supported on HTML5 yet (freezes the browser).</li>
|
||||
<li><code>3d/voxel/</code>: Not supported on HTML5 yet.</li>
|
||||
<li><code>audio/device_changer/</code>: Not supported on HTML5 due to browser limitations.</li>
|
||||
<li><code>loading/background_load/</code>: Not supported on HTML5 yet.</li>
|
||||
<li><code>loading/multiple_threads_loading/</code>: Not supported on HTML5 yet.</li>
|
||||
<li><code>loading/threads/</code>: Not supported on HTML5 yet.</li>
|
||||
<li><code>misc/matrix_transform/</code>: Results are only visible in the editor.</li>
|
||||
<li><code>mobile/android_iap/</code>: Only relevant on native Android.</li>
|
||||
<li><code>mobile/sensors/</code>: Not supported on HTML5 yet.</li>
|
||||
<li><code>mono/*/</code>: Not available yet (requires Mono-enabled HTML5 build).</li>
|
||||
<li><code>networking/*/</code>: Doesn't make sense to be hosted on a static host, as the server must be hosted on the same origin due to the browser's same-origin policy.</li>
|
||||
<li><code>plugins/*/</code>: Only effective within the editor.</li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
118
.github/dist/header.html
vendored
@@ -1,118 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Godot demos exported to HTML5</title>
|
||||
<style>
|
||||
:root {
|
||||
--background-color: #fff;
|
||||
--text-color: #222;
|
||||
--link-color: hsl(220, 100%, 45%);
|
||||
--link-underline-color: hsla(220, 100%, 45%, 0.3);
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--background-color: #222;
|
||||
--text-color: #eee;
|
||||
--link-color: hsl(200, 100%, 70%);
|
||||
--link-underline-color: hsla(200, 100%, 70%, 0.3);
|
||||
}
|
||||
}
|
||||
|
||||
*:focus {
|
||||
/* More visible outline for better keyboard navigation. */
|
||||
outline: 0.125rem solid hsl(220, 100%, 62.5%);
|
||||
/* Make the outline always appear above other elements. */
|
||||
position: relative;
|
||||
}
|
||||
|
||||
html {
|
||||
background-color: var(--background-color);
|
||||
color: var(--text-color);
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
||||
max-width: 50rem;
|
||||
margin: 0 auto;
|
||||
padding: 0.75rem;
|
||||
line-height: 1.618rem;
|
||||
}
|
||||
|
||||
h2 {
|
||||
margin-top: 2.5rem;
|
||||
}
|
||||
|
||||
a {
|
||||
color: var(--link-color);
|
||||
text-decoration-color: var(--link-underline-color);
|
||||
text-decoration-thickness: 0.125rem;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
filter: brightness(117.5%);
|
||||
}
|
||||
|
||||
a:active {
|
||||
filter: brightness(82.5%);
|
||||
}
|
||||
|
||||
ul {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
li {
|
||||
display: block;
|
||||
}
|
||||
|
||||
li a {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
height: 4rem;
|
||||
margin-left: 0.5rem;
|
||||
}
|
||||
|
||||
li a:hover {
|
||||
background-color: hsla(0, 0%, 50%, 0.1);
|
||||
}
|
||||
|
||||
li a * {
|
||||
float: left;
|
||||
}
|
||||
|
||||
li a p {
|
||||
height: 24px;
|
||||
margin: 20px 10px;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Godot demo projects</h1>
|
||||
<p>
|
||||
This page lists
|
||||
<a href="https://github.com/godotengine/godot-demo-projects">official Godot demo projects</a>
|
||||
exported to HTML5 for testing purposes. These projects are deployed automatically
|
||||
on every commit on the <code>master</code> branch of the repository.
|
||||
</p>
|
||||
<p>
|
||||
The HTML5 exports on this page are provided for demonstration purposes only.
|
||||
Some of these demos may not function or render correctly on HTML5,
|
||||
especially on mobile devices.
|
||||
For best performance, it's recommended to
|
||||
<a href="https://godotengine.org/download">download</a> a native editor
|
||||
and run the demo project by importing its files in the project manager.
|
||||
</p>
|
||||
<p>
|
||||
See the
|
||||
<a href="https://docs.godotengine.org/en/stable/getting_started/workflow/export/exporting_for_web.html">Exporting for the Web</a>
|
||||
documentation for information on exporting your own projects to HTML5.
|
||||
</p>
|
||||
|
||||
<h2>List of demos</h2>
|
||||
<ul>
|
||||
<!-- The list of demos will be inserted below by the CI process. -->
|
||||
1
.gitignore
vendored
@@ -20,4 +20,3 @@ mono_crash.*.json
|
||||
.directory
|
||||
.DS_Store
|
||||
*~
|
||||
*.blend1
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
# 2D Demos
|
||||
|
||||
These demos are all 2D, but otherwise do not have a common theme.
|
||||
|
||||
Languages: Most have GDScript, some have
|
||||
[GDSL](https://docs.godotengine.org/en/latest/tutorials/shaders/shader_reference/shading_language.html)
|
||||
|
||||
Renderers: 4 of them are GLES 3, but most are GLES 2
|
||||
@@ -1,20 +0,0 @@
|
||||
# Bullet Shower
|
||||
|
||||
This demonstrates how to manage large amounts of objects efficiently using
|
||||
low-level Servers.
|
||||
|
||||
See
|
||||
[Optimization using Servers](https://docs.godotengine.org/en/latest/tutorials/performance/using_servers.html)
|
||||
in the documentation for more information.
|
||||
|
||||
Language: GDScript
|
||||
|
||||
Renderer: Vulkan Mobile
|
||||
|
||||
Check out this demo on the asset library: https://godotengine.org/asset-library/asset/887
|
||||
|
||||
## Screenshots
|
||||
|
||||

|
||||
|
||||

|
||||
|
Before Width: | Height: | Size: 312 B |
@@ -1,34 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bcoiuym4nw1ua"
|
||||
path="res://.godot/imported/bullet.png-ff1424653e10246c11e3724e402c519e.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://bullet.png"
|
||||
dest_files=["res://.godot/imported/bullet.png-ff1424653e10246c11e3724e402c519e.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
@@ -1,88 +0,0 @@
|
||||
extends Node2D
|
||||
# This demo is an example of controling a high number of 2D objects with logic
|
||||
# and collision without using nodes in the scene. This technique is a lot more
|
||||
# efficient than using instancing and nodes, but requires more programming and
|
||||
# is less visual. Bullets are managed together in the `bullets.gd` script.
|
||||
|
||||
const BULLET_COUNT = 500
|
||||
const SPEED_MIN = 20
|
||||
const SPEED_MAX = 80
|
||||
|
||||
const bullet_image = preload("res://bullet.png")
|
||||
|
||||
var bullets := []
|
||||
var shape
|
||||
|
||||
|
||||
class Bullet:
|
||||
var position = Vector2()
|
||||
var speed = 1.0
|
||||
# The body is stored as a RID, which is an "opaque" way to access resources.
|
||||
# With large amounts of objects (thousands or more), it can be significantly
|
||||
# faster to use RIDs compared to a high-level approach.
|
||||
var body = RID()
|
||||
|
||||
|
||||
func _ready():
|
||||
shape = PhysicsServer2D.circle_shape_create()
|
||||
# Set the collision shape's radius for each bullet in pixels.
|
||||
PhysicsServer2D.shape_set_data(shape, 8)
|
||||
|
||||
for _i in BULLET_COUNT:
|
||||
var bullet = Bullet.new()
|
||||
# Give each bullet its own random speed.
|
||||
bullet.speed = randf_range(SPEED_MIN, SPEED_MAX)
|
||||
bullet.body = PhysicsServer2D.body_create()
|
||||
|
||||
PhysicsServer2D.body_set_space(bullet.body, get_world_2d().get_space())
|
||||
PhysicsServer2D.body_add_shape(bullet.body, shape)
|
||||
# Don't make bullets check collision with other bullets to improve performance.
|
||||
PhysicsServer2D.body_set_collision_mask(bullet.body, 0)
|
||||
|
||||
# Place bullets randomly on the viewport and move bullets outside the
|
||||
# play area so that they fade in nicely.
|
||||
bullet.position = Vector2(
|
||||
randf_range(0, get_viewport_rect().size.x) + get_viewport_rect().size.x,
|
||||
randf_range(0, get_viewport_rect().size.y)
|
||||
)
|
||||
var transform2d = Transform2D()
|
||||
transform2d.origin = bullet.position
|
||||
PhysicsServer2D.body_set_state(bullet.body, PhysicsServer2D.BODY_STATE_TRANSFORM, transform2d)
|
||||
|
||||
bullets.push_back(bullet)
|
||||
|
||||
|
||||
func _process(_delta):
|
||||
# Order the CanvasItem to update every frame.
|
||||
queue_redraw()
|
||||
|
||||
|
||||
func _physics_process(delta):
|
||||
var transform2d = Transform2D()
|
||||
var offset = get_viewport_rect().size.x + 16
|
||||
for bullet in bullets:
|
||||
bullet.position.x -= bullet.speed * delta
|
||||
|
||||
if bullet.position.x < -16:
|
||||
# Move the bullet back to the right when it left the screen.
|
||||
bullet.position.x = offset
|
||||
|
||||
transform2d.origin = bullet.position
|
||||
PhysicsServer2D.body_set_state(bullet.body, PhysicsServer2D.BODY_STATE_TRANSFORM, transform2d)
|
||||
|
||||
|
||||
# Instead of drawing each bullet individually in a script attached to each bullet,
|
||||
# we are drawing *all* the bullets at once here.
|
||||
func _draw():
|
||||
var offset = -bullet_image.get_size() * 0.5
|
||||
for bullet in bullets:
|
||||
draw_texture(bullet_image, bullet.position + offset)
|
||||
|
||||
|
||||
# Perform cleanup operations (required to exit without error messages in the console).
|
||||
func _exit_tree():
|
||||
for bullet in bullets:
|
||||
PhysicsServer2D.free_rid(bullet.body)
|
||||
|
||||
PhysicsServer2D.free_rid(shape)
|
||||
bullets.clear()
|
||||
|
Before Width: | Height: | Size: 907 B |
@@ -1,34 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://d3u7k0742d5ug"
|
||||
path="res://.godot/imported/face_happy.png-38d387d31ec13459f749c93ce3d75d80.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://face_happy.png"
|
||||
dest_files=["res://.godot/imported/face_happy.png-38d387d31ec13459f749c93ce3d75d80.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
|
Before Width: | Height: | Size: 846 B |
@@ -1,34 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://8j32onnr4qo3"
|
||||
path="res://.godot/imported/face_sad.png-0ac7165eab24f595aba17a746a66c550.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://face_sad.png"
|
||||
dest_files=["res://.godot/imported/face_sad.png-0ac7165eab24f595aba17a746a66c550.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
|
Before Width: | Height: | Size: 6.9 KiB |
@@ -1,34 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://brwp8bimc75uu"
|
||||
path="res://.godot/imported/icon.webp-e94f9a68b0f625a567a797079e4d325f.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://icon.webp"
|
||||
dest_files=["res://.godot/imported/icon.webp-e94f9a68b0f625a567a797079e4d325f.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
@@ -1,37 +0,0 @@
|
||||
extends Node2D
|
||||
# This demo is an example of controling a high number of 2D objects with logic
|
||||
# and collision without using nodes in the scene. This technique is a lot more
|
||||
# efficient than using instancing and nodes, but requires more programming and
|
||||
# is less visual. Bullets are managed together in the `bullets.gd` script.
|
||||
|
||||
# The number of bullets currently touched by the player.
|
||||
var touching = 0
|
||||
|
||||
@onready var sprite = $AnimatedSprite2D
|
||||
|
||||
|
||||
func _ready():
|
||||
# The player follows the mouse cursor automatically, so there's no point
|
||||
# in displaying the mouse cursor.
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN)
|
||||
|
||||
|
||||
func _input(event):
|
||||
# Getting the movement of the mouse so the sprite can follow its position.
|
||||
if event is InputEventMouseMotion:
|
||||
position = event.position - Vector2(0, 16)
|
||||
|
||||
|
||||
func _on_body_shape_entered(_body_id, _body, _body_shape, _local_shape):
|
||||
# Player got touched by a bullet so sprite changes to sad face.
|
||||
touching += 1
|
||||
if touching >= 1:
|
||||
sprite.frame = 1
|
||||
|
||||
|
||||
func _on_body_shape_exited(_body_id, _body, _body_shape, _local_shape):
|
||||
touching -= 1
|
||||
# When non of the bullets are touching the player,
|
||||
# sprite changes to happy face.
|
||||
if touching == 0:
|
||||
sprite.frame = 0
|
||||
@@ -1,35 +0,0 @@
|
||||
; Engine configuration file.
|
||||
; It's best edited using the editor UI and not directly,
|
||||
; since the parameters that go here are not all obvious.
|
||||
;
|
||||
; Format:
|
||||
; [section] ; section goes between []
|
||||
; param=value ; assign values to parameters
|
||||
|
||||
config_version=5
|
||||
|
||||
[application]
|
||||
|
||||
config/name="Bullet Shower"
|
||||
config/description="Demonstrates how to manage large amounts of objects efficiently using low-level Servers."
|
||||
config/tags=PackedStringArray("2d", "demo", "official", "performance")
|
||||
run/main_scene="res://shower.tscn"
|
||||
config/features=PackedStringArray("4.2")
|
||||
config/icon="res://icon.webp"
|
||||
|
||||
[display]
|
||||
|
||||
window/stretch/mode="canvas_items"
|
||||
window/stretch/aspect="expand"
|
||||
|
||||
[layer_names]
|
||||
|
||||
2d_physics/layer_1="Player"
|
||||
|
||||
[physics]
|
||||
|
||||
2d/cell_size=64
|
||||
|
||||
[rendering]
|
||||
|
||||
renderer/rendering_method="mobile"
|
||||
|
Before Width: | Height: | Size: 152 KiB |
|
Before Width: | Height: | Size: 150 KiB |
@@ -1,40 +0,0 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://c78by7hc4fmwx"]
|
||||
|
||||
[ext_resource type="Script" path="res://bullets.gd" id="2"]
|
||||
[ext_resource type="Texture2D" uid="uid://d3u7k0742d5ug" path="res://face_happy.png" id="3"]
|
||||
[ext_resource type="Texture2D" uid="uid://8j32onnr4qo3" path="res://face_sad.png" id="4"]
|
||||
[ext_resource type="Script" path="res://player.gd" id="5"]
|
||||
|
||||
[sub_resource type="SpriteFrames" id="1"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("3")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("4")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"default",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="2"]
|
||||
radius = 27.0
|
||||
|
||||
[node name="Shower" type="Node2D"]
|
||||
|
||||
[node name="Bullets" type="Node2D" parent="."]
|
||||
script = ExtResource("2")
|
||||
|
||||
[node name="Player" type="Area2D" parent="."]
|
||||
script = ExtResource("5")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="Player"]
|
||||
sprite_frames = SubResource("1")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Player"]
|
||||
shape = SubResource("2")
|
||||
|
||||
[connection signal="body_shape_entered" from="Player" to="Player" method="_on_body_shape_entered"]
|
||||
[connection signal="body_shape_exited" from="Player" to="Player" method="_on_body_shape_exited"]
|
||||
@@ -7,24 +7,19 @@ func show_message(text):
|
||||
$MessageLabel.show()
|
||||
$MessageTimer.start()
|
||||
|
||||
|
||||
func show_game_over():
|
||||
show_message("Game Over")
|
||||
await $MessageTimer.timeout
|
||||
$MessageLabel.text = "Dodge the\nCreeps"
|
||||
$MessageLabel.show()
|
||||
await get_tree().create_timer(1).timeout
|
||||
yield($MessageTimer, "timeout")
|
||||
$StartButton.show()
|
||||
|
||||
$MessageLabel.text = "Dodge the\nCreeps!"
|
||||
$MessageLabel.show()
|
||||
|
||||
func update_score(score):
|
||||
$ScoreLabel.text = str(score)
|
||||
|
||||
|
||||
func _on_StartButton_pressed():
|
||||
$StartButton.hide()
|
||||
start_game.emit()
|
||||
|
||||
emit_signal("start_game")
|
||||
|
||||
func _on_MessageTimer_timeout():
|
||||
$MessageLabel.hide()
|
||||
|
||||
@@ -1,57 +1,126 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://ccqoreueuxdb7"]
|
||||
[gd_scene load_steps=6 format=2]
|
||||
|
||||
[ext_resource type="Script" path="res://HUD.gd" id="1"]
|
||||
[ext_resource path="res://HUD.gd" type="Script" id=1]
|
||||
[ext_resource path="res://fonts/Xolonium-Regular.ttf" type="DynamicFontData" id=2]
|
||||
|
||||
[sub_resource type="InputEventAction" id="InputEventAction_fopy7"]
|
||||
action = &"start_game"
|
||||
[sub_resource type="DynamicFont" id=1]
|
||||
|
||||
[sub_resource type="Shortcut" id="4"]
|
||||
events = [SubResource("InputEventAction_fopy7")]
|
||||
size = 64
|
||||
use_mipmaps = false
|
||||
use_filter = false
|
||||
font_data = ExtResource( 2 )
|
||||
_sections_unfolded = [ "Font", "Settings" ]
|
||||
|
||||
[sub_resource type="DynamicFont" id=2]
|
||||
|
||||
size = 72
|
||||
use_mipmaps = false
|
||||
use_filter = false
|
||||
font_data = ExtResource( 2 )
|
||||
_sections_unfolded = [ "Font", "Settings" ]
|
||||
|
||||
[sub_resource type="DynamicFont" id=3]
|
||||
|
||||
size = 48
|
||||
use_mipmaps = false
|
||||
use_filter = false
|
||||
font_data = ExtResource( 2 )
|
||||
_sections_unfolded = [ "Font", "Settings" ]
|
||||
|
||||
[node name="HUD" type="CanvasLayer"]
|
||||
script = ExtResource("1")
|
||||
|
||||
[node name="ScoreLabel" type="Label" parent="."]
|
||||
anchors_preset = 10
|
||||
anchor_right = 1.0
|
||||
offset_bottom = 78.0
|
||||
grow_horizontal = 2
|
||||
theme_override_font_sizes/font_size = 60
|
||||
layer = 1
|
||||
offset = Vector2( 0, 0 )
|
||||
rotation = 0.0
|
||||
scale = Vector2( 1, 1 )
|
||||
transform = Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="ScoreLabel" type="Label" parent="." index="0"]
|
||||
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.0
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.0
|
||||
margin_left = -25.0
|
||||
margin_right = 25.0
|
||||
margin_bottom = 100.0
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
rect_clip_content = false
|
||||
mouse_filter = 2
|
||||
mouse_default_cursor_shape = 0
|
||||
size_flags_horizontal = 1
|
||||
size_flags_vertical = 4
|
||||
custom_fonts/font = SubResource( 1 )
|
||||
text = "0"
|
||||
horizontal_alignment = 1
|
||||
align = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
_sections_unfolded = [ "Anchor", "Margin", "custom_fonts" ]
|
||||
|
||||
[node name="MessageLabel" type="Label" parent="."]
|
||||
anchors_preset = 14
|
||||
[node name="MessageLabel" type="Label" parent="." index="1"]
|
||||
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 1.0
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_top = -79.5
|
||||
offset_bottom = 79.5
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_font_sizes/font_size = 60
|
||||
margin_left = -200.0
|
||||
margin_top = -150.0
|
||||
margin_right = 200.0
|
||||
margin_bottom = 50.0
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
rect_clip_content = false
|
||||
mouse_filter = 2
|
||||
mouse_default_cursor_shape = 0
|
||||
size_flags_horizontal = 1
|
||||
size_flags_vertical = 4
|
||||
custom_fonts/font = SubResource( 2 )
|
||||
text = "Dodge the
|
||||
Creeps"
|
||||
horizontal_alignment = 1
|
||||
Creeps!"
|
||||
align = 1
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
_sections_unfolded = [ "Anchor", "Margin", "custom_fonts" ]
|
||||
|
||||
[node name="MessageTimer" type="Timer" parent="." index="2"]
|
||||
|
||||
process_mode = 1
|
||||
wait_time = 2.0
|
||||
one_shot = true
|
||||
autostart = false
|
||||
|
||||
[node name="StartButton" type="Button" parent="." index="3"]
|
||||
|
||||
[node name="StartButton" type="Button" parent="."]
|
||||
anchors_preset = 7
|
||||
anchor_left = 0.5
|
||||
anchor_top = 1.0
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -90.0
|
||||
offset_top = -200.0
|
||||
offset_right = 90.0
|
||||
offset_bottom = -100.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
theme_override_font_sizes/font_size = 60
|
||||
shortcut = SubResource("4")
|
||||
margin_left = -100.0
|
||||
margin_top = -200.0
|
||||
margin_right = 100.0
|
||||
margin_bottom = -100.0
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
rect_clip_content = false
|
||||
focus_mode = 2
|
||||
mouse_filter = 0
|
||||
mouse_default_cursor_shape = 0
|
||||
size_flags_horizontal = 1
|
||||
size_flags_vertical = 1
|
||||
custom_fonts/font = SubResource( 3 )
|
||||
toggle_mode = false
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "Start"
|
||||
flat = false
|
||||
align = 1
|
||||
_sections_unfolded = [ "Anchor", "Margin", "Visibility", "custom_fonts" ]
|
||||
|
||||
[node name="MessageTimer" type="Timer" parent="."]
|
||||
one_shot = true
|
||||
[connection signal="timeout" from="MessageTimer" to="." method="_on_MessageTimer_timeout"]
|
||||
|
||||
[connection signal="pressed" from="StartButton" to="." method="_on_StartButton_pressed"]
|
||||
[connection signal="timeout" from="MessageTimer" to="." method="_on_MessageTimer_timeout"]
|
||||
|
||||
|
||||
|
||||
@@ -1,56 +1,42 @@
|
||||
extends Node
|
||||
|
||||
@export var mob_scene: PackedScene
|
||||
export (PackedScene) var Mob
|
||||
var score
|
||||
|
||||
func game_over():
|
||||
$ScoreTimer.stop()
|
||||
$MobTimer.stop()
|
||||
$HUD.show_game_over()
|
||||
$Music.stop()
|
||||
$DeathSound.play()
|
||||
|
||||
func _ready():
|
||||
randomize()
|
||||
|
||||
func new_game():
|
||||
get_tree().call_group(&"mobs", &"queue_free")
|
||||
score = 0
|
||||
$HUD.update_score(score)
|
||||
$Player.start($StartPosition.position)
|
||||
$StartTimer.start()
|
||||
$HUD.update_score(score)
|
||||
$HUD.show_message("Get Ready")
|
||||
$Music.play()
|
||||
|
||||
func game_over():
|
||||
$DeathSound.play()
|
||||
$Music.stop()
|
||||
$ScoreTimer.stop()
|
||||
$MobTimer.stop()
|
||||
$HUD.show_game_over()
|
||||
|
||||
func _on_MobTimer_timeout():
|
||||
# Create a new instance of the Mob scene.
|
||||
var mob = mob_scene.instantiate()
|
||||
|
||||
# Choose a random location on Path2D.
|
||||
var mob_spawn_location = get_node(^"MobPath/MobSpawnLocation")
|
||||
mob_spawn_location.progress = randi()
|
||||
|
||||
# Set the mob's direction perpendicular to the path direction.
|
||||
var direction = mob_spawn_location.rotation + PI / 2
|
||||
|
||||
# Set the mob's position to a random location.
|
||||
mob.position = mob_spawn_location.position
|
||||
|
||||
# Add some randomness to the direction.
|
||||
direction += randf_range(-PI / 4, PI / 4)
|
||||
mob.rotation = direction
|
||||
|
||||
# Choose the velocity for the mob.
|
||||
var velocity = Vector2(randf_range(150.0, 250.0), 0.0)
|
||||
mob.linear_velocity = velocity.rotated(direction)
|
||||
|
||||
# Spawn the mob by adding it to the Main scene.
|
||||
# choose a random location on the Path2D
|
||||
$MobPath/MobSpawnLocation.set_offset(randi())
|
||||
var mob = Mob.instance()
|
||||
add_child(mob)
|
||||
|
||||
func _on_ScoreTimer_timeout():
|
||||
score += 1
|
||||
$HUD.update_score(score)
|
||||
|
||||
var direction = $MobPath/MobSpawnLocation.rotation + PI/2
|
||||
mob.position = $MobPath/MobSpawnLocation.position
|
||||
# add some randomness to the direction
|
||||
direction += rand_range(-PI/4, PI/4)
|
||||
mob.rotation = direction
|
||||
mob.set_linear_velocity(Vector2(rand_range(mob.MIN_SPEED, mob.MAX_SPEED), 0).rotated(direction))
|
||||
|
||||
func _on_StartTimer_timeout():
|
||||
$MobTimer.start()
|
||||
$ScoreTimer.start()
|
||||
|
||||
func _on_ScoreTimer_timeout():
|
||||
score += 1
|
||||
$HUD.update_score(score)
|
||||
|
||||
@@ -1,59 +1,112 @@
|
||||
[gd_scene load_steps=8 format=3 uid="uid://cyfwty2q3rdse"]
|
||||
[gd_scene load_steps=8 format=2]
|
||||
|
||||
[ext_resource type="Script" path="res://Main.gd" id="1"]
|
||||
[ext_resource type="PackedScene" uid="uid://rkdnhqgf2hpj" path="res://Mob.tscn" id="2"]
|
||||
[ext_resource type="PackedScene" uid="uid://4vwrqjegqwpj" path="res://Player.tscn" id="3"]
|
||||
[ext_resource type="PackedScene" uid="uid://ccqoreueuxdb7" path="res://HUD.tscn" id="4"]
|
||||
[ext_resource type="AudioStream" uid="uid://q2pf4fr8d0ks" path="res://art/House In a Forest Loop.ogg" id="5"]
|
||||
[ext_resource type="AudioStream" uid="uid://dw26fpygeag8o" path="res://art/gameover.wav" id="6"]
|
||||
[ext_resource path="res://Main.gd" type="Script" id=1]
|
||||
[ext_resource path="res://Mob.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://Player.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://HUD.tscn" type="PackedScene" id=4]
|
||||
[ext_resource path="res://art/House In a Forest Loop.ogg" type="AudioStream" id=5]
|
||||
[ext_resource path="res://art/gameover.wav" type="AudioStream" id=6]
|
||||
|
||||
[sub_resource type="Curve2D" id="1"]
|
||||
[sub_resource type="Curve2D" id=1]
|
||||
|
||||
bake_interval = 5.0
|
||||
_data = {
|
||||
"points": PackedVector2Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 480, 0, 0, 0, 0, 0, 480, 720, 0, 0, 0, 0, 0, 720, 0, 0, 0, 0, 0, 0)
|
||||
"points": PoolVector2Array( 0, 0, 0, 0, 1.70602, 3.56798, 0, 0, 0, 0, 482.263, 3.26522, 0, 0, 0, 0, 480.489, 729.458, 0, 0, 0, 0, 0.794434, 732.118, 0, 0, 0, 0, 1.97066, 3.83263 )
|
||||
}
|
||||
point_count = 5
|
||||
|
||||
[node name="Main" type="Node"]
|
||||
script = ExtResource("1")
|
||||
mob_scene = ExtResource("2")
|
||||
[node name="Main" type="Node" index="0"]
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
color = Color(0.219608, 0.372549, 0.380392, 1)
|
||||
script = ExtResource( 1 )
|
||||
Mob = ExtResource( 2 )
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("3")]
|
||||
[node name="ColorRect" type="ColorRect" parent="." index="0"]
|
||||
|
||||
[node name="MobTimer" type="Timer" parent="."]
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_right = 486.0
|
||||
margin_bottom = 734.0
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
mouse_default_cursor_shape = 0
|
||||
size_flags_horizontal = 1
|
||||
size_flags_vertical = 1
|
||||
color = Color( 0.253451, 0.425288, 0.429412, 1 )
|
||||
|
||||
[node name="Player" parent="." index="1" instance=ExtResource( 3 )]
|
||||
|
||||
[node name="MobTimer" type="Timer" parent="." index="2"]
|
||||
|
||||
process_mode = 1
|
||||
wait_time = 0.5
|
||||
one_shot = false
|
||||
autostart = false
|
||||
|
||||
[node name="ScoreTimer" type="Timer" parent="."]
|
||||
[node name="ScoreTimer" type="Timer" parent="." index="3"]
|
||||
|
||||
[node name="StartTimer" type="Timer" parent="."]
|
||||
process_mode = 1
|
||||
wait_time = 1.0
|
||||
one_shot = false
|
||||
autostart = false
|
||||
|
||||
[node name="StartTimer" type="Timer" parent="." index="4"]
|
||||
|
||||
process_mode = 1
|
||||
wait_time = 2.0
|
||||
one_shot = true
|
||||
autostart = false
|
||||
|
||||
[node name="StartPosition" type="Marker2D" parent="."]
|
||||
position = Vector2(240, 450)
|
||||
[node name="StartPosition" type="Position2D" parent="." index="5"]
|
||||
|
||||
[node name="MobPath" type="Path2D" parent="."]
|
||||
curve = SubResource("1")
|
||||
position = Vector2( 240, 450 )
|
||||
_sections_unfolded = [ "Transform" ]
|
||||
|
||||
[node name="MobSpawnLocation" type="PathFollow2D" parent="MobPath"]
|
||||
[node name="HUD" parent="." index="6" instance=ExtResource( 4 )]
|
||||
|
||||
[node name="HUD" parent="." instance=ExtResource("4")]
|
||||
transform = Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
|
||||
[node name="Music" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource("5")
|
||||
[node name="Music" type="AudioStreamPlayer" parent="." index="7"]
|
||||
|
||||
[node name="DeathSound" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource("6")
|
||||
stream = ExtResource( 5 )
|
||||
volume_db = -8.0
|
||||
autoplay = false
|
||||
mix_target = 0
|
||||
bus = "Master"
|
||||
|
||||
[node name="DeathSound" type="AudioStreamPlayer" parent="." index="8"]
|
||||
|
||||
stream = ExtResource( 6 )
|
||||
volume_db = -5.0
|
||||
autoplay = false
|
||||
mix_target = 0
|
||||
bus = "Master"
|
||||
|
||||
[node name="MobPath" type="Path2D" parent="." index="9"]
|
||||
|
||||
curve = SubResource( 1 )
|
||||
|
||||
[node name="MobSpawnLocation" type="PathFollow2D" parent="MobPath" index="0"]
|
||||
|
||||
position = Vector2( 1.70602, 3.56798 )
|
||||
rotation = -0.000630111
|
||||
offset = 0.0
|
||||
h_offset = 0.0
|
||||
v_offset = 0.0
|
||||
rotate = true
|
||||
cubic_interp = true
|
||||
loop = true
|
||||
lookahead = 4.0
|
||||
|
||||
[connection signal="hit" from="Player" to="." method="game_over"]
|
||||
|
||||
[connection signal="timeout" from="MobTimer" to="." method="_on_MobTimer_timeout"]
|
||||
|
||||
[connection signal="timeout" from="ScoreTimer" to="." method="_on_ScoreTimer_timeout"]
|
||||
|
||||
[connection signal="timeout" from="StartTimer" to="." method="_on_StartTimer_timeout"]
|
||||
|
||||
[connection signal="start_game" from="HUD" to="." method="new_game"]
|
||||
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
extends RigidBody2D
|
||||
|
||||
export (int) var MIN_SPEED
|
||||
export (int) var MAX_SPEED
|
||||
var mob_types = ["walk", "swim", "fly"]
|
||||
|
||||
func _ready():
|
||||
$AnimatedSprite2D.play()
|
||||
var mob_types = Array($AnimatedSprite2D.sprite_frames.get_animation_names())
|
||||
$AnimatedSprite2D.animation = mob_types.pick_random()
|
||||
$AnimatedSprite.animation = mob_types[randi() % mob_types.size()]
|
||||
|
||||
|
||||
func _on_VisibilityNotifier2D_screen_exited():
|
||||
func _on_Visibility_screen_exited():
|
||||
queue_free()
|
||||
|
||||
@@ -1,49 +1,82 @@
|
||||
[gd_scene load_steps=10 format=3 uid="uid://rkdnhqgf2hpj"]
|
||||
[gd_scene load_steps=10 format=2]
|
||||
|
||||
[ext_resource type="Script" path="res://Mob.gd" id="1"]
|
||||
[ext_resource type="Texture2D" uid="uid://yqglrrsx7j1f" path="res://art/enemyFlyingAlt_1.png" id="2"]
|
||||
[ext_resource type="Texture2D" uid="uid://bpot8awhdn6ph" path="res://art/enemyFlyingAlt_2.png" id="3"]
|
||||
[ext_resource type="Texture2D" uid="uid://bu4221t7qpa7d" path="res://art/enemyWalking_1.png" id="4"]
|
||||
[ext_resource type="Texture2D" uid="uid://booij5t7h4efb" path="res://art/enemyWalking_2.png" id="5"]
|
||||
[ext_resource type="Texture2D" uid="uid://5lvm88ij4jqn" path="res://art/enemySwimming_1.png" id="6"]
|
||||
[ext_resource type="Texture2D" uid="uid://bng45cvsgufqc" path="res://art/enemySwimming_2.png" id="7"]
|
||||
[ext_resource path="res://Mob.gd" type="Script" id=1]
|
||||
[ext_resource path="res://art/enemyWalking_1.png" type="Texture" id=2]
|
||||
[ext_resource path="res://art/enemyWalking_2.png" type="Texture" id=3]
|
||||
[ext_resource path="res://art/enemyFlyingAlt_1.png" type="Texture" id=4]
|
||||
[ext_resource path="res://art/enemyFlyingAlt_2.png" type="Texture" id=5]
|
||||
[ext_resource path="res://art/enemySwimming_1.png" type="Texture" id=6]
|
||||
[ext_resource path="res://art/enemySwimming_2.png" type="Texture" id=7]
|
||||
|
||||
[sub_resource type="SpriteFrames" id="1"]
|
||||
animations = [{
|
||||
"frames": [ExtResource( "6" ), ExtResource( "7" )],
|
||||
[sub_resource type="SpriteFrames" id=1]
|
||||
|
||||
animations = [ {
|
||||
"frames": [ ExtResource( 2 ), ExtResource( 3 ) ],
|
||||
"loop": true,
|
||||
"name": &"swim",
|
||||
"name": "walk",
|
||||
"speed": 4.0
|
||||
}, {
|
||||
"frames": [ExtResource( "2" ), ExtResource( "3" )],
|
||||
"frames": [ ExtResource( 4 ), ExtResource( 5 ) ],
|
||||
"loop": true,
|
||||
"name": &"fly",
|
||||
"name": "fly",
|
||||
"speed": 3.0
|
||||
}, {
|
||||
"frames": [ExtResource( "4" ), ExtResource( "5" )],
|
||||
"frames": [ ExtResource( 6 ), ExtResource( 7 ) ],
|
||||
"loop": true,
|
||||
"name": &"walk",
|
||||
"name": "swim",
|
||||
"speed": 4.0
|
||||
}]
|
||||
} ]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id="2"]
|
||||
radius = 37.0
|
||||
height = 100.0
|
||||
[sub_resource type="CapsuleShape2D" id=2]
|
||||
|
||||
[node name="Mob" type="RigidDynamicBody2D" groups=["mobs"]]
|
||||
custom_solver_bias = 0.0
|
||||
radius = 34.8222
|
||||
height = 28.8308
|
||||
|
||||
[node name="Mob" type="RigidBody2D"]
|
||||
|
||||
input_pickable = true
|
||||
collision_layer = 1
|
||||
collision_mask = 0
|
||||
mode = 0
|
||||
mass = 1.0
|
||||
friction = 1.0
|
||||
bounce = 0.0
|
||||
gravity_scale = 0.0
|
||||
script = ExtResource( "1" )
|
||||
custom_integrator = false
|
||||
continuous_cd = 0
|
||||
contacts_reported = 0
|
||||
contact_monitor = false
|
||||
sleeping = false
|
||||
can_sleep = true
|
||||
linear_velocity = Vector2( 0, 0 )
|
||||
linear_damp = 0.1
|
||||
angular_velocity = 0.0
|
||||
angular_damp = 1.0
|
||||
script = ExtResource( 1 )
|
||||
_sections_unfolded = [ "Angular", "Collision", "Transform" ]
|
||||
__meta__ = {
|
||||
"_edit_group_": true
|
||||
}
|
||||
MIN_SPEED = 150
|
||||
MAX_SPEED = 250
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
scale = Vector2(0.75, 0.75)
|
||||
frames = SubResource( "1" )
|
||||
animation = &"walk"
|
||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="." index="0"]
|
||||
|
||||
scale = Vector2( 0.75, 0.75 )
|
||||
frames = SubResource( 1 )
|
||||
animation = "swim"
|
||||
playing = true
|
||||
_sections_unfolded = [ "Transform" ]
|
||||
|
||||
[node name="Collision" type="CollisionShape2D" parent="." index="1"]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
rotation = 1.5708
|
||||
shape = SubResource( "2" )
|
||||
shape = SubResource( 2 )
|
||||
_sections_unfolded = [ "Transform", "Visibility" ]
|
||||
|
||||
[node name="Visibility" type="VisibilityNotifier2D" parent="." index="2"]
|
||||
|
||||
rect = Rect2( -10, -10, 20, 20 )
|
||||
|
||||
[node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="."]
|
||||
|
||||
[connection signal="screen_exited" from="VisibleOnScreenNotifier2D" to="." method="_on_VisibilityNotifier2D_screen_exited"]
|
||||
|
||||
@@ -2,53 +2,53 @@ extends Area2D
|
||||
|
||||
signal hit
|
||||
|
||||
@export var speed = 400 # How fast the player will move (pixels/sec).
|
||||
var screen_size # Size of the game window.
|
||||
export (int) var SPEED
|
||||
var velocity = Vector2()
|
||||
var screensize
|
||||
|
||||
func _ready():
|
||||
screen_size = get_viewport_rect().size
|
||||
hide()
|
||||
|
||||
|
||||
func _process(delta):
|
||||
var velocity = Vector2.ZERO # The player's movement vector.
|
||||
if Input.is_action_pressed(&"move_right"):
|
||||
velocity.x += 1
|
||||
if Input.is_action_pressed(&"move_left"):
|
||||
velocity.x -= 1
|
||||
if Input.is_action_pressed(&"move_down"):
|
||||
velocity.y += 1
|
||||
if Input.is_action_pressed(&"move_up"):
|
||||
velocity.y -= 1
|
||||
|
||||
if velocity.length() > 0:
|
||||
velocity = velocity.normalized() * speed
|
||||
$AnimatedSprite2D.play()
|
||||
else:
|
||||
$AnimatedSprite2D.stop()
|
||||
|
||||
position += velocity * delta
|
||||
position = position.clamp(Vector2.ZERO, screen_size)
|
||||
|
||||
if velocity.x != 0:
|
||||
$AnimatedSprite2D.animation = &"right"
|
||||
$AnimatedSprite2D.flip_v = false
|
||||
$Trail.rotation = 0
|
||||
$AnimatedSprite2D.flip_h = velocity.x < 0
|
||||
elif velocity.y != 0:
|
||||
$AnimatedSprite2D.animation = &"up"
|
||||
rotation = PI if velocity.y > 0 else 0
|
||||
|
||||
screensize = get_viewport_rect().size
|
||||
|
||||
func start(pos):
|
||||
position = pos
|
||||
rotation = 0
|
||||
show()
|
||||
$CollisionShape2D.disabled = false
|
||||
$Collision.disabled = false
|
||||
|
||||
func _process(delta):
|
||||
velocity = Vector2()
|
||||
if Input.is_action_pressed("ui_right"):
|
||||
velocity.x += 1
|
||||
if Input.is_action_pressed("ui_left"):
|
||||
velocity.x -= 1
|
||||
if Input.is_action_pressed("ui_down"):
|
||||
velocity.y += 1
|
||||
if Input.is_action_pressed("ui_up"):
|
||||
velocity.y -= 1
|
||||
if velocity.length() > 0:
|
||||
velocity = velocity.normalized() * SPEED
|
||||
$AnimatedSprite.play()
|
||||
$Trail.emitting = true
|
||||
else:
|
||||
$AnimatedSprite.stop()
|
||||
$Trail.emitting = false
|
||||
|
||||
position += velocity * delta
|
||||
position.x = clamp(position.x, 0, screensize.x)
|
||||
position.y = clamp(position.y, 0, screensize.y)
|
||||
|
||||
if velocity.x != 0:
|
||||
$AnimatedSprite.animation = "right"
|
||||
$AnimatedSprite.flip_v = false
|
||||
$AnimatedSprite.flip_h = velocity.x < 0
|
||||
elif velocity.y != 0:
|
||||
$AnimatedSprite.animation = "up"
|
||||
$AnimatedSprite.flip_v = velocity.y > 0
|
||||
|
||||
func _on_Player_body_entered( body ):
|
||||
$Collision.disabled = true
|
||||
hide()
|
||||
emit_signal("hit")
|
||||
|
||||
|
||||
|
||||
func _on_Player_body_entered(_body):
|
||||
hide() # Player disappears after being hit.
|
||||
hit.emit()
|
||||
# Must be deferred as we can't change physics properties on a physics callback.
|
||||
$CollisionShape2D.set_deferred(&"disabled", true)
|
||||
|
||||
@@ -1,75 +1,145 @@
|
||||
[gd_scene load_steps=13 format=3 uid="uid://4vwrqjegqwpj"]
|
||||
[gd_scene load_steps=13 format=2]
|
||||
|
||||
[ext_resource type="Script" path="res://Player.gd" id="1"]
|
||||
[ext_resource type="Texture2D" uid="uid://ftkxr8r4qghp" path="res://art/playerGrey_walk1.png" id="2"]
|
||||
[ext_resource type="Texture2D" uid="uid://couyhcegeihme" path="res://art/playerGrey_walk2.png" id="3"]
|
||||
[ext_resource type="Texture2D" uid="uid://b4yyoafu8bi0q" path="res://art/playerGrey_up1.png" id="4"]
|
||||
[ext_resource type="Texture2D" uid="uid://bko65a0nd66st" path="res://art/playerGrey_up2.png" id="5"]
|
||||
[ext_resource path="res://Player.gd" type="Script" id=1]
|
||||
[ext_resource path="res://art/playerGrey_walk1.png" type="Texture" id=2]
|
||||
[ext_resource path="res://art/playerGrey_walk2.png" type="Texture" id=3]
|
||||
[ext_resource path="res://art/playerGrey_up1.png" type="Texture" id=4]
|
||||
[ext_resource path="res://art/playerGrey_up2.png" type="Texture" id=5]
|
||||
|
||||
[sub_resource type="SpriteFrames" id="1"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("2")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("3")
|
||||
}],
|
||||
[sub_resource type="SpriteFrames" id=1]
|
||||
|
||||
animations = [ {
|
||||
"frames": [ ExtResource( 2 ), ExtResource( 3 ) ],
|
||||
"loop": true,
|
||||
"name": &"right",
|
||||
"name": "right",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("4")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("5")
|
||||
}],
|
||||
"frames": [ ExtResource( 4 ), ExtResource( 5 ) ],
|
||||
"loop": true,
|
||||
"name": &"up",
|
||||
"name": "up",
|
||||
"speed": 5.0
|
||||
}]
|
||||
} ]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id="2"]
|
||||
radius = 27.0
|
||||
height = 68.0
|
||||
[sub_resource type="CapsuleShape2D" id=2]
|
||||
|
||||
[sub_resource type="Gradient" id="3"]
|
||||
colors = PackedColorArray(1, 1, 1, 0.501961, 1, 1, 1, 0)
|
||||
custom_solver_bias = 0.0
|
||||
radius = 26.5155
|
||||
height = 13.8847
|
||||
|
||||
[sub_resource type="GradientTexture1D" id="4"]
|
||||
gradient = SubResource("3")
|
||||
[sub_resource type="Gradient" id=3]
|
||||
|
||||
[sub_resource type="Curve" id="5"]
|
||||
_data = [Vector2(0.00501098, 0.5), 0.0, 0.0, 0, 0, Vector2(0.994989, 0.324), 0.0, 0.0, 0, 0]
|
||||
point_count = 2
|
||||
offsets = PoolRealArray( 0, 1 )
|
||||
colors = PoolColorArray( 1, 1, 1, 0.523804, 1, 1, 1, 0 )
|
||||
|
||||
[sub_resource type="CurveTexture" id="6"]
|
||||
curve = SubResource("5")
|
||||
[sub_resource type="GradientTexture" id=4]
|
||||
|
||||
[sub_resource type="ParticleProcessMaterial" id="7"]
|
||||
gravity = Vector3(0, 0, 0)
|
||||
scale_curve = SubResource("6")
|
||||
color_ramp = SubResource("4")
|
||||
flags = 4
|
||||
gradient = SubResource( 3 )
|
||||
width = 2048
|
||||
|
||||
[sub_resource type="Curve" id=5]
|
||||
|
||||
min_value = 0.0
|
||||
max_value = 1.0
|
||||
bake_resolution = 100
|
||||
_data = [ Vector2( 0, 0.446289 ), 0.0, 0.0, 0, 0, Vector2( 1, 0.306641 ), 0.0, 0.0, 0, 0 ]
|
||||
|
||||
[sub_resource type="CurveTexture" id=6]
|
||||
|
||||
flags = 4
|
||||
width = 2048
|
||||
curve = SubResource( 5 )
|
||||
|
||||
[sub_resource type="ParticlesMaterial" id=7]
|
||||
|
||||
render_priority = 0
|
||||
trail_divisor = 1
|
||||
emission_shape = 0
|
||||
flag_align_y = false
|
||||
flag_rotate_y = false
|
||||
flag_disable_z = true
|
||||
spread = 45.0
|
||||
flatness = 0.0
|
||||
gravity = Vector3( 0, 0, 0 )
|
||||
initial_velocity = 1.0
|
||||
initial_velocity_random = 0.0
|
||||
angular_velocity = 1.56945e-43
|
||||
angular_velocity_random = 0.0
|
||||
orbit_velocity = 0.0
|
||||
orbit_velocity_random = 0.0
|
||||
linear_accel = 0.0
|
||||
linear_accel_random = 0.0
|
||||
radial_accel = 0.0
|
||||
radial_accel_random = 0.0
|
||||
tangential_accel = 0.0
|
||||
tangential_accel_random = 0.0
|
||||
damping = 0.0
|
||||
damping_random = 0.0
|
||||
angle = 0.0
|
||||
angle_random = 0.0
|
||||
scale = 1.0
|
||||
scale_random = 0.0
|
||||
scale_curve = SubResource( 6 )
|
||||
color_ramp = SubResource( 4 )
|
||||
hue_variation = 0.0
|
||||
hue_variation_random = 0.0
|
||||
anim_speed = 0.0
|
||||
anim_speed_random = 0.0
|
||||
anim_offset = 0.0
|
||||
anim_offset_random = 0.0
|
||||
anim_loop = false
|
||||
_sections_unfolded = [ "Color", "Gravity", "Scale" ]
|
||||
|
||||
[node name="Player" type="Area2D"]
|
||||
z_index = 10
|
||||
script = ExtResource("1")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
scale = Vector2(0.5, 0.5)
|
||||
sprite_frames = SubResource("1")
|
||||
animation = &"right"
|
||||
input_pickable = true
|
||||
gravity_vec = Vector2( 0, 1 )
|
||||
gravity = 98.0
|
||||
linear_damp = 0.1
|
||||
angular_damp = 1.0
|
||||
audio_bus_override = false
|
||||
audio_bus_name = "Master"
|
||||
script = ExtResource( 1 )
|
||||
_sections_unfolded = [ "Transform" ]
|
||||
__meta__ = {
|
||||
"_edit_group_": true
|
||||
}
|
||||
SPEED = 400
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("2")
|
||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="." index="0"]
|
||||
|
||||
[node name="Trail" type="GPUParticles2D" parent="."]
|
||||
z_index = -1
|
||||
scale = Vector2( 0.5, 0.5 )
|
||||
frames = SubResource( 1 )
|
||||
animation = "right"
|
||||
_sections_unfolded = [ "Region", "Transform", "Z" ]
|
||||
|
||||
[node name="Collision" type="CollisionShape2D" parent="." index="1"]
|
||||
|
||||
shape = SubResource( 2 )
|
||||
|
||||
[node name="Trail" type="Particles2D" parent="." index="2"]
|
||||
|
||||
show_behind_parent = true
|
||||
emitting = true
|
||||
amount = 10
|
||||
process_material = SubResource("7")
|
||||
texture = ExtResource("2")
|
||||
lifetime = 1.0
|
||||
one_shot = false
|
||||
preprocess = 0.0
|
||||
speed_scale = 2.0
|
||||
explosiveness = 0.0
|
||||
randomness = 0.0
|
||||
fixed_fps = 0
|
||||
fract_delta = true
|
||||
visibility_rect = Rect2( -100, -100, 200, 200 )
|
||||
local_coords = false
|
||||
draw_order = 0
|
||||
process_material = SubResource( 7 )
|
||||
texture = ExtResource( 4 )
|
||||
normal_map = null
|
||||
h_frames = 1
|
||||
v_frames = 1
|
||||
_sections_unfolded = [ "Drawing", "Process Material", "Textures", "Time", "Transform", "Visibility" ]
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_Player_body_entered"]
|
||||
|
||||
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
# Dodge the Creeps
|
||||
|
||||
This is a simple game where your character must move
|
||||
and avoid the enemies for as long as possible.
|
||||
|
||||
This is a finished version of the game featured in the
|
||||
["Your first 2D game"](https://docs.godotengine.org/en/latest/getting_started/first_2d_game/index.html)
|
||||
tutorial in the documentation. For more details,
|
||||
consider following the tutorial in the documentation.
|
||||
|
||||
Language: GDScript
|
||||
|
||||
Renderer: Vulkan Mobile
|
||||
|
||||
Note: There is a C# version available [here](https://github.com/godotengine/godot-demo-projects/tree/master/mono/dodge_the_creeps).
|
||||
|
||||
Note: There is a GDNative C++ version available [here](https://github.com/godotengine/gdnative-demos/tree/master/cpp/dodge_the_creeps).
|
||||
|
||||
Check out this demo on the asset library: https://godotengine.org/asset-library/asset/515
|
||||
|
||||
## Screenshots
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
## Copying
|
||||
|
||||
`art/House In a Forest Loop.ogg` Copyright © 2012 [HorrorPen](https://opengameart.org/users/horrorpen), [CC-BY 3.0: Attribution](http://creativecommons.org/licenses/by/3.0/). Source: https://opengameart.org/content/loop-house-in-a-forest
|
||||
|
||||
Images are from "Abstract Platformer". Created in 2016 by kenney.nl, [CC0 1.0 Universal](http://creativecommons.org/publicdomain/zero/1.0/). Source: https://www.kenney.nl/assets/abstract-platformer
|
||||
|
||||
Font is "Xolonium". Copyright © 2011-2016 Severin Meyer <sev.ch@web.de>, with Reserved Font Name Xolonium, SIL open font license version 1.1. Details are in `fonts/LICENSE.txt`.
|
||||
@@ -1,19 +1,14 @@
|
||||
[remap]
|
||||
|
||||
importer="oggvorbisstr"
|
||||
type="AudioStreamOggVorbis"
|
||||
uid="uid://q2pf4fr8d0ks"
|
||||
path="res://.godot/imported/House In a Forest Loop.ogg-1a6a72ae843ad792b7039931227e8d50.oggvorbisstr"
|
||||
importer="ogg_vorbis"
|
||||
type="AudioStreamOGGVorbis"
|
||||
path="res://.import/House In a Forest Loop.ogg-1a6a72ae843ad792b7039931227e8d50.oggstr"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/House In a Forest Loop.ogg"
|
||||
dest_files=["res://.godot/imported/House In a Forest Loop.ogg-1a6a72ae843ad792b7039931227e8d50.oggvorbisstr"]
|
||||
source_md5="c395b0cc351a71713417cf862282849f"
|
||||
|
||||
[params]
|
||||
|
||||
loop=true
|
||||
loop_offset=0
|
||||
bpm=0
|
||||
beat_count=0
|
||||
bar_beats=4
|
||||
|
||||
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 4.4 KiB |
@@ -1,34 +1,28 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://yqglrrsx7j1f"
|
||||
path="res://.godot/imported/enemyFlyingAlt_1.png-559f599b16c69b112c1b53f6332e9489.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
type="StreamTexture"
|
||||
path="res://.import/enemyFlyingAlt_1.png-559f599b16c69b112c1b53f6332e9489.stex"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/enemyFlyingAlt_1.png"
|
||||
dest_files=["res://.godot/imported/enemyFlyingAlt_1.png-559f599b16c69b112c1b53f6332e9489.ctex"]
|
||||
source_md5="64d9fdc23f76112a64a283673e3fd8dd"
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/hdr_mode=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
process/HDR_as_SRGB=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
||||
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 3.7 KiB |
@@ -1,34 +1,28 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bpot8awhdn6ph"
|
||||
path="res://.godot/imported/enemyFlyingAlt_2.png-31dc7310eda6e1b721224f3cd932c076.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
type="StreamTexture"
|
||||
path="res://.import/enemyFlyingAlt_2.png-31dc7310eda6e1b721224f3cd932c076.stex"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/enemyFlyingAlt_2.png"
|
||||
dest_files=["res://.godot/imported/enemyFlyingAlt_2.png-31dc7310eda6e1b721224f3cd932c076.ctex"]
|
||||
source_md5="5281b0d2b947deb09cbf95ecf9628ae7"
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/hdr_mode=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
process/HDR_as_SRGB=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
||||
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 3.5 KiB |
@@ -1,34 +1,28 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://5lvm88ij4jqn"
|
||||
path="res://.godot/imported/enemySwimming_1.png-dd0e11759dc3d624c8a704f6e98a3d80.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
type="StreamTexture"
|
||||
path="res://.import/enemySwimming_1.png-dd0e11759dc3d624c8a704f6e98a3d80.stex"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/enemySwimming_1.png"
|
||||
dest_files=["res://.godot/imported/enemySwimming_1.png-dd0e11759dc3d624c8a704f6e98a3d80.ctex"]
|
||||
source_md5="5e557d1bd564dd553650de1c38746ed9"
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/hdr_mode=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
process/HDR_as_SRGB=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
||||
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 3.8 KiB |
@@ -1,34 +1,28 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bng45cvsgufqc"
|
||||
path="res://.godot/imported/enemySwimming_2.png-4c0cbc0732264c4ea3290340bd4a0a62.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
type="StreamTexture"
|
||||
path="res://.import/enemySwimming_2.png-4c0cbc0732264c4ea3290340bd4a0a62.stex"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/enemySwimming_2.png"
|
||||
dest_files=["res://.godot/imported/enemySwimming_2.png-4c0cbc0732264c4ea3290340bd4a0a62.ctex"]
|
||||
source_md5="d04b001ba2f4ac6884fdbe44b55fa656"
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/hdr_mode=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
process/HDR_as_SRGB=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
||||
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 3.4 KiB |
@@ -1,34 +1,28 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bu4221t7qpa7d"
|
||||
path="res://.godot/imported/enemyWalking_1.png-5af6eedbe61b701677d490ffdc1e6471.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
type="StreamTexture"
|
||||
path="res://.import/enemyWalking_1.png-5af6eedbe61b701677d490ffdc1e6471.stex"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/enemyWalking_1.png"
|
||||
dest_files=["res://.godot/imported/enemyWalking_1.png-5af6eedbe61b701677d490ffdc1e6471.ctex"]
|
||||
source_md5="0e417b74e72f5d8f4aca0e557a735643"
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/hdr_mode=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
process/HDR_as_SRGB=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
||||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 3.7 KiB |
@@ -1,34 +1,28 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://booij5t7h4efb"
|
||||
path="res://.godot/imported/enemyWalking_2.png-67c480ed60c35e95f5acb0436246b935.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
type="StreamTexture"
|
||||
path="res://.import/enemyWalking_2.png-67c480ed60c35e95f5acb0436246b935.stex"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/enemyWalking_2.png"
|
||||
dest_files=["res://.godot/imported/enemyWalking_2.png-67c480ed60c35e95f5acb0436246b935.ctex"]
|
||||
source_md5="838f40a8b77a0cb387dc5e5aff6bd8d5"
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/hdr_mode=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
process/HDR_as_SRGB=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://dw26fpygeag8o"
|
||||
path="res://.godot/imported/gameover.wav-98c95c744b35280048c2bd093cf8a356.sample"
|
||||
type="AudioStreamSample"
|
||||
path="res://.import/gameover.wav-98c95c744b35280048c2bd093cf8a356.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/gameover.wav"
|
||||
dest_files=["res://.godot/imported/gameover.wav-98c95c744b35280048c2bd093cf8a356.sample"]
|
||||
source_md5="fe94a3a7558cff917a5500a1298fdcac"
|
||||
|
||||
[params]
|
||||
|
||||
@@ -18,7 +16,5 @@ force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=true
|
||||
edit/normalize=true
|
||||
edit/loop_mode=0
|
||||
edit/loop_begin=0
|
||||
edit/loop_end=-1
|
||||
edit/loop=false
|
||||
compress/mode=0
|
||||
|
||||
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 4.8 KiB |
@@ -1,34 +1,28 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://b4yyoafu8bi0q"
|
||||
path="res://.godot/imported/playerGrey_up1.png-6bd114d0a6beac91f48e3a7314d44564.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
type="StreamTexture"
|
||||
path="res://.import/playerGrey_up1.png-6bd114d0a6beac91f48e3a7314d44564.stex"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/playerGrey_up1.png"
|
||||
dest_files=["res://.godot/imported/playerGrey_up1.png-6bd114d0a6beac91f48e3a7314d44564.ctex"]
|
||||
source_md5="f84241d41055080a3393c9a8619f172b"
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/hdr_mode=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
process/HDR_as_SRGB=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
||||
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 4.6 KiB |
@@ -1,34 +1,28 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bko65a0nd66st"
|
||||
path="res://.godot/imported/playerGrey_up2.png-d6aba85f5f2675ebc7045efa7552ee79.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
type="StreamTexture"
|
||||
path="res://.import/playerGrey_up2.png-d6aba85f5f2675ebc7045efa7552ee79.stex"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/playerGrey_up2.png"
|
||||
dest_files=["res://.godot/imported/playerGrey_up2.png-d6aba85f5f2675ebc7045efa7552ee79.ctex"]
|
||||
source_md5="57618c302a312d248705c7f045978765"
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/hdr_mode=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
process/HDR_as_SRGB=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
||||
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 4.7 KiB |
@@ -1,34 +1,28 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://ftkxr8r4qghp"
|
||||
path="res://.godot/imported/playerGrey_walk1.png-c4773fe7a7bf85d7ab732eb4458c2742.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
type="StreamTexture"
|
||||
path="res://.import/playerGrey_walk1.png-c4773fe7a7bf85d7ab732eb4458c2742.stex"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/playerGrey_walk1.png"
|
||||
dest_files=["res://.godot/imported/playerGrey_walk1.png-c4773fe7a7bf85d7ab732eb4458c2742.ctex"]
|
||||
source_md5="7892ed98ba910fbda0d37266127e96bb"
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/hdr_mode=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
process/HDR_as_SRGB=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
||||
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 5.2 KiB |
@@ -1,34 +1,28 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://couyhcegeihme"
|
||||
path="res://.godot/imported/playerGrey_walk2.png-34d2d916366100182d08037c51884043.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
type="StreamTexture"
|
||||
path="res://.import/playerGrey_walk2.png-34d2d916366100182d08037c51884043.stex"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/playerGrey_walk2.png"
|
||||
dest_files=["res://.godot/imported/playerGrey_walk2.png-34d2d916366100182d08037c51884043.ctex"]
|
||||
source_md5="9fc73e1224a6b16d8fb5d0f667e3aed2"
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/hdr_mode=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
process/HDR_as_SRGB=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
||||
|
||||
BIN
2d/dodge_the_creeps/art/set3_tiles.png
Executable file
|
After Width: | Height: | Size: 6.8 KiB |
28
2d/dodge_the_creeps/art/set3_tiles.png.import
Normal file
@@ -0,0 +1,28 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/set3_tiles.png-7dd06b1fc0bcfaa06e9dd732f61382a2.stex"
|
||||
|
||||
[deps]
|
||||
|
||||
source_md5="eef34d896b231438a2d97707c0ab06a2"
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
2
2d/dodge_the_creeps/attributions.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
"Abstract Platformer" by kenney.nl is licensed under http://creativecommons.org/publicdomain/zero/1.0/
|
||||
"House in a Forest Loop" by https://opengameart.org/users/horrorpen is licensed under http://creativecommons.org/licenses/by/3.0/
|
||||
102
2d/dodge_the_creeps/default_env.tres
Normal file
@@ -0,0 +1,102 @@
|
||||
[gd_resource type="Environment" load_steps=2 format=2]
|
||||
|
||||
[sub_resource type="ProceduralSky" id=1]
|
||||
|
||||
radiance_size = 4
|
||||
sky_top_color = Color( 0.0470588, 0.454902, 0.976471, 1 )
|
||||
sky_horizon_color = Color( 0.556863, 0.823529, 0.909804, 1 )
|
||||
sky_curve = 0.25
|
||||
sky_energy = 1.0
|
||||
ground_bottom_color = Color( 0.101961, 0.145098, 0.188235, 1 )
|
||||
ground_horizon_color = Color( 0.482353, 0.788235, 0.952941, 1 )
|
||||
ground_curve = 0.01
|
||||
ground_energy = 1.0
|
||||
sun_color = Color( 1, 1, 1, 1 )
|
||||
sun_latitude = 35.0
|
||||
sun_longitude = 0.0
|
||||
sun_angle_min = 1.0
|
||||
sun_angle_max = 100.0
|
||||
sun_curve = 0.05
|
||||
sun_energy = 16.0
|
||||
texture_size = 2
|
||||
|
||||
[resource]
|
||||
|
||||
background_mode = 2
|
||||
background_sky = SubResource( 1 )
|
||||
background_sky_custom_fov = 0.0
|
||||
background_color = Color( 0, 0, 0, 1 )
|
||||
background_energy = 1.0
|
||||
background_canvas_max_layer = 0
|
||||
ambient_light_color = Color( 0, 0, 0, 1 )
|
||||
ambient_light_energy = 1.0
|
||||
ambient_light_sky_contribution = 0.0
|
||||
fog_enabled = false
|
||||
fog_color = Color( 0.5, 0.6, 0.7, 1 )
|
||||
fog_sun_color = Color( 1, 0.9, 0.7, 1 )
|
||||
fog_sun_amount = 0.0
|
||||
fog_depth_enabled = true
|
||||
fog_depth_begin = 10.0
|
||||
fog_depth_curve = 1.0
|
||||
fog_transmit_enabled = false
|
||||
fog_transmit_curve = 1.0
|
||||
fog_height_enabled = false
|
||||
fog_height_min = 0.0
|
||||
fog_height_max = 100.0
|
||||
fog_height_curve = 1.0
|
||||
tonemap_mode = 0
|
||||
tonemap_exposure = 1.0
|
||||
tonemap_white = 1.0
|
||||
auto_exposure_enabled = false
|
||||
auto_exposure_scale = 0.4
|
||||
auto_exposure_min_luma = 0.05
|
||||
auto_exposure_max_luma = 8.0
|
||||
auto_exposure_speed = 0.5
|
||||
ss_reflections_enabled = false
|
||||
ss_reflections_max_steps = 64
|
||||
ss_reflections_fade_in = 0.15
|
||||
ss_reflections_fade_out = 2.0
|
||||
ss_reflections_depth_tolerance = 0.2
|
||||
ss_reflections_roughness = true
|
||||
ssao_enabled = false
|
||||
ssao_radius = 1.0
|
||||
ssao_intensity = 1.0
|
||||
ssao_radius2 = 0.0
|
||||
ssao_intensity2 = 1.0
|
||||
ssao_bias = 0.01
|
||||
ssao_light_affect = 0.0
|
||||
ssao_color = Color( 0, 0, 0, 1 )
|
||||
ssao_quality = 0
|
||||
ssao_blur = 1
|
||||
ssao_edge_sharpness = 4.0
|
||||
dof_blur_far_enabled = false
|
||||
dof_blur_far_distance = 10.0
|
||||
dof_blur_far_transition = 5.0
|
||||
dof_blur_far_amount = 0.1
|
||||
dof_blur_far_quality = 1
|
||||
dof_blur_near_enabled = false
|
||||
dof_blur_near_distance = 2.0
|
||||
dof_blur_near_transition = 1.0
|
||||
dof_blur_near_amount = 0.1
|
||||
dof_blur_near_quality = 1
|
||||
glow_enabled = false
|
||||
glow_levels/1 = false
|
||||
glow_levels/2 = false
|
||||
glow_levels/3 = true
|
||||
glow_levels/4 = false
|
||||
glow_levels/5 = true
|
||||
glow_levels/6 = false
|
||||
glow_levels/7 = false
|
||||
glow_intensity = 0.8
|
||||
glow_strength = 1.0
|
||||
glow_bloom = 0.0
|
||||
glow_blend_mode = 2
|
||||
glow_hdr_threshold = 1.0
|
||||
glow_hdr_scale = 2.0
|
||||
glow_bicubic_upscale = false
|
||||
adjustment_enabled = false
|
||||
adjustment_brightness = 1.0
|
||||
adjustment_contrast = 1.0
|
||||
adjustment_saturation = 1.0
|
||||
_sections_unfolded = [ "Background" ]
|
||||
|
||||
0
2d/dodge_the_creeps/fonts/FONTLOG.txt
Normal file → Executable file
@@ -1,6 +0,0 @@
|
||||
[gd_resource type="Font" load_steps=2 format=3 uid="uid://dyjc58f6sdms0"]
|
||||
|
||||
[ext_resource type="FontData" uid="uid://cit6gwe5px1q8" path="res://fonts/Xolonium-Regular.ttf" id="1_mnk3h"]
|
||||
|
||||
[resource]
|
||||
data/0 = ExtResource( "1_mnk3h" )
|
||||
@@ -1,33 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="font_data_dynamic"
|
||||
type="FontFile"
|
||||
uid="uid://cit6gwe5px1q8"
|
||||
path="res://.godot/imported/Xolonium-Regular.ttf-bc2981e3069cff4c34dd7c8e2bb73fba.fontdata"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://fonts/Xolonium-Regular.ttf"
|
||||
dest_files=["res://.godot/imported/Xolonium-Regular.ttf-bc2981e3069cff4c34dd7c8e2bb73fba.fontdata"]
|
||||
|
||||
[params]
|
||||
|
||||
Rendering=null
|
||||
antialiasing=1
|
||||
generate_mipmaps=false
|
||||
multichannel_signed_distance_field=false
|
||||
msdf_pixel_range=8
|
||||
msdf_size=48
|
||||
allow_system_fallback=true
|
||||
force_autohinter=false
|
||||
hinting=1
|
||||
subpixel_positioning=1
|
||||
oversampling=0.0
|
||||
Fallbacks=null
|
||||
fallbacks=[]
|
||||
Compress=null
|
||||
compress=true
|
||||
preload=[]
|
||||
language_support={}
|
||||
script_support={}
|
||||
opentype_features={}
|
||||
BIN
2d/dodge_the_creeps/icon.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
28
2d/dodge_the_creeps/icon.png.import
Normal file
@@ -0,0 +1,28 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
|
||||
|
||||
[deps]
|
||||
|
||||
source_md5="7b0d811088c13a3b6d79f9895b9f2935"
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
Before Width: | Height: | Size: 6.9 KiB |
@@ -1,34 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://brwp8bimc75uu"
|
||||
path="res://.godot/imported/icon.webp-e94f9a68b0f625a567a797079e4d325f.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://icon.webp"
|
||||
dest_files=["res://.godot/imported/icon.webp-e94f9a68b0f625a567a797079e4d325f.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
@@ -6,75 +6,24 @@
|
||||
; [section] ; section goes between []
|
||||
; param=value ; assign values to parameters
|
||||
|
||||
config_version=5
|
||||
config_version=3
|
||||
|
||||
[application]
|
||||
|
||||
config/name="Dodge the Creeps"
|
||||
config/description="This is a simple game where your character must move
|
||||
and avoid the enemies for as long as possible.
|
||||
|
||||
This is a finished version of the game featured in the 'Your first 2D game'
|
||||
tutorial in the documentation. For more details, consider
|
||||
following the tutorial in the documentation."
|
||||
config/tags=PackedStringArray("2d", "demo", "official")
|
||||
run/main_scene="res://Main.tscn"
|
||||
config/features=PackedStringArray("4.2")
|
||||
config/icon="res://icon.webp"
|
||||
|
||||
[debug]
|
||||
|
||||
gdscript/warnings/redundant_await=false
|
||||
config/icon="res://icon.png"
|
||||
|
||||
[display]
|
||||
|
||||
window/size/viewport_width=480
|
||||
window/size/viewport_height=720
|
||||
window/size/window_width_override=480
|
||||
window/size/window_height_override=720
|
||||
window/stretch/mode="canvas_items"
|
||||
window/size/width=480
|
||||
window/size/height=720
|
||||
window/size/resizable=false
|
||||
|
||||
[input]
|
||||
[gdnative]
|
||||
|
||||
move_left={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194319,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null)
|
||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":-1.0,"script":null)
|
||||
]
|
||||
}
|
||||
move_right={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194321,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":15,"pressure":0.0,"pressed":false,"script":null)
|
||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":1.0,"script":null)
|
||||
]
|
||||
}
|
||||
move_up={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194320,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null)
|
||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":-1.0,"script":null)
|
||||
]
|
||||
}
|
||||
move_down={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194322,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null)
|
||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":1.0,"script":null)
|
||||
]
|
||||
}
|
||||
start_game={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194309,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
singletons=[ ]
|
||||
|
||||
[rendering]
|
||||
|
||||
renderer/rendering_method="mobile"
|
||||
environment/default_environment="res://default_env.tres"
|
||||
|
||||
|
Before Width: | Height: | Size: 12 KiB |
@@ -1,13 +0,0 @@
|
||||
# Dynamic TileMap Layers
|
||||
|
||||
Example of how to make a fake wall using TileMap's
|
||||
`_tile_data_runtime_update()` method. It shows how
|
||||
to disable collisions per layer.
|
||||
|
||||
Language: GDScript
|
||||
|
||||
Renderer: OpenGL
|
||||
|
||||
## Screenshots
|
||||
|
||||

|
||||
|
Before Width: | Height: | Size: 4.3 KiB |
@@ -1,34 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bpov140lx7at3"
|
||||
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://icon.png"
|
||||
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
|
Before Width: | Height: | Size: 1.8 KiB |
@@ -1,34 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cs8h2qyuakmko"
|
||||
path="res://.godot/imported/obstacle.png-06287f6b2d26dd03335fd87ab78c2cc2.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://level/obstacle.png"
|
||||
dest_files=["res://.godot/imported/obstacle.png-06287f6b2d26dd03335fd87ab78c2cc2.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
@@ -1,57 +0,0 @@
|
||||
extends TileMap
|
||||
|
||||
|
||||
var secret_layer: int # You can have multiple layers if you make this an array.
|
||||
var player_in_secret: bool
|
||||
var layer_alpha := 1.0
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
for i in get_layers_count(): # Find the secret layer by name.
|
||||
if get_layer_name(i) == "Secret":
|
||||
secret_layer = i
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
set_process(false)
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if player_in_secret:
|
||||
if layer_alpha > 0.3:
|
||||
layer_alpha = move_toward(layer_alpha, 0.3, delta) # Animate the layer transparency.
|
||||
set_layer_modulate(secret_layer, Color(1, 1, 1, layer_alpha))
|
||||
else:
|
||||
set_process(false)
|
||||
else:
|
||||
if layer_alpha < 1.0:
|
||||
layer_alpha = move_toward(layer_alpha, 1.0, delta)
|
||||
set_layer_modulate(secret_layer, Color(1, 1, 1, layer_alpha))
|
||||
else:
|
||||
set_process(false)
|
||||
|
||||
|
||||
func _use_tile_data_runtime_update(layer: int, _coords: Vector2i) -> bool:
|
||||
if layer == secret_layer:
|
||||
return true
|
||||
return false
|
||||
|
||||
|
||||
func _tile_data_runtime_update(_layer: int, _coords: Vector2i, tile_data: TileData) -> void:
|
||||
tile_data.set_collision_polygons_count(0, 0) # Remove collision for secret layer.
|
||||
|
||||
|
||||
func _on_secret_detector_body_entered(body: Node2D) -> void:
|
||||
if not body is CharacterBody2D: # Detect player only.
|
||||
return
|
||||
|
||||
player_in_secret = true
|
||||
set_process(true)
|
||||
|
||||
|
||||
func _on_secret_detector_body_exited(body: Node2D) -> void:
|
||||
if not body is CharacterBody2D:
|
||||
return
|
||||
|
||||
player_in_secret = false
|
||||
set_process(true)
|
||||
@@ -1,32 +0,0 @@
|
||||
extends CharacterBody2D
|
||||
|
||||
const WALK_FORCE = 600
|
||||
const WALK_MAX_SPEED = 200
|
||||
const STOP_FORCE = 1300
|
||||
const JUMP_SPEED = 200
|
||||
|
||||
@onready var gravity = ProjectSettings.get_setting("physics/2d/default_gravity")
|
||||
|
||||
func _physics_process(delta):
|
||||
# Horizontal movement code. First, get the player's input.
|
||||
var walk = WALK_FORCE * (Input.get_axis(&"move_left", &"move_right"))
|
||||
# Slow down the player if they're not trying to move.
|
||||
if abs(walk) < WALK_FORCE * 0.2:
|
||||
# The velocity, slowed down a bit, and then reassigned.
|
||||
velocity.x = move_toward(velocity.x, 0, STOP_FORCE * delta)
|
||||
else:
|
||||
velocity.x += walk * delta
|
||||
# Clamp to the maximum horizontal movement speed.
|
||||
velocity.x = clamp(velocity.x, -WALK_MAX_SPEED, WALK_MAX_SPEED)
|
||||
|
||||
# Vertical movement code. Apply gravity.
|
||||
velocity.y += gravity * delta
|
||||
|
||||
# Move based on the velocity and snap to the ground.
|
||||
# TODO: This information should be set to the CharacterBody properties instead of arguments: snap, Vector2.DOWN, Vector2.UP
|
||||
# TODO: Rename velocity to linear_velocity in the rest of the script.
|
||||
move_and_slide()
|
||||
|
||||
# Check for jumping. is_on_floor() must be called after movement code.
|
||||
if is_on_floor() and Input.is_action_just_pressed(&"jump"):
|
||||
velocity.y = -JUMP_SPEED
|
||||
@@ -1,34 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dfb8rr2fakwgp"
|
||||
path="res://.godot/imported/player.png-1ad27fc2a62fa126eae918723933dd6f.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://player/player.png"
|
||||
dest_files=["res://.godot/imported/player.png-1ad27fc2a62fa126eae918723933dd6f.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
@@ -1,17 +0,0 @@
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://player/player.gd" type="Script" id=1]
|
||||
[ext_resource path="res://player/player.png" type="Texture2D" id=2]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2(7, 7)
|
||||
|
||||
[node name="Player" type="CharacterBody2D"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(-0.315559, 0.157784)
|
||||
shape = SubResource( 1 )
|
||||
@@ -1,66 +0,0 @@
|
||||
; Engine configuration file.
|
||||
; It's best edited using the editor UI and not directly,
|
||||
; since the parameters that go here are not all obvious.
|
||||
;
|
||||
; Format:
|
||||
; [section] ; section goes between []
|
||||
; param=value ; assign values to parameters
|
||||
|
||||
config_version=5
|
||||
|
||||
[application]
|
||||
|
||||
config/name="Dynamic TileMap Layers"
|
||||
config/description="Example of how to make a kinematic character controller in 2D using
|
||||
CharacterBody2D. The character moves around, is affected by moving
|
||||
platforms, can jump through one-way collision platforms, etc."
|
||||
run/main_scene="res://world.tscn"
|
||||
config/features=PackedStringArray("4.2")
|
||||
config/icon="res://icon.png"
|
||||
|
||||
[display]
|
||||
|
||||
window/size/viewport_width=530
|
||||
window/size/viewport_height=495
|
||||
window/stretch/mode="canvas_items"
|
||||
window/stretch/aspect="expand"
|
||||
|
||||
[input]
|
||||
|
||||
jump={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":0,"pressure":0.0,"pressed":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null)
|
||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":-1.0,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":32,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194320,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
move_left={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null)
|
||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":-1.0,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194319,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
move_right={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":15,"pressure":0.0,"pressed":false,"script":null)
|
||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":1.0,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194321,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[physics]
|
||||
|
||||
common/physics_ticks_per_second=120
|
||||
2d/default_gravity=500
|
||||
|
||||
[rendering]
|
||||
|
||||
renderer/rendering_method="gl_compatibility"
|
||||
environment/defaults/default_clear_color=Color(0.156863, 0.133333, 0.25098, 1)
|
||||
anti_aliasing/quality/msaa_2d=2
|
||||
|
Before Width: | Height: | Size: 11 KiB |
@@ -1,57 +0,0 @@
|
||||
[gd_scene load_steps=8 format=3 uid="uid://de7qapkqfycxl"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://cs8h2qyuakmko" path="res://level/obstacle.png" id="2"]
|
||||
[ext_resource type="Script" path="res://level/tile_map.gd" id="2_q8fhk"]
|
||||
[ext_resource type="PackedScene" path="res://player/player.tscn" id="3"]
|
||||
|
||||
[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_on5ov"]
|
||||
|
||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_vnjib"]
|
||||
texture = ExtResource("2")
|
||||
0:0/0 = 0
|
||||
0:0/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
0:0/0/physics_layer_0/angular_velocity = 0.0
|
||||
0:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
1:0/0 = 0
|
||||
1:0/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
1:0/0/physics_layer_0/angular_velocity = 0.0
|
||||
|
||||
[sub_resource type="TileSet" id="TileSet_xqlka"]
|
||||
physics_layer_0/collision_layer = 1
|
||||
physics_layer_0/physics_material = SubResource("PhysicsMaterial_on5ov")
|
||||
sources/0 = SubResource("TileSetAtlasSource_vnjib")
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_a2gec"]
|
||||
size = Vector2(112, 48)
|
||||
|
||||
[node name="World" type="Node2D"]
|
||||
|
||||
[node name="TileMap" type="TileMap" parent="."]
|
||||
z_index = 1
|
||||
tile_set = SubResource("TileSet_xqlka")
|
||||
format = 2
|
||||
layer_0/name = "Ground"
|
||||
layer_0/tile_data = PackedInt32Array(0, 0, 0, 65536, 0, 0, 131072, 0, 0, 196608, 0, 0, 262144, 0, 0, 327680, 0, 0, 393216, 0, 0, 458752, 0, 0, 524288, 0, 0, 589824, 0, 0, 655360, 0, 0, 720896, 0, 0, 786432, 0, 0, 851968, 0, 0, 917504, 0, 0, 983040, 0, 0, 1048576, 0, 0, 1114112, 0, 0, 1179648, 0, 0, 1245184, 0, 0, 1310720, 0, 0, 1376256, 0, 0, 1441792, 0, 0, 1507328, 0, 0, 1572864, 0, 0, 1638400, 0, 0, 1703936, 0, 0, 1769472, 0, 0, 1835008, 0, 0, 1900544, 0, 0, 1966080, 0, 0, 1, 0, 0, 65537, 0, 0, 131073, 0, 0, 196609, 0, 0, 262145, 0, 0, 327681, 0, 0, 393217, 0, 0, 458753, 0, 0, 524289, 0, 0, 589825, 0, 0, 655361, 0, 0, 720897, 0, 0, 786433, 0, 0, 851969, 0, 0, 917505, 0, 0, 983041, 0, 0, 1048577, 0, 0, 1114113, 0, 0, 1179649, 0, 0, 1245185, 0, 0, 1310721, 0, 0, 1376257, 0, 0, 1441793, 0, 0, 1507329, 0, 0, 1572865, 0, 0, 1638401, 0, 0, 1703937, 0, 0, 1769473, 0, 0, 1835009, 0, 0, 1900545, 0, 0, 1966081, 0, 0, 2, 0, 0, 65538, 0, 0, 1900546, 0, 0, 1966082, 0, 0, 3, 0, 0, 65539, 0, 0, 1900547, 0, 0, 1966083, 0, 0, 4, 0, 0, 65540, 0, 0, 1900548, 0, 0, 1966084, 0, 0, 5, 0, 0, 65541, 0, 0, 1900549, 0, 0, 1966085, 0, 0, 6, 0, 0, 65542, 0, 0, 1900550, 0, 0, 1966086, 0, 0, 7, 0, 0, 65543, 0, 0, 1900551, 0, 0, 1966087, 0, 0, 8, 0, 0, 65544, 0, 0, 1900552, 0, 0, 1966088, 0, 0, 9, 0, 0, 65545, 0, 0, 1900553, 0, 0, 1966089, 0, 0, 10, 0, 0, 65546, 0, 0, 1900554, 0, 0, 1966090, 0, 0, 11, 0, 0, 65547, 0, 0, 1900555, 0, 0, 1966091, 0, 0, 12, 0, 0, 65548, 0, 0, 1900556, 0, 0, 1966092, 0, 0, 13, 0, 0, 65549, 0, 0, 1900557, 0, 0, 1966093, 0, 0, 14, 0, 0, 65550, 0, 0, 1900558, 0, 0, 1966094, 0, 0, 15, 0, 0, 65551, 0, 0, 1900559, 0, 0, 1966095, 0, 0, 16, 0, 0, 65552, 0, 0, 1900560, 0, 0, 1966096, 0, 0, 17, 0, 0, 65553, 0, 0, 1900561, 0, 0, 1966097, 0, 0, 18, 0, 0, 65554, 0, 0, 1900562, 0, 0, 1966098, 0, 0, 19, 0, 0, 65555, 0, 0, 1900563, 0, 0, 1966099, 0, 0, 20, 0, 0, 65556, 0, 0, 1900564, 0, 0, 1966100, 0, 0, 21, 0, 0, 65557, 0, 0, 1900565, 0, 0, 1966101, 0, 0, 22, 0, 0, 65558, 0, 0, 1900566, 0, 0, 1966102, 0, 0, 23, 0, 0, 65559, 0, 0, 1900567, 0, 0, 1966103, 0, 0, 24, 0, 0, 65560, 0, 0, 1900568, 0, 0, 1966104, 0, 0, 25, 0, 0, 65561, 0, 0, 1900569, 0, 0, 1966105, 0, 0, 26, 0, 0, 65562, 0, 0, 1900570, 0, 0, 1966106, 0, 0, 27, 0, 0, 65563, 0, 0, 1900571, 0, 0, 1966107, 0, 0, 28, 0, 0, 65564, 0, 0, 1900572, 0, 0, 1966108, 0, 0, 29, 0, 0, 65565, 0, 0, 1900573, 0, 0, 1966109, 0, 0, 30, 0, 0, 65566, 0, 0, 1900574, 0, 0, 1966110, 0, 0, 31, 0, 0, 65567, 0, 0, 131103, 0, 0, 196639, 0, 0, 262175, 0, 0, 327711, 0, 0, 393247, 0, 0, 458783, 0, 0, 524319, 0, 0, 589855, 0, 0, 655391, 0, 0, 720927, 0, 0, 786463, 0, 0, 851999, 0, 0, 917535, 0, 0, 983071, 0, 0, 1048607, 0, 0, 1114143, 0, 0, 1179679, 0, 0, 1245215, 0, 0, 1310751, 0, 0, 1376287, 0, 0, 1441823, 0, 0, 1507359, 0, 0, 1572895, 0, 0, 1638431, 0, 0, 1703967, 0, 0, 1769503, 0, 0, 1835039, 0, 0, 1900575, 0, 0, 1966111, 0, 0, 32, 0, 0, 65568, 0, 0, 131104, 0, 0, 196640, 0, 0, 262176, 0, 0, 327712, 0, 0, 393248, 0, 0, 458784, 0, 0, 524320, 0, 0, 589856, 0, 0, 655392, 0, 0, 720928, 0, 0, 786464, 0, 0, 852000, 0, 0, 917536, 0, 0, 983072, 0, 0, 1048608, 0, 0, 1114144, 0, 0, 1179680, 0, 0, 1245216, 0, 0, 1310752, 0, 0, 1376288, 0, 0, 1441824, 0, 0, 1507360, 0, 0, 1572896, 0, 0, 1638432, 0, 0, 1703968, 0, 0, 1769504, 0, 0, 1835040, 0, 0, 1900576, 0, 0, 1966112, 0, 0, 1572878, 0, 0, 1572879, 0, 0, 1572880, 0, 0, 1572881, 0, 0, 1572882, 0, 0, 1572883, 0, 0, 1572884, 0, 0, 1507348, 0, 0, 1441812, 0, 0, 1441811, 0, 0, 1441810, 0, 0, 1441809, 0, 0, 1441808, 0, 0, 1441807, 0, 0, 1441806, 0, 0, 1507342, 0, 0, 1507343, 0, 0, 1507344, 0, 0, 1507345, 0, 0, 1507346, 0, 0, 1507347, 0, 0, 1638414, 0, 0, 1638415, 0, 0, 1638416, 0, 0, 1638417, 0, 0, 1638418, 0, 0, 1638419, 0, 0, 1638420, 0, 0)
|
||||
layer_1/name = "Secret"
|
||||
layer_1/enabled = true
|
||||
layer_1/modulate = Color(1, 1, 1, 1)
|
||||
layer_1/y_sort_enabled = false
|
||||
layer_1/y_sort_origin = 0
|
||||
layer_1/z_index = 0
|
||||
layer_1/tile_data = PackedInt32Array(1703950, 0, 0, 1769486, 0, 0, 1835022, 0, 0, 1703951, 0, 0, 1769487, 0, 0, 1835023, 0, 0, 1703952, 0, 0, 1769488, 0, 0, 1835024, 0, 0, 1703953, 0, 0, 1769489, 0, 0, 1835025, 0, 0, 1703954, 0, 0, 1769490, 0, 0, 1835026, 0, 0, 1703955, 0, 0, 1769491, 0, 0, 1835027, 0, 0, 1703956, 0, 0, 1769492, 0, 0, 1835028, 0, 0)
|
||||
script = ExtResource("2_q8fhk")
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="."]
|
||||
offset = Vector2(265, 247)
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("3")]
|
||||
position = Vector2(120, 456)
|
||||
|
||||
[node name="SecretDetector" type="Area2D" parent="."]
|
||||
position = Vector2(280, 440)
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="SecretDetector"]
|
||||
shape = SubResource("RectangleShape2D_a2gec")
|
||||
|
||||
[connection signal="body_entered" from="SecretDetector" to="TileMap" method="_on_secret_detector_body_entered"]
|
||||
[connection signal="body_exited" from="SecretDetector" to="TileMap" method="_on_secret_detector_body_exited"]
|
||||
@@ -1,83 +1,21 @@
|
||||
[gd_scene load_steps=8 format=3 uid="uid://dmn8nkpogiwsf"]
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://bpdyvy2681m3i" path="res://player/Player.tscn" id="1"]
|
||||
[ext_resource type="PackedScene" uid="uid://cvi13chv8g4hj" path="res://debug/StatesStackDiplayer.tscn" id="3"]
|
||||
[ext_resource type="PackedScene" uid="uid://bq6rrfy53rfvo" path="res://debug/ControlsPanel.tscn" id="4"]
|
||||
|
||||
[sub_resource type="Animation" id="1"]
|
||||
|
||||
[sub_resource type="Animation" id="2"]
|
||||
length = 0.6
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("BodyPivot/Body:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.4),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 1), Color(1, 0, 0, 1), Color(1, 1, 1, 1), Color(1, 0, 0, 1), Color(1, 1, 1, 1), Color(1, 0, 0, 1), Color(1, 1, 1, 1)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="3"]
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_qbwwp"]
|
||||
_data = {
|
||||
"idle": SubResource("1"),
|
||||
"stagger": SubResource("2"),
|
||||
"walk": SubResource("3")
|
||||
}
|
||||
[ext_resource path="res://player/Player.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://debug/StatesStackDiplayer.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://debug/ControlsPanel.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://debug/Explanations.tscn" type="PackedScene" id=4]
|
||||
|
||||
[node name="Demo" type="Node"]
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("1")]
|
||||
position = Vector2(640, 400)
|
||||
[node name="Player" parent="." index="0" instance=ExtResource( 1 )]
|
||||
|
||||
[node name="StateMachine" parent="Player" index="0"]
|
||||
start_state = NodePath("Idle")
|
||||
editor/display_folded = true
|
||||
|
||||
[node name="AnimationPlayer" parent="Player" index="1"]
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_qbwwp")
|
||||
}
|
||||
[node name="StatesStackDiplayer" parent="." index="1" instance=ExtResource( 2 )]
|
||||
|
||||
[node name="Explanations" type="RichTextLabel" parent="."]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 10.0
|
||||
offset_top = -370.0
|
||||
offset_right = -10.0
|
||||
offset_bottom = -730.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_vertical = 4
|
||||
mouse_filter = 2
|
||||
bbcode_enabled = true
|
||||
text = "This example shows how to apply the State programming pattern in GDScript, including Hierarchical States, and a pushdown automaton.
|
||||
[node name="ControlsPanel" parent="." index="2" instance=ExtResource( 3 )]
|
||||
|
||||
States are common in games. You can use the pattern to:
|
||||
[node name="Explanations" parent="." index="3" instance=ExtResource( 4 )]
|
||||
|
||||
1. Separate each behavior and transitions between behaviors, thus make scripts shorter and easier to manage.
|
||||
2. Respect the Single Responsibility Principle. Each State object represents one action.
|
||||
3. Improve your code's structure. Look at the scene tree and FileSystem tab: without looking at the code, you'll know what the Player can or cannot do.
|
||||
|
||||
You can read more about States in the excellent Game Programming Patterns ebook."
|
||||
|
||||
[node name="Control" type="Control" parent="."]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="StatesStackDiplayer" parent="Control" instance=ExtResource("3")]
|
||||
layout_mode = 0
|
||||
|
||||
[node name="ControlsPanel" parent="Control" instance=ExtResource("4")]
|
||||
layout_mode = 1
|
||||
|
||||
[editable path="Player"]
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
# Hierarchical Finite State Machine
|
||||
|
||||
This example shows how to apply the State machine programming
|
||||
pattern in GDscript, including Hierarchical States, and a
|
||||
pushdown automaton.
|
||||
|
||||
Language: GDScript
|
||||
|
||||
Renderer: Compatibility
|
||||
|
||||
Check out this demo on the asset library: https://godotengine.org/asset-library/asset/516
|
||||
|
||||
## Why use a state machine
|
||||
|
||||
States are common in games. You can use the pattern to:
|
||||
|
||||
1. Separate each behavior and transitions between behaviors,
|
||||
thus make scripts shorter and easier to manage.
|
||||
|
||||
2. Respect the Single Responsibility Principle.
|
||||
Each State object represents one action.
|
||||
|
||||
3. Improve your code's structure. Look at the scene tree and
|
||||
FileSystem tab: without looking at the code, you'll know
|
||||
what the Player can or cannot do.
|
||||
|
||||
You can read more about States in the excellent
|
||||
[Game Programming Patterns ebook](https://gameprogrammingpatterns.com/state.html).
|
||||
|
||||
## Screenshots
|
||||
|
||||

|
||||
@@ -1,41 +1,77 @@
|
||||
[gd_scene format=3 uid="uid://bq6rrfy53rfvo"]
|
||||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://debug/top_level_ui.gd" type="Script" id=1]
|
||||
[ext_resource path="res://fonts/source_code_pro_explanations.tres" type="DynamicFont" id=2]
|
||||
|
||||
[node name="ControlsPanel" type="Panel" index="0"]
|
||||
|
||||
[node name="ControlsPanel" type="Panel"]
|
||||
anchors_preset = 1
|
||||
anchor_left = 1.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 1.0
|
||||
offset_left = -150.0
|
||||
offset_bottom = 171.0
|
||||
grow_horizontal = 0
|
||||
anchor_bottom = 0.0
|
||||
margin_left = -220.0
|
||||
margin_bottom = 170.0
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
mouse_default_cursor_shape = 0
|
||||
size_flags_horizontal = 1
|
||||
size_flags_vertical = 1
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -56.5
|
||||
offset_top = -65.0
|
||||
offset_right = 56.5
|
||||
offset_bottom = 65.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
[node name="Keys" type="Label" parent="." index="0"]
|
||||
|
||||
[node name="Actions" type="Label" parent="HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Move:
|
||||
Shoot:
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = 10.0
|
||||
margin_top = 10.0
|
||||
margin_right = -10.0
|
||||
margin_bottom = -10.0
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
rect_clip_content = false
|
||||
mouse_filter = 2
|
||||
mouse_default_cursor_shape = 0
|
||||
size_flags_horizontal = 1
|
||||
size_flags_vertical = 4
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
text = "Shoot:
|
||||
Attack:
|
||||
Stagger:
|
||||
Jump:
|
||||
Sprint:"
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
_sections_unfolded = [ "BBCode", "custom_fonts" ]
|
||||
|
||||
[node name="Keys" type="Label" parent="HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "WASD
|
||||
R
|
||||
[node name="Keys2" type="Label" parent="." index="1"]
|
||||
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = 10.0
|
||||
margin_top = 10.0
|
||||
margin_right = -10.0
|
||||
margin_bottom = -10.0
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
rect_clip_content = false
|
||||
mouse_filter = 2
|
||||
mouse_default_cursor_shape = 0
|
||||
size_flags_horizontal = 1
|
||||
size_flags_vertical = 4
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
text = "R
|
||||
F
|
||||
X
|
||||
Space
|
||||
Shift"
|
||||
align = 2
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
_sections_unfolded = [ "BBCode", "custom_fonts" ]
|
||||
|
||||
|
||||
|
||||
@@ -1,16 +1,42 @@
|
||||
[gd_scene format=3 uid="uid://bywptem1jb35a"]
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://fonts/source_code_pro_explanations_bold.tres" type="DynamicFont" id=1]
|
||||
[ext_resource path="res://fonts/source_code_pro_explanations.tres" type="DynamicFont" id=2]
|
||||
[ext_resource path="res://debug/top_level_ui.gd" type="Script" id=3]
|
||||
|
||||
|
||||
[node name="Explanations" type="RichTextLabel"]
|
||||
anchors_preset = 15
|
||||
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 10.0
|
||||
offset_top = -370.0
|
||||
offset_right = -10.0
|
||||
offset_bottom = -730.0
|
||||
size_flags_vertical = 4
|
||||
margin_left = 10.0
|
||||
margin_top = -370.0
|
||||
margin_right = -10.0
|
||||
margin_bottom = -730.0
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
rect_clip_content = false
|
||||
mouse_filter = 2
|
||||
mouse_default_cursor_shape = 0
|
||||
size_flags_horizontal = 1
|
||||
size_flags_vertical = 4
|
||||
custom_fonts/bold_font = ExtResource( 1 )
|
||||
custom_fonts/normal_font = ExtResource( 2 )
|
||||
bbcode_enabled = true
|
||||
bbcode_text = "This example shows how to apply the State programming pattern in GDscript, including Hierarchical States, and a pushdown automaton.
|
||||
|
||||
States are common in games. You can use the pattern to:
|
||||
|
||||
1. Separate each behavior and transitions between behaviors, thus make scripts shorter and easier to manage
|
||||
2. Respect the Single Responsibility Principle. Each State object represents [b]one[/b] action
|
||||
3. Improve your code's structure. Look at the scene tree and FileSystem tab: without looking at the code, you'll know what the Player can or cannot do.
|
||||
|
||||
You can read more about States in the excellent [url=http://gameprogrammingpatterns.com/state.html]Game Programming Patterns ebook[/url]."
|
||||
visible_characters = -1
|
||||
percent_visible = 1.0
|
||||
meta_underlined = true
|
||||
tab_size = 4
|
||||
text = "This example shows how to apply the State programming pattern in GDscript, including Hierarchical States, and a pushdown automaton.
|
||||
|
||||
States are common in games. You can use the pattern to:
|
||||
@@ -20,3 +46,14 @@ States are common in games. You can use the pattern to:
|
||||
3. Improve your code's structure. Look at the scene tree and FileSystem tab: without looking at the code, you'll know what the Player can or cannot do.
|
||||
|
||||
You can read more about States in the excellent Game Programming Patterns ebook."
|
||||
scroll_active = true
|
||||
scroll_following = false
|
||||
selection_enabled = false
|
||||
override_selected_font_color = false
|
||||
script = ExtResource( 3 )
|
||||
_sections_unfolded = [ "BBCode", "custom_fonts" ]
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,37 +1,108 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://cvi13chv8g4hj"]
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource type="Script" path="res://debug/states_stack_displayer.gd" id="1"]
|
||||
[ext_resource path="res://debug/states_stack_displayer.gd" type="Script" id=1]
|
||||
[ext_resource path="res://fonts/SourceCodePro-Bold.ttf" type="DynamicFontData" id=2]
|
||||
|
||||
|
||||
[sub_resource type="DynamicFont" id=1]
|
||||
|
||||
size = 20
|
||||
use_mipmaps = false
|
||||
use_filter = true
|
||||
font_data = ExtResource( 2 )
|
||||
_sections_unfolded = [ "Font", "Settings" ]
|
||||
|
||||
[node name="StatesStackDiplayer" type="Panel"]
|
||||
offset_right = 210.0
|
||||
offset_bottom = 170.0
|
||||
script = ExtResource("1")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_right = 210.0
|
||||
margin_bottom = 170.0
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
mouse_default_cursor_shape = 0
|
||||
size_flags_horizontal = 1
|
||||
size_flags_vertical = 1
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_group_": true
|
||||
}
|
||||
|
||||
[node name="Title" type="Label" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "StateStack"
|
||||
[node name="Title" type="Label" parent="." index="0"]
|
||||
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.0
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.0
|
||||
margin_left = -105.0
|
||||
margin_right = 105.0
|
||||
margin_bottom = 40.0
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
rect_clip_content = false
|
||||
mouse_filter = 2
|
||||
mouse_default_cursor_shape = 0
|
||||
size_flags_horizontal = 1
|
||||
size_flags_vertical = 4
|
||||
custom_fonts/font = SubResource( 1 )
|
||||
text = "Pushown"
|
||||
align = 1
|
||||
valign = 1
|
||||
uppercase = true
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
_sections_unfolded = [ "custom_fonts" ]
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
[node name="States" type="Label" parent="." index="1"]
|
||||
|
||||
[node name="Numbers" type="Label" parent="VBoxContainer/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "1.
|
||||
2."
|
||||
horizontal_alignment = 2
|
||||
|
||||
[node name="States" type="Label" parent="VBoxContainer/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_left = 20.0
|
||||
margin_top = 50.0
|
||||
margin_right = 190.0
|
||||
margin_bottom = 170.0
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
rect_clip_content = false
|
||||
mouse_filter = 2
|
||||
mouse_default_cursor_shape = 0
|
||||
size_flags_horizontal = 1
|
||||
size_flags_vertical = 4
|
||||
custom_fonts/font = SubResource( 1 )
|
||||
text = "Jump
|
||||
Test"
|
||||
align = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
_sections_unfolded = [ "custom_fonts" ]
|
||||
|
||||
[node name="Numbers" type="Label" parent="." index="2"]
|
||||
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_left = 20.0
|
||||
margin_top = 50.0
|
||||
margin_right = 190.0
|
||||
margin_bottom = 170.0
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
rect_clip_content = false
|
||||
mouse_filter = 2
|
||||
mouse_default_cursor_shape = 0
|
||||
size_flags_horizontal = 1
|
||||
size_flags_vertical = 4
|
||||
custom_fonts/font = SubResource( 1 )
|
||||
text = "1.
|
||||
2."
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
_sections_unfolded = [ "custom_fonts" ]
|
||||
|
||||
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
extends Panel
|
||||
|
||||
@onready var fsm_node = get_node(^"../../Player/StateMachine")
|
||||
onready var fsm_node = get_node("../Player/StateMachine")
|
||||
|
||||
func _process(_delta):
|
||||
var states_names = ""
|
||||
var numbers = ""
|
||||
func _ready():
|
||||
set_as_toplevel(true)
|
||||
|
||||
func _process(delta):
|
||||
var states_names = ''
|
||||
var numbers = ''
|
||||
var index = 0
|
||||
for state in fsm_node.states_stack:
|
||||
states_names += String(state.get_name()) + "\n"
|
||||
numbers += str(index) + "\n"
|
||||
states_names += state.get_name() + '\n'
|
||||
numbers += str(index) + '\n'
|
||||
index += 1
|
||||
%States.text = states_names
|
||||
%Numbers.text = numbers
|
||||
|
||||
$States.text = states_names
|
||||
$Numbers.text = numbers
|
||||
|
||||
5
2d/finite_state_machine/debug/top_level_ui.gd
Normal file
@@ -0,0 +1,5 @@
|
||||
tool
|
||||
extends Control
|
||||
|
||||
func _ready():
|
||||
set_as_toplevel(true)
|
||||
101
2d/finite_state_machine/default_env.tres
Normal file
@@ -0,0 +1,101 @@
|
||||
[gd_resource type="Environment" load_steps=2 format=2]
|
||||
|
||||
[sub_resource type="ProceduralSky" id=1]
|
||||
|
||||
radiance_size = 4
|
||||
sky_top_color = Color( 0.0470588, 0.454902, 0.976471, 1 )
|
||||
sky_horizon_color = Color( 0.556863, 0.823529, 0.909804, 1 )
|
||||
sky_curve = 0.25
|
||||
sky_energy = 1.0
|
||||
ground_bottom_color = Color( 0.101961, 0.145098, 0.188235, 1 )
|
||||
ground_horizon_color = Color( 0.482353, 0.788235, 0.952941, 1 )
|
||||
ground_curve = 0.01
|
||||
ground_energy = 1.0
|
||||
sun_color = Color( 1, 1, 1, 1 )
|
||||
sun_latitude = 35.0
|
||||
sun_longitude = 0.0
|
||||
sun_angle_min = 1.0
|
||||
sun_angle_max = 100.0
|
||||
sun_curve = 0.05
|
||||
sun_energy = 16.0
|
||||
texture_size = 2
|
||||
|
||||
[resource]
|
||||
|
||||
background_mode = 2
|
||||
background_sky = SubResource( 1 )
|
||||
background_sky_custom_fov = 0.0
|
||||
background_color = Color( 0, 0, 0, 1 )
|
||||
background_energy = 1.0
|
||||
background_canvas_max_layer = 0
|
||||
ambient_light_color = Color( 0, 0, 0, 1 )
|
||||
ambient_light_energy = 1.0
|
||||
ambient_light_sky_contribution = 1.0
|
||||
fog_enabled = false
|
||||
fog_color = Color( 0.5, 0.6, 0.7, 1 )
|
||||
fog_sun_color = Color( 1, 0.9, 0.7, 1 )
|
||||
fog_sun_amount = 0.0
|
||||
fog_depth_enabled = true
|
||||
fog_depth_begin = 10.0
|
||||
fog_depth_curve = 1.0
|
||||
fog_transmit_enabled = false
|
||||
fog_transmit_curve = 1.0
|
||||
fog_height_enabled = false
|
||||
fog_height_min = 0.0
|
||||
fog_height_max = 100.0
|
||||
fog_height_curve = 1.0
|
||||
tonemap_mode = 0
|
||||
tonemap_exposure = 1.0
|
||||
tonemap_white = 1.0
|
||||
auto_exposure_enabled = false
|
||||
auto_exposure_scale = 0.4
|
||||
auto_exposure_min_luma = 0.05
|
||||
auto_exposure_max_luma = 8.0
|
||||
auto_exposure_speed = 0.5
|
||||
ss_reflections_enabled = false
|
||||
ss_reflections_max_steps = 64
|
||||
ss_reflections_fade_in = 0.15
|
||||
ss_reflections_fade_out = 2.0
|
||||
ss_reflections_depth_tolerance = 0.2
|
||||
ss_reflections_roughness = true
|
||||
ssao_enabled = false
|
||||
ssao_radius = 1.0
|
||||
ssao_intensity = 1.0
|
||||
ssao_radius2 = 0.0
|
||||
ssao_intensity2 = 1.0
|
||||
ssao_bias = 0.01
|
||||
ssao_light_affect = 0.0
|
||||
ssao_color = Color( 0, 0, 0, 1 )
|
||||
ssao_quality = 0
|
||||
ssao_blur = 3
|
||||
ssao_edge_sharpness = 4.0
|
||||
dof_blur_far_enabled = false
|
||||
dof_blur_far_distance = 10.0
|
||||
dof_blur_far_transition = 5.0
|
||||
dof_blur_far_amount = 0.1
|
||||
dof_blur_far_quality = 1
|
||||
dof_blur_near_enabled = false
|
||||
dof_blur_near_distance = 2.0
|
||||
dof_blur_near_transition = 1.0
|
||||
dof_blur_near_amount = 0.1
|
||||
dof_blur_near_quality = 1
|
||||
glow_enabled = false
|
||||
glow_levels/1 = false
|
||||
glow_levels/2 = false
|
||||
glow_levels/3 = true
|
||||
glow_levels/4 = false
|
||||
glow_levels/5 = true
|
||||
glow_levels/6 = false
|
||||
glow_levels/7 = false
|
||||
glow_intensity = 0.8
|
||||
glow_strength = 1.0
|
||||
glow_bloom = 0.0
|
||||
glow_blend_mode = 2
|
||||
glow_hdr_threshold = 1.0
|
||||
glow_hdr_scale = 2.0
|
||||
glow_bicubic_upscale = false
|
||||
adjustment_enabled = false
|
||||
adjustment_brightness = 1.0
|
||||
adjustment_contrast = 1.0
|
||||
adjustment_saturation = 1.0
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="font_data_dynamic"
|
||||
type="FontFile"
|
||||
uid="uid://b7c5m4mw0jhww"
|
||||
path="res://.godot/imported/SourceCodePro-Black.ttf-5ac54eeedbdedbc63d01069716d9852f.fontdata"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://fonts/SourceCodePro-Black.ttf"
|
||||
dest_files=["res://.godot/imported/SourceCodePro-Black.ttf-5ac54eeedbdedbc63d01069716d9852f.fontdata"]
|
||||
|
||||
[params]
|
||||
|
||||
Rendering=null
|
||||
antialiasing=1
|
||||
generate_mipmaps=false
|
||||
multichannel_signed_distance_field=false
|
||||
msdf_pixel_range=8
|
||||
msdf_size=48
|
||||
allow_system_fallback=true
|
||||
force_autohinter=false
|
||||
hinting=1
|
||||
subpixel_positioning=1
|
||||
oversampling=0.0
|
||||
Fallbacks=null
|
||||
fallbacks=[]
|
||||
Compress=null
|
||||
compress=true
|
||||
preload=[]
|
||||
language_support={}
|
||||
script_support={}
|
||||
opentype_features={}
|
||||
@@ -1,33 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="font_data_dynamic"
|
||||
type="FontFile"
|
||||
uid="uid://b5bspum6ffekd"
|
||||
path="res://.godot/imported/SourceCodePro-Bold.ttf-bf03bd9c90603419d32725fc00754bf7.fontdata"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://fonts/SourceCodePro-Bold.ttf"
|
||||
dest_files=["res://.godot/imported/SourceCodePro-Bold.ttf-bf03bd9c90603419d32725fc00754bf7.fontdata"]
|
||||
|
||||
[params]
|
||||
|
||||
Rendering=null
|
||||
antialiasing=1
|
||||
generate_mipmaps=false
|
||||
multichannel_signed_distance_field=false
|
||||
msdf_pixel_range=8
|
||||
msdf_size=48
|
||||
allow_system_fallback=true
|
||||
force_autohinter=false
|
||||
hinting=1
|
||||
subpixel_positioning=1
|
||||
oversampling=0.0
|
||||
Fallbacks=null
|
||||
fallbacks=[]
|
||||
Compress=null
|
||||
compress=true
|
||||
preload=[]
|
||||
language_support={}
|
||||
script_support={}
|
||||
opentype_features={}
|
||||
@@ -1,6 +1,6 @@
|
||||
[gd_resource type="Font" load_steps=2 format=2]
|
||||
[gd_resource type="DynamicFont" load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://fonts/SourceCodePro-Bold.ttf" type="FontData" id=1]
|
||||
[ext_resource path="res://fonts/SourceCodePro-Bold.ttf" type="DynamicFontData" id=1]
|
||||
|
||||
[resource]
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[gd_resource type="Font" load_steps=2 format=2]
|
||||
[gd_resource type="DynamicFont" load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://fonts/SourceCodePro-Black.ttf" type="FontData" id=1]
|
||||
[ext_resource path="res://fonts/SourceCodePro-Black.ttf" type="DynamicFontData" id=1]
|
||||
|
||||
[resource]
|
||||
|
||||
|
||||
BIN
2d/finite_state_machine/icon.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
29
2d/finite_state_machine/icon.png.import
Normal file
@@ -0,0 +1,29 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://icon.png"
|
||||
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||