Compare commits
79 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6ecf265637 | ||
|
|
157b432c80 | ||
|
|
7af99c55ef | ||
|
|
232eb35acf | ||
|
|
757cc4261c | ||
|
|
851862f8db | ||
|
|
5689210c46 | ||
|
|
4d31672264 | ||
|
|
7e9d31bb04 | ||
|
|
1b61bc4bb0 | ||
|
|
84b7f9ea36 | ||
|
|
d880218056 | ||
|
|
3706e3e998 | ||
|
|
e2abd0e7fb | ||
|
|
647002a75c | ||
|
|
9484fbbace | ||
|
|
1c169add0d | ||
|
|
7e43dbf64b | ||
|
|
ce4600350e | ||
|
|
db8ac0422d | ||
|
|
fc7ff91882 | ||
|
|
0dfb54ff7f | ||
|
|
65b34f8192 | ||
|
|
ad2cdfebd4 | ||
|
|
1113bafac4 | ||
|
|
0938a48563 | ||
|
|
68aefef5b9 | ||
|
|
e85494a57a | ||
|
|
e9f0f75c5b | ||
|
|
9c8dc6383e | ||
|
|
f7e3ceb31e | ||
|
|
c3f09a45dc | ||
|
|
fbc7341439 | ||
|
|
beaefdc0c0 | ||
|
|
ea37c101e0 | ||
|
|
a5d736f624 | ||
|
|
0a84347d11 | ||
|
|
b032b75c07 | ||
|
|
c27056da58 | ||
|
|
302e8727e1 | ||
|
|
18c76b6dae | ||
|
|
5867e5e931 | ||
|
|
f4d146d0ec | ||
|
|
548c4d5b26 | ||
|
|
6860a1e814 | ||
|
|
3a38ab4635 | ||
|
|
0e83ebc6af | ||
|
|
b47178faac | ||
|
|
7cd99ae192 | ||
|
|
81a16597b9 | ||
|
|
79edc17b70 | ||
|
|
1eb4eccd55 | ||
|
|
2aff1c69a3 | ||
|
|
65c8d77cf4 | ||
|
|
502d410777 | ||
|
|
0d02b2f90d | ||
|
|
167e1d391b | ||
|
|
f6ac674864 | ||
|
|
83af3223df | ||
|
|
518eb6df52 | ||
|
|
199e4bed4c | ||
|
|
63d1cd9a60 | ||
|
|
4bbf04129a | ||
|
|
d4496aada8 | ||
|
|
71d29dcf3b | ||
|
|
956875c306 | ||
|
|
e375d5aa49 | ||
|
|
8a4a0262e9 | ||
|
|
2b16927567 | ||
|
|
92c39e7f1c | ||
|
|
185d0f4b05 | ||
|
|
82c9367044 | ||
|
|
4045f997c2 | ||
|
|
934b02bd84 | ||
|
|
4e27134403 | ||
|
|
76ec36d805 | ||
|
|
285139fc4e | ||
|
|
a62a4c8534 | ||
|
|
3696e43696 |
24
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -1,23 +1,7 @@
|
|||||||
<!--
|
<!--
|
||||||
Only submit a pull request if all of the following conditions are met:
|
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.
|
||||||
|
|
||||||
* It must work with the latest Godot version of the branch you're submitting to.
|
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`.
|
||||||
* It must follow all of the Godot style guides, including the GDScript
|
|
||||||
style guide and the C# style guide.
|
|
||||||
|
|
||||||
* The demo should not be overcomplicated. Simplicity is usually preferred.
|
|
||||||
|
|
||||||
* If you are submitting a new demo, please ensure that it includes a
|
|
||||||
README file similar to the other demos.
|
|
||||||
|
|
||||||
* If you are submitting a copy of a demo translated to C# etc:
|
|
||||||
|
|
||||||
* Please ensure that there is a good reason to have this demo translated.
|
|
||||||
We don't want to have multiple copies of every single project.
|
|
||||||
|
|
||||||
* Please ensure that the code mirrors the original closely.
|
|
||||||
|
|
||||||
* In the project.godot file and in the README, include "with C#" etc in
|
|
||||||
the title, and also include a link to the original in the README.
|
|
||||||
-->
|
-->
|
||||||
|
|||||||
1
.gitignore
vendored
@@ -20,3 +20,4 @@ mono_crash.*.json
|
|||||||
.directory
|
.directory
|
||||||
.DS_Store
|
.DS_Store
|
||||||
*~
|
*~
|
||||||
|
*.blend1
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/bullet.png-ff1424653e10246c11e3724e402c519e.c
|
|||||||
[params]
|
[params]
|
||||||
|
|
||||||
compress/mode=0
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
compress/lossy_quality=0.7
|
compress/lossy_quality=0.7
|
||||||
compress/hdr_compression=1
|
compress/hdr_compression=1
|
||||||
compress/bptc_ldr=0
|
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
compress/channel_pack=0
|
compress/channel_pack=0
|
||||||
mipmaps/generate=false
|
mipmaps/generate=false
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/face_happy.png-38d387d31ec13459f749c93ce3d75d
|
|||||||
[params]
|
[params]
|
||||||
|
|
||||||
compress/mode=0
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
compress/lossy_quality=0.7
|
compress/lossy_quality=0.7
|
||||||
compress/hdr_compression=1
|
compress/hdr_compression=1
|
||||||
compress/bptc_ldr=0
|
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
compress/channel_pack=0
|
compress/channel_pack=0
|
||||||
mipmaps/generate=false
|
mipmaps/generate=false
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/face_sad.png-0ac7165eab24f595aba17a746a66c550
|
|||||||
[params]
|
[params]
|
||||||
|
|
||||||
compress/mode=0
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
compress/lossy_quality=0.7
|
compress/lossy_quality=0.7
|
||||||
compress/hdr_compression=1
|
compress/hdr_compression=1
|
||||||
compress/bptc_ldr=0
|
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
compress/channel_pack=0
|
compress/channel_pack=0
|
||||||
mipmaps/generate=false
|
mipmaps/generate=false
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.9 KiB |
@@ -1,34 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://c8w03v671qh3y"
|
|
||||||
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/lossy_quality=0.7
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/bptc_ldr=0
|
|
||||||
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
|
|
||||||
BIN
2d/bullet_shower/icon.webp
Normal file
|
After Width: | Height: | Size: 6.9 KiB |
34
2d/bullet_shower/icon.webp.import
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[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
|
||||||
@@ -8,16 +8,14 @@
|
|||||||
|
|
||||||
config_version=5
|
config_version=5
|
||||||
|
|
||||||
_global_script_classes=[]
|
|
||||||
_global_script_class_icons={}
|
|
||||||
|
|
||||||
[application]
|
[application]
|
||||||
|
|
||||||
config/name="Bullet Shower"
|
config/name="Bullet Shower"
|
||||||
config/description="Demonstrates how to manage large amounts of objects efficiently using low-level Servers."
|
config/description="Demonstrates how to manage large amounts of objects efficiently using low-level Servers."
|
||||||
run/main_scene="res://shower.tscn"
|
run/main_scene="res://shower.tscn"
|
||||||
config/features=PackedStringArray("4.0")
|
config/features=PackedStringArray("4.0")
|
||||||
config/icon="res://icon.png"
|
config/icon="res://icon.webp"
|
||||||
|
config/tags=PackedStringArray("2d", "demo", "official", "performance")
|
||||||
|
|
||||||
[display]
|
[display]
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,13 @@
|
|||||||
|
|
||||||
[sub_resource type="SpriteFrames" id="1"]
|
[sub_resource type="SpriteFrames" id="1"]
|
||||||
animations = [{
|
animations = [{
|
||||||
"frames": [ExtResource("3"), ExtResource("4")],
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("3")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("4")
|
||||||
|
}],
|
||||||
"loop": true,
|
"loop": true,
|
||||||
"name": &"default",
|
"name": &"default",
|
||||||
"speed": 5.0
|
"speed": 5.0
|
||||||
@@ -25,7 +31,7 @@ script = ExtResource("2")
|
|||||||
script = ExtResource("5")
|
script = ExtResource("5")
|
||||||
|
|
||||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="Player"]
|
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="Player"]
|
||||||
frames = SubResource("1")
|
sprite_frames = SubResource("1")
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Player"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Player"]
|
||||||
shape = SubResource("2")
|
shape = SubResource("2")
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.6 KiB |
BIN
2d/dodge_the_creeps/icon.webp
Normal file
|
After Width: | Height: | Size: 6.9 KiB |
34
2d/dodge_the_creeps/icon.webp.import
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[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
|
||||||
@@ -19,7 +19,8 @@ tutorial in the documentation. For more details, consider
|
|||||||
following the tutorial in the documentation."
|
following the tutorial in the documentation."
|
||||||
run/main_scene="res://Main.tscn"
|
run/main_scene="res://Main.tscn"
|
||||||
config/features=PackedStringArray("4.0")
|
config/features=PackedStringArray("4.0")
|
||||||
config/icon="res://icon.png"
|
config/icon="res://icon.webp"
|
||||||
|
config/tags=PackedStringArray("2d", "demo", "official")
|
||||||
|
|
||||||
[debug]
|
[debug]
|
||||||
|
|
||||||
|
|||||||
13
2d/dynamic_tilemap_layers/README.md
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# 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
|
||||||
|
|
||||||
|

|
||||||
BIN
2d/dynamic_tilemap_layers/icon.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://cmdjuhfejngkf"
|
uid="uid://bpov140lx7at3"
|
||||||
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"
|
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
BIN
2d/dynamic_tilemap_layers/level/obstacle.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
34
2d/dynamic_tilemap_layers/level/obstacle.png.import
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[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
|
||||||
57
2d/dynamic_tilemap_layers/level/tile_map.gd
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
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)
|
||||||
32
2d/dynamic_tilemap_layers/player/player.gd
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
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
|
||||||
BIN
2d/dynamic_tilemap_layers/player/player.png
Normal file
|
After Width: | Height: | Size: 502 B |
34
2d/dynamic_tilemap_layers/player/player.png.import
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[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
|
||||||
17
2d/dynamic_tilemap_layers/player/player.tscn
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
[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 )
|
||||||
66
2d/dynamic_tilemap_layers/project.godot
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
; 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
|
||||||
0
2d/dynamic_tilemap_layers/screenshots/.gdignore
Normal file
BIN
2d/dynamic_tilemap_layers/screenshots/fake_wall.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
57
2d/dynamic_tilemap_layers/world.tscn
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
[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"]
|
||||||
@@ -60,8 +60,8 @@ text = "This example shows how to apply the State programming pattern in GDScrip
|
|||||||
|
|
||||||
States are common in games. You can use the pattern to:
|
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
|
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
|
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.
|
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."
|
You can read more about States in the excellent Game Programming Patterns ebook."
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ grow_vertical = 2
|
|||||||
|
|
||||||
[node name="Title" type="Label" parent="VBoxContainer"]
|
[node name="Title" type="Label" parent="VBoxContainer"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
text = "Pushown"
|
text = "StateStack"
|
||||||
uppercase = true
|
uppercase = true
|
||||||
|
|
||||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
|
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 2.1 KiB |
BIN
2d/finite_state_machine/icon.webp
Normal file
|
After Width: | Height: | Size: 12 KiB |
34
2d/finite_state_machine/icon.webp.import
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[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
|
||||||
@@ -16,7 +16,8 @@ pattern in GDscript, including Hierarchical States, and a
|
|||||||
pushdown automaton."
|
pushdown automaton."
|
||||||
run/main_scene="res://Demo.tscn"
|
run/main_scene="res://Demo.tscn"
|
||||||
config/features=PackedStringArray("4.0")
|
config/features=PackedStringArray("4.0")
|
||||||
config/icon="res://icon.png"
|
config/icon="res://icon.webp"
|
||||||
|
config/tags=PackedStringArray("2d", "ai", "demo", "official")
|
||||||
|
|
||||||
[display]
|
[display]
|
||||||
|
|
||||||
@@ -86,7 +87,7 @@ simulate_damage={
|
|||||||
attack={
|
attack={
|
||||||
"deadzone": 0.5,
|
"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":70,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
|
"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":70,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":6,"pressure":0.0,"pressed":false,"script":null)
|
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":2,"pressure":0.0,"pressed":true,"script":null)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
BIN
2d/glow/icon.png
|
Before Width: | Height: | Size: 9.5 KiB |
@@ -1,34 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://bsjtxyyenw6db"
|
|
||||||
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/lossy_quality=0.7
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/bptc_ldr=0
|
|
||||||
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
|
|
||||||
BIN
2d/glow/icon.webp
Normal file
|
After Width: | Height: | Size: 7.4 KiB |
34
2d/glow/icon.webp.import
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[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
|
||||||
@@ -16,8 +16,9 @@ config/description="This showcases how to use glow in a 2D game via the WorldEnv
|
|||||||
Slide the cave image left and right to observe the glow effect at work."
|
Slide the cave image left and right to observe the glow effect at work."
|
||||||
run/main_scene="res://beach_cave.tscn"
|
run/main_scene="res://beach_cave.tscn"
|
||||||
config/features=PackedStringArray("4.0")
|
config/features=PackedStringArray("4.0")
|
||||||
config/icon="res://icon.png"
|
config/icon="res://icon.webp"
|
||||||
run/name=""
|
run/name=""
|
||||||
|
config/tags=PackedStringArray("2d", "demo", "official", "rendering")
|
||||||
|
|
||||||
[display]
|
[display]
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 19 KiB |
@@ -1,34 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://ddqj5gbtw2cxw"
|
|
||||||
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/lossy_quality=0.7
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/bptc_ldr=0
|
|
||||||
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
|
|
||||||
BIN
2d/hexagonal_map/icon.webp
Normal file
|
After Width: | Height: | Size: 14 KiB |
34
2d/hexagonal_map/icon.webp.import
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[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
|
||||||
@@ -14,7 +14,8 @@ config/name="Hexagonal Game"
|
|||||||
config/description="Very simple demo showing a hexagonal TileMap and TileSet."
|
config/description="Very simple demo showing a hexagonal TileMap and TileSet."
|
||||||
run/main_scene="res://map.tscn"
|
run/main_scene="res://map.tscn"
|
||||||
config/features=PackedStringArray("4.0")
|
config/features=PackedStringArray("4.0")
|
||||||
config/icon="res://icon.png"
|
config/icon="res://icon.webp"
|
||||||
|
config/tags=PackedStringArray("2d", "demo", "official", "tilemap")
|
||||||
|
|
||||||
[display]
|
[display]
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 2.2 KiB |
@@ -1,34 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://brbriwsl8w3bw"
|
|
||||||
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/lossy_quality=0.7
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/bptc_ldr=0
|
|
||||||
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
|
|
||||||
BIN
2d/instancing/icon.webp
Normal file
|
After Width: | Height: | Size: 9.6 KiB |
34
2d/instancing/icon.webp.import
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[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
|
||||||
@@ -15,7 +15,8 @@ config/description="A demo showing how to use scene instancing to
|
|||||||
make many duplicates of the same object."
|
make many duplicates of the same object."
|
||||||
run/main_scene="res://scene_instancing.tscn"
|
run/main_scene="res://scene_instancing.tscn"
|
||||||
config/features=PackedStringArray("4.0")
|
config/features=PackedStringArray("4.0")
|
||||||
config/icon="res://icon.png"
|
config/icon="res://icon.webp"
|
||||||
|
config/tags=PackedStringArray("2d", "demo", "official")
|
||||||
|
|
||||||
[display]
|
[display]
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 7.4 KiB |
BIN
2d/isometric/icon.webp
Normal file
|
After Width: | Height: | Size: 20 KiB |
34
2d/isometric/icon.webp.import
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[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
|
||||||
@@ -17,7 +17,8 @@ A character can move around the level and will also slide around objects,
|
|||||||
as well as be occluded when standing in front or behind them."
|
as well as be occluded when standing in front or behind them."
|
||||||
run/main_scene="res://dungeon.tscn"
|
run/main_scene="res://dungeon.tscn"
|
||||||
config/features=PackedStringArray("4.0")
|
config/features=PackedStringArray("4.0")
|
||||||
config/icon="res://icon.png"
|
config/icon="res://icon.webp"
|
||||||
|
config/tags=PackedStringArray("2d", "demo", "official", "tilemap")
|
||||||
|
|
||||||
[display]
|
[display]
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.2 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/lossy_quality=0.7
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/bptc_ldr=0
|
|
||||||
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
|
|
||||||
BIN
2d/kinematic_character/icon.webp
Normal file
|
After Width: | Height: | Size: 7.7 KiB |
34
2d/kinematic_character/icon.webp.import
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[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
|
||||||
@@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/circle.png-65a28e998f412b3cddff971e28b7d768.c
|
|||||||
[params]
|
[params]
|
||||||
|
|
||||||
compress/mode=0
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
compress/lossy_quality=0.7
|
compress/lossy_quality=0.7
|
||||||
compress/hdr_compression=1
|
compress/hdr_compression=1
|
||||||
compress/bptc_ldr=0
|
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
compress/channel_pack=0
|
compress/channel_pack=0
|
||||||
mipmaps/generate=false
|
mipmaps/generate=false
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/long_obstacle.png-d70ee394f796e1de9a423783aa8
|
|||||||
[params]
|
[params]
|
||||||
|
|
||||||
compress/mode=0
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
compress/lossy_quality=0.7
|
compress/lossy_quality=0.7
|
||||||
compress/hdr_compression=1
|
compress/hdr_compression=1
|
||||||
compress/bptc_ldr=0
|
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
compress/channel_pack=0
|
compress/channel_pack=0
|
||||||
mipmaps/generate=false
|
mipmaps/generate=false
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/obstacle.png-06287f6b2d26dd03335fd87ab78c2cc2
|
|||||||
[params]
|
[params]
|
||||||
|
|
||||||
compress/mode=0
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
compress/lossy_quality=0.7
|
compress/lossy_quality=0.7
|
||||||
compress/hdr_compression=1
|
compress/hdr_compression=1
|
||||||
compress/bptc_ldr=0
|
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
compress/channel_pack=0
|
compress/channel_pack=0
|
||||||
mipmaps/generate=false
|
mipmaps/generate=false
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/princess.png-359cb1d8a4fd115119b22ac7899e2787
|
|||||||
[params]
|
[params]
|
||||||
|
|
||||||
compress/mode=0
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
compress/lossy_quality=0.7
|
compress/lossy_quality=0.7
|
||||||
compress/hdr_compression=1
|
compress/hdr_compression=1
|
||||||
compress/bptc_ldr=0
|
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
compress/channel_pack=0
|
compress/channel_pack=0
|
||||||
mipmaps/generate=false
|
mipmaps/generate=false
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/player.png-1ad27fc2a62fa126eae918723933dd6f.c
|
|||||||
[params]
|
[params]
|
||||||
|
|
||||||
compress/mode=0
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
compress/lossy_quality=0.7
|
compress/lossy_quality=0.7
|
||||||
compress/hdr_compression=1
|
compress/hdr_compression=1
|
||||||
compress/bptc_ldr=0
|
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
compress/channel_pack=0
|
compress/channel_pack=0
|
||||||
mipmaps/generate=false
|
mipmaps/generate=false
|
||||||
|
|||||||
@@ -16,7 +16,8 @@ CharacterBody2D. The character moves around, is affected by moving
|
|||||||
platforms, can jump through one-way collision platforms, etc."
|
platforms, can jump through one-way collision platforms, etc."
|
||||||
run/main_scene="res://world.tscn"
|
run/main_scene="res://world.tscn"
|
||||||
config/features=PackedStringArray("4.0")
|
config/features=PackedStringArray("4.0")
|
||||||
config/icon="res://icon.png"
|
config/icon="res://icon.webp"
|
||||||
|
config/tags=PackedStringArray("2d", "demo", "official", "physics")
|
||||||
|
|
||||||
[display]
|
[display]
|
||||||
|
|
||||||
@@ -32,25 +33,25 @@ jump={
|
|||||||
"events": [Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":0,"pressure":0.0,"pressed":false,"script":null)
|
"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(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(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,"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":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,"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,"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={
|
move_left={
|
||||||
"deadzone": 0.5,
|
"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)
|
"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(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,"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":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,"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={
|
move_right={
|
||||||
"deadzone": 0.5,
|
"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)
|
"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(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,"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":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,"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)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -134,6 +134,7 @@ position = Vector2(268.651, 152)
|
|||||||
shape = SubResource("3")
|
shape = SubResource("3")
|
||||||
|
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="MovingPlatform1"]
|
[node name="Sprite2D" type="Sprite2D" parent="MovingPlatform1"]
|
||||||
|
modulate = Color(0.4, 2, 0.8, 1)
|
||||||
texture = ExtResource("2")
|
texture = ExtResource("2")
|
||||||
|
|
||||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="MovingPlatform1"]
|
[node name="AnimationPlayer" type="AnimationPlayer" parent="MovingPlatform1"]
|
||||||
@@ -150,6 +151,7 @@ position = Vector2(88.3493, 152)
|
|||||||
shape = SubResource("3")
|
shape = SubResource("3")
|
||||||
|
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="MovingPlatform2"]
|
[node name="Sprite2D" type="Sprite2D" parent="MovingPlatform2"]
|
||||||
|
modulate = Color(0.4, 2, 0.8, 1)
|
||||||
texture = ExtResource("2")
|
texture = ExtResource("2")
|
||||||
|
|
||||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="MovingPlatform2"]
|
[node name="AnimationPlayer" type="AnimationPlayer" parent="MovingPlatform2"]
|
||||||
@@ -229,6 +231,7 @@ position = Vector2(241.169, 304.126)
|
|||||||
rotation = -0.0790058
|
rotation = -0.0790058
|
||||||
|
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="Circle"]
|
[node name="Sprite2D" type="Sprite2D" parent="Circle"]
|
||||||
|
modulate = Color(0.4, 2, 0.8, 1)
|
||||||
texture = ExtResource("5")
|
texture = ExtResource("5")
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Circle"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Circle"]
|
||||||
@@ -241,6 +244,7 @@ libraries = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[node name="BoxSprite" type="Sprite2D" parent="Circle"]
|
[node name="BoxSprite" type="Sprite2D" parent="Circle"]
|
||||||
|
modulate = Color(0.4, 2, 0.8, 1)
|
||||||
position = Vector2(-3.05176e-05, -37.4108)
|
position = Vector2(-3.05176e-05, -37.4108)
|
||||||
texture = ExtResource("2")
|
texture = ExtResource("2")
|
||||||
|
|
||||||
@@ -272,7 +276,6 @@ shape = SubResource("12")
|
|||||||
|
|
||||||
[node name="Camera2D" type="Camera2D" parent="."]
|
[node name="Camera2D" type="Camera2D" parent="."]
|
||||||
offset = Vector2(265, 247)
|
offset = Vector2(265, 247)
|
||||||
current = true
|
|
||||||
|
|
||||||
[node name="Player" parent="." instance=ExtResource("3")]
|
[node name="Player" parent="." instance=ExtResource("3")]
|
||||||
position = Vector2(233.06, 223.436)
|
position = Vector2(233.06, 223.436)
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 3.0 KiB |
@@ -1,34 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://1obhenjndqh"
|
|
||||||
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/lossy_quality=0.7
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/bptc_ldr=0
|
|
||||||
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
|
|
||||||
BIN
2d/light2d_as_mask/icon.webp
Normal file
|
After Width: | Height: | Size: 16 KiB |
34
2d/light2d_as_mask/icon.webp.import
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[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
|
||||||
@@ -14,7 +14,8 @@ config/name="2D Lights as Mask"
|
|||||||
config/description="Example of how to use 2D lights to mask objects on screen."
|
config/description="Example of how to use 2D lights to mask objects on screen."
|
||||||
run/main_scene="res://lightmask.tscn"
|
run/main_scene="res://lightmask.tscn"
|
||||||
config/features=PackedStringArray("4.0")
|
config/features=PackedStringArray("4.0")
|
||||||
config/icon="res://icon.png"
|
config/icon="res://icon.webp"
|
||||||
|
config/tags=PackedStringArray("2d", "demo", "official", "rendering")
|
||||||
|
|
||||||
[display]
|
[display]
|
||||||
|
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/background.png-98289422cd7d93003950872a7b9702
|
|||||||
[params]
|
[params]
|
||||||
|
|
||||||
compress/mode=0
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
compress/lossy_quality=0.7
|
compress/lossy_quality=0.7
|
||||||
compress/hdr_compression=1
|
compress/hdr_compression=1
|
||||||
compress/bptc_ldr=0
|
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
compress/channel_pack=0
|
compress/channel_pack=0
|
||||||
mipmaps/generate=false
|
mipmaps/generate=false
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/caster.png-67727cb056b9e0209664a84f1653a25a.c
|
|||||||
[params]
|
[params]
|
||||||
|
|
||||||
compress/mode=0
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
compress/lossy_quality=0.7
|
compress/lossy_quality=0.7
|
||||||
compress/hdr_compression=1
|
compress/hdr_compression=1
|
||||||
compress/bptc_ldr=0
|
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
compress/channel_pack=0
|
compress/channel_pack=0
|
||||||
mipmaps/generate=false
|
mipmaps/generate=false
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/godot.png-5e0da45ed3d6786d5794553e04f58a8c.ct
|
|||||||
[params]
|
[params]
|
||||||
|
|
||||||
compress/mode=0
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
compress/lossy_quality=0.7
|
compress/lossy_quality=0.7
|
||||||
compress/hdr_compression=1
|
compress/hdr_compression=1
|
||||||
compress/bptc_ldr=0
|
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
compress/channel_pack=0
|
compress/channel_pack=0
|
||||||
mipmaps/generate=false
|
mipmaps/generate=false
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/godot_normal.png-7f91d6bfda6a23aaa1320ed999c2
|
|||||||
[params]
|
[params]
|
||||||
|
|
||||||
compress/mode=0
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
compress/lossy_quality=0.7
|
compress/lossy_quality=0.7
|
||||||
compress/hdr_compression=1
|
compress/hdr_compression=1
|
||||||
compress/bptc_ldr=0
|
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
compress/channel_pack=0
|
compress/channel_pack=0
|
||||||
mipmaps/generate=false
|
mipmaps/generate=false
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 2.4 KiB |
@@ -1,34 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://byckt0v7uvncx"
|
|
||||||
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/lossy_quality=0.7
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/bptc_ldr=0
|
|
||||||
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
|
|
||||||
BIN
2d/lights_and_shadows/icon.webp
Normal file
|
After Width: | Height: | Size: 9.7 KiB |
34
2d/lights_and_shadows/icon.webp.import
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[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
|
||||||
@@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/light.png-06e94102f0cce323cff7daad56cf3030.ct
|
|||||||
[params]
|
[params]
|
||||||
|
|
||||||
compress/mode=0
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
compress/lossy_quality=0.7
|
compress/lossy_quality=0.7
|
||||||
compress/hdr_compression=1
|
compress/hdr_compression=1
|
||||||
compress/bptc_ldr=0
|
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
compress/channel_pack=0
|
compress/channel_pack=0
|
||||||
mipmaps/generate=false
|
mipmaps/generate=false
|
||||||
|
|||||||
@@ -15,7 +15,8 @@ config/description="Simple demo of 2D lights and shadows,
|
|||||||
using PointLight2D and LightOccluder2D."
|
using PointLight2D and LightOccluder2D."
|
||||||
run/main_scene="res://light_shadows.tscn"
|
run/main_scene="res://light_shadows.tscn"
|
||||||
config/features=PackedStringArray("4.0")
|
config/features=PackedStringArray("4.0")
|
||||||
config/icon="res://icon.png"
|
config/icon="res://icon.webp"
|
||||||
|
config/tags=PackedStringArray("2d", "demo", "official", "rendering")
|
||||||
|
|
||||||
[display]
|
[display]
|
||||||
|
|
||||||
@@ -27,21 +28,21 @@ window/stretch/aspect="expand"
|
|||||||
|
|
||||||
toggle_directional_light={
|
toggle_directional_light={
|
||||||
"deadzone": 0.5,
|
"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":68,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
|
"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":68,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
toggle_point_lights={
|
toggle_point_lights={
|
||||||
"deadzone": 0.5,
|
"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":80,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
|
"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":80,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
cycle_directional_light_shadows_quality={
|
cycle_directional_light_shadows_quality={
|
||||||
"deadzone": 0.5,
|
"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":83,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
|
"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":83,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
cycle_point_light_shadows_quality={
|
cycle_point_light_shadows_quality={
|
||||||
"deadzone": 0.5,
|
"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":72,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
|
"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":72,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/spot.png-36b4dfbff4efeea17ec3137d266ffc4a.cte
|
|||||||
[params]
|
[params]
|
||||||
|
|
||||||
compress/mode=0
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
compress/lossy_quality=0.7
|
compress/lossy_quality=0.7
|
||||||
compress/hdr_compression=1
|
compress/hdr_compression=1
|
||||||
compress/bptc_ldr=0
|
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
compress/channel_pack=0
|
compress/channel_pack=0
|
||||||
mipmaps/generate=false
|
mipmaps/generate=false
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
# Navigation Polygon 2D
|
# Navigation Polygon 2D
|
||||||
|
|
||||||
Example of using 2D navigation using a
|
Example of using 2D navigation using:
|
||||||
[`NavigationPolygon`](https://docs.godotengine.org/en/latest/classes/class_navigationpolygon.html)
|
- [`NavigationRegion2D`](https://docs.godotengine.org/en/latest/classes/class_navigationregion2d.html)
|
||||||
in a [`NavigationPolygonInstance`](https://docs.godotengine.org/en/latest/classes/class_navigationpolygoninstance.html) node.
|
- [`NavigationPolygon`](https://docs.godotengine.org/en/latest/classes/class_navigationpolygon.html)
|
||||||
It uses the 2D navigation API to request a path between two points,
|
- [`NavigationAgent2D`](https://docs.godotengine.org/en/latest/classes/class_navigationagent2d.html)
|
||||||
and then traverses the resulting path.
|
|
||||||
|
|
||||||
Language: GDScript
|
Language: GDScript
|
||||||
|
|
||||||
Renderer: GLES 2
|
Renderer: Forward+
|
||||||
|
|
||||||
Check out this demo on the asset library: https://godotengine.org/asset-library/asset/117
|
Check out this demo on the asset library: https://godotengine.org/asset-library/asset/117
|
||||||
|
|
||||||
|
|||||||
36
2d/navigation/character.gd
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
extends CharacterBody2D
|
||||||
|
|
||||||
|
|
||||||
|
var movement_speed: float = 200.0
|
||||||
|
@onready var navigation_agent: NavigationAgent2D = $NavigationAgent2D
|
||||||
|
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
# These values need to be adjusted for the actor's speed
|
||||||
|
# and the navigation layout.
|
||||||
|
navigation_agent.path_desired_distance = 2.0
|
||||||
|
navigation_agent.target_desired_distance = 2.0
|
||||||
|
navigation_agent.debug_enabled = true
|
||||||
|
|
||||||
|
|
||||||
|
# The "click" event is a custom input action defined in
|
||||||
|
# Project > Project Settings > Input Map tab.
|
||||||
|
func _unhandled_input(event):
|
||||||
|
if not event.is_action_pressed("click"):
|
||||||
|
return
|
||||||
|
set_movement_target(get_global_mouse_position())
|
||||||
|
|
||||||
|
|
||||||
|
func set_movement_target(movement_target: Vector2):
|
||||||
|
navigation_agent.target_position = movement_target
|
||||||
|
|
||||||
|
|
||||||
|
func _physics_process(_delta):
|
||||||
|
if navigation_agent.is_navigation_finished():
|
||||||
|
return
|
||||||
|
|
||||||
|
var current_agent_position: Vector2 = global_position
|
||||||
|
var next_path_position: Vector2 = navigation_agent.get_next_path_position()
|
||||||
|
|
||||||
|
velocity = current_agent_position.direction_to(next_path_position) * movement_speed
|
||||||
|
move_and_slide()
|
||||||
@@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/character.png-7a996d3b758d22c506b76a7c1539128
|
|||||||
[params]
|
[params]
|
||||||
|
|
||||||
compress/mode=0
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
compress/lossy_quality=0.7
|
compress/lossy_quality=0.7
|
||||||
compress/hdr_compression=1
|
compress/hdr_compression=1
|
||||||
compress/bptc_ldr=0
|
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
compress/channel_pack=0
|
compress/channel_pack=0
|
||||||
mipmaps/generate=false
|
mipmaps/generate=false
|
||||||
|
|||||||
22
2d/navigation/character.tscn
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
[gd_scene load_steps=4 format=3 uid="uid://ct7veakwiei3h"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://character.gd" id="1_8uimh"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://b0wokaenwu7pj" path="res://character.png" id="1_rmg12"]
|
||||||
|
|
||||||
|
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_20ukx"]
|
||||||
|
radius = 7.0
|
||||||
|
height = 22.0
|
||||||
|
|
||||||
|
[node name="Character" type="CharacterBody2D"]
|
||||||
|
script = ExtResource("1_8uimh")
|
||||||
|
|
||||||
|
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||||
|
position = Vector2(0, -3)
|
||||||
|
scale = Vector2(0.3, 0.3)
|
||||||
|
texture = ExtResource("1_rmg12")
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
position = Vector2(0, -3)
|
||||||
|
shape = SubResource("CapsuleShape2D_20ukx")
|
||||||
|
|
||||||
|
[node name="NavigationAgent2D" type="NavigationAgent2D" parent="."]
|
||||||
|
Before Width: | Height: | Size: 1.9 KiB |
@@ -1,34 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://2ft5n3ts7upn"
|
|
||||||
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/lossy_quality=0.7
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/bptc_ldr=0
|
|
||||||
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
|
|
||||||
BIN
2d/navigation/icon.webp
Normal file
|
After Width: | Height: | Size: 9.3 KiB |
34
2d/navigation/icon.webp.import
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[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,32 +0,0 @@
|
|||||||
[gd_scene load_steps=5 format=3 uid="uid://cur17tkfqetf0"]
|
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://navigation.gd" id="1"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://bk26gi6qsuh18" path="res://map.png" id="2"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://b0wokaenwu7pj" path="res://character.png" id="3"]
|
|
||||||
|
|
||||||
[sub_resource type="NavigationPolygon" id="NavigationPolygon_5ynhe"]
|
|
||||||
vertices = PackedVector2Array(682, 496, 696, 300, 704, 507, 495, 256, 589, 270, 540, 284, 466, 177, 490, 169, 531, 178, 477, 205, 446, 196, 621, 510, 667, 525, 606, 519, 529, 290, 288, 228, 228, 180, 276, 160, 315, 190, 600, 497, 576, 503, 202, 99, 314, 65, 311, 83, 436, 170, 452, 163, 201, 440, 246, 478, 223, 490, 211, 485, 146, 400, 185, 381, 586, 178, 596, 188, 474, 252, 462, 127, 479, 150, 416, 180, 395, 516, 302, 499, 320, 450, 354, 445, 535, 516, 538, 106, 537, 173, 493, 166, 506, 97, 514, 51, 486, 83, 327, 77, 309, 96, 306, 113, 272, 153, 219, 172, 178, 152, 148, 224, 189, 231, 171, 328, 176, 347, 259, 404, 432, 249, 365, 346, 525, 342, 314, 340, 271, 336, 241, 321, 235, 284, 242, 247, 324, 336, 616, 360, 645, 381, 645, 404, 614, 492)
|
|
||||||
polygons = [PackedInt32Array(0, 1, 2), PackedInt32Array(3, 4, 5), PackedInt32Array(6, 7, 8, 9, 10), PackedInt32Array(11, 0, 2, 12, 13), PackedInt32Array(3, 5, 14), PackedInt32Array(15, 16, 17, 18), PackedInt32Array(19, 11, 13, 20), PackedInt32Array(21, 22, 23), PackedInt32Array(6, 10, 24, 25), PackedInt32Array(26, 27, 28, 29, 30), PackedInt32Array(31, 26, 30), PackedInt32Array(32, 33, 3, 34), PackedInt32Array(18, 35, 36, 25, 24), PackedInt32Array(18, 24, 37), PackedInt32Array(38, 39, 40, 41, 42), PackedInt32Array(43, 44, 45, 46), PackedInt32Array(47, 43, 46, 48), PackedInt32Array(49, 47, 48, 50, 23), PackedInt32Array(21, 23, 50, 51, 52, 53, 54), PackedInt32Array(55, 54, 53, 56), PackedInt32Array(30, 55, 56, 57), PackedInt32Array(30, 57, 58), PackedInt32Array(31, 30, 58), PackedInt32Array(31, 58, 59, 40), PackedInt32Array(40, 59, 41), PackedInt32Array(18, 37, 60, 15), PackedInt32Array(20, 42, 41, 61, 60, 34, 3, 62), PackedInt32Array(63, 64, 65, 66, 67, 15, 60, 68), PackedInt32Array(61, 68, 60), PackedInt32Array(62, 69, 70, 71, 72, 19, 20), PackedInt32Array(62, 3, 14)]
|
|
||||||
outlines = [PackedVector2Array(314, 65, 311, 83, 327, 77, 514, 51, 538, 106, 537, 173, 493, 166, 506, 97, 486, 83, 309, 96, 306, 113, 272, 153, 219, 172, 189, 231, 171, 328, 176, 347, 259, 404, 354, 445, 365, 346, 324, 336, 314, 340, 271, 336, 241, 321, 235, 284, 242, 247, 288, 228, 228, 180, 276, 160, 315, 190, 462, 127, 479, 150, 452, 163, 466, 177, 490, 169, 531, 178, 477, 205, 446, 196, 436, 170, 416, 180, 432, 249, 474, 252, 586, 178, 596, 188, 495, 256, 589, 270, 540, 284, 529, 290, 525, 342, 616, 360, 645, 381, 645, 404, 614, 492, 600, 497, 621, 510, 682, 496, 696, 300, 704, 507, 667, 525, 606, 519, 576, 503, 535, 516, 395, 516, 302, 499, 320, 450, 185, 381, 201, 440, 246, 478, 223, 490, 211, 485, 146, 400, 148, 224, 178, 152, 202, 99)]
|
|
||||||
|
|
||||||
[node name="Node2D" type="Node2D"]
|
|
||||||
script = ExtResource("1")
|
|
||||||
|
|
||||||
[node name="Map" type="Sprite2D" parent="."]
|
|
||||||
position = Vector2(429.585, 287.32)
|
|
||||||
texture = ExtResource("2")
|
|
||||||
|
|
||||||
[node name="Camera2D" type="Camera2D" parent="."]
|
|
||||||
offset = Vector2(420, 300)
|
|
||||||
current = true
|
|
||||||
|
|
||||||
[node name="Character" type="Sprite2D" parent="."]
|
|
||||||
position = Vector2(228.464, 132.594)
|
|
||||||
scale = Vector2(0.5, 0.5)
|
|
||||||
texture = ExtResource("3")
|
|
||||||
offset = Vector2(0, -26)
|
|
||||||
|
|
||||||
[node name="NavigationRegion2d" type="NavigationRegion2D" parent="."]
|
|
||||||
navpoly = SubResource("NavigationPolygon_5ynhe")
|
|
||||||
|
|
||||||
[node name="NavigationAgent2d" type="NavigationAgent2D" parent="."]
|
|
||||||
@@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/map.png-9eea34967fae34f4388f4a32a16da936.ctex
|
|||||||
[params]
|
[params]
|
||||||
|
|
||||||
compress/mode=0
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
compress/lossy_quality=0.7
|
compress/lossy_quality=0.7
|
||||||
compress/hdr_compression=1
|
compress/hdr_compression=1
|
||||||
compress/bptc_ldr=0
|
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
compress/channel_pack=0
|
compress/channel_pack=0
|
||||||
mipmaps/generate=false
|
mipmaps/generate=false
|
||||||
|
|||||||
@@ -1,60 +0,0 @@
|
|||||||
extends Node2D
|
|
||||||
|
|
||||||
@export var character_speed: float = 400.0
|
|
||||||
var path = []
|
|
||||||
|
|
||||||
@onready var character = $Character
|
|
||||||
|
|
||||||
#var navmap = NavigationServer2D.map_create()
|
|
||||||
|
|
||||||
|
|
||||||
func _ready():
|
|
||||||
pass
|
|
||||||
#NavigationServer2D.region_set_map(navmap, $NavigationRegion2d.get_rid())
|
|
||||||
|
|
||||||
|
|
||||||
func _process(delta):
|
|
||||||
character.position = $NavigationAgent2d.get_next_location()
|
|
||||||
var walk_distance = character_speed * delta
|
|
||||||
#move_along_path(walk_distance)
|
|
||||||
|
|
||||||
|
|
||||||
# The "click" event is a custom input action defined in
|
|
||||||
# Project > Project Settings > Input Map tab.
|
|
||||||
func _unhandled_input(event):
|
|
||||||
if not event.is_action_pressed("click"):
|
|
||||||
return
|
|
||||||
_update_navigation_path(Vector2(), get_local_mouse_position())
|
|
||||||
|
|
||||||
#func move_along_path(distance):
|
|
||||||
# return
|
|
||||||
# var last_point = character.position
|
|
||||||
# while path.size():
|
|
||||||
# var distance_between_points = last_point.distance_to(path[0])
|
|
||||||
# # The position to move to falls between two points.
|
|
||||||
# if distance <= distance_between_points:
|
|
||||||
# character.position = last_point.lerp(path[0], distance / distance_between_points)
|
|
||||||
# return
|
|
||||||
# # The position is past the end of the segment.
|
|
||||||
# distance -= distance_between_points
|
|
||||||
# last_point = path[0]
|
|
||||||
# path.remove(0)
|
|
||||||
# # The character reached the end of the path.
|
|
||||||
# character.position = last_point
|
|
||||||
# set_process(false)
|
|
||||||
|
|
||||||
var drawpos = Vector2()
|
|
||||||
func _update_navigation_path(start_position, end_position):
|
|
||||||
# get_simple_path is part of the Node2D class.
|
|
||||||
# It returns a PackedVector2Array of points that lead you
|
|
||||||
# from the start_position to the end_position.
|
|
||||||
$NavigationAgent2d.set_target_location(end_position)
|
|
||||||
drawpos = end_position
|
|
||||||
queue_redraw()
|
|
||||||
# The first point is always the start_position.
|
|
||||||
# We don't need it in this example as it corresponds to the character's position.
|
|
||||||
#path.remove(0)
|
|
||||||
#set_process(true)
|
|
||||||
|
|
||||||
func _draw():
|
|
||||||
draw_circle(drawpos, 10, Color.RED)
|
|
||||||
18
2d/navigation/navigation.tscn
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
[gd_scene load_steps=4 format=3 uid="uid://bjgad00c2xiuc"]
|
||||||
|
|
||||||
|
[ext_resource type="Texture2D" uid="uid://bk26gi6qsuh18" path="res://map.png" id="2_nxfkp"]
|
||||||
|
[ext_resource type="NavigationPolygon" uid="uid://bk5r48dcijlqt" path="res://navigation_polygon.res" id="3_6c0vu"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://ct7veakwiei3h" path="res://character.tscn" id="4_n6iop"]
|
||||||
|
|
||||||
|
[node name="Navigation" type="Node2D"]
|
||||||
|
|
||||||
|
[node name="Map" type="Sprite2D" parent="."]
|
||||||
|
z_index = -1
|
||||||
|
position = Vector2(400, 302)
|
||||||
|
texture = ExtResource("2_nxfkp")
|
||||||
|
|
||||||
|
[node name="NavigationRegion2D" type="NavigationRegion2D" parent="."]
|
||||||
|
navigation_polygon = ExtResource("3_6c0vu")
|
||||||
|
|
||||||
|
[node name="Character" parent="." instance=ExtResource("4_n6iop")]
|
||||||
|
position = Vector2(211, 141)
|
||||||
BIN
2d/navigation/navigation_polygon.res
Normal file
@@ -14,9 +14,10 @@ config/name="Navigation Polygon 2D"
|
|||||||
config/description="Example of using 2D navigation using a NavigationPolygon in a
|
config/description="Example of using 2D navigation using a NavigationPolygon in a
|
||||||
NavigationPolygonInstance node. It uses the 2D navigation API to request
|
NavigationPolygonInstance node. It uses the 2D navigation API to request
|
||||||
a path between two points, and then traverses the resulting path."
|
a path between two points, and then traverses the resulting path."
|
||||||
run/main_scene="res://level.tscn"
|
config/tags=PackedStringArray("2d", "ai", "demo", "official")
|
||||||
config/features=PackedStringArray("4.0")
|
run/main_scene="res://navigation.tscn"
|
||||||
config/icon="res://icon.png"
|
config/features=PackedStringArray("4.1")
|
||||||
|
config/icon="res://icon.webp"
|
||||||
|
|
||||||
[display]
|
[display]
|
||||||
|
|
||||||
@@ -28,7 +29,7 @@ window/stretch/aspect="expand"
|
|||||||
|
|
||||||
click={
|
click={
|
||||||
"deadzone": 0.5,
|
"deadzone": 0.5,
|
||||||
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":1,"pressed":false,"double_click":false,"script":null)
|
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":1,"canceled":false,"pressed":false,"double_click":false,"script":null)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.7 KiB |
BIN
2d/navigation_astar/icon.webp
Normal file
|
After Width: | Height: | Size: 8.9 KiB |
34
2d/navigation_astar/icon.webp.import
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[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
|
||||||
@@ -8,18 +8,13 @@ const DRAW_COLOR = Color.WHITE
|
|||||||
|
|
||||||
# The object for pathfinding on 2D grids.
|
# The object for pathfinding on 2D grids.
|
||||||
var _astar = AStarGrid2D.new()
|
var _astar = AStarGrid2D.new()
|
||||||
var _map_rect = Rect2i()
|
|
||||||
|
|
||||||
var _start_point = Vector2i()
|
var _start_point = Vector2i()
|
||||||
var _end_point = Vector2i()
|
var _end_point = Vector2i()
|
||||||
var _path = PackedVector2Array()
|
var _path = PackedVector2Array()
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
# Let's assume that the entire map is located at non-negative coordinates.
|
_astar.region = get_used_rect()
|
||||||
var map_size = get_used_rect().end
|
|
||||||
_map_rect = Rect2i(Vector2i(), map_size)
|
|
||||||
|
|
||||||
_astar.size = map_size
|
|
||||||
_astar.cell_size = CELL_SIZE
|
_astar.cell_size = CELL_SIZE
|
||||||
_astar.offset = CELL_SIZE * 0.5
|
_astar.offset = CELL_SIZE * 0.5
|
||||||
_astar.default_compute_heuristic = AStarGrid2D.HEURISTIC_MANHATTAN
|
_astar.default_compute_heuristic = AStarGrid2D.HEURISTIC_MANHATTAN
|
||||||
@@ -27,8 +22,8 @@ func _ready():
|
|||||||
_astar.diagonal_mode = AStarGrid2D.DIAGONAL_MODE_NEVER
|
_astar.diagonal_mode = AStarGrid2D.DIAGONAL_MODE_NEVER
|
||||||
_astar.update()
|
_astar.update()
|
||||||
|
|
||||||
for i in map_size.x:
|
for i in range(_astar.region.position.x, _astar.region.end.x):
|
||||||
for j in map_size.y:
|
for j in range(_astar.region.position.y, _astar.region.end.y):
|
||||||
var pos = Vector2i(i, j)
|
var pos = Vector2i(i, j)
|
||||||
if get_cell_source_id(0, pos) == Tile.OBSTACLE:
|
if get_cell_source_id(0, pos) == Tile.OBSTACLE:
|
||||||
_astar.set_point_solid(pos)
|
_astar.set_point_solid(pos)
|
||||||
@@ -52,7 +47,7 @@ func round_local_position(local_position):
|
|||||||
|
|
||||||
func is_point_walkable(local_position):
|
func is_point_walkable(local_position):
|
||||||
var map_position = local_to_map(local_position)
|
var map_position = local_to_map(local_position)
|
||||||
if _map_rect.has_point(map_position):
|
if _astar.is_in_boundsv(map_position):
|
||||||
return not _astar.is_point_solid(map_position)
|
return not _astar.is_point_solid(map_position)
|
||||||
return false
|
return false
|
||||||
|
|
||||||
|
|||||||
@@ -14,8 +14,9 @@ config/name="Grid-based Pathfinding with AStarGrid2D"
|
|||||||
config/description="This is an example of using AStarGrid2D for navigation in 2D,
|
config/description="This is an example of using AStarGrid2D for navigation in 2D,
|
||||||
complete with Steering Behaviors in order to smooth the movement out."
|
complete with Steering Behaviors in order to smooth the movement out."
|
||||||
run/main_scene="res://game.tscn"
|
run/main_scene="res://game.tscn"
|
||||||
config/features=PackedStringArray("4.0")
|
config/features=PackedStringArray("4.1")
|
||||||
config/icon="res://icon.png"
|
config/icon="res://icon.webp"
|
||||||
|
config/tags=PackedStringArray("2d", "ai", "demo", "official", "tilemap")
|
||||||
|
|
||||||
[display]
|
[display]
|
||||||
|
|
||||||
|
|||||||