Optimizations and extra tiles/textures for the future
This commit is contained in:
parent
ecab582c7f
commit
106efecf55
16
combined/main.tscn
Normal file
16
combined/main.tscn
Normal file
|
@ -0,0 +1,16 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://cjs660cs0u4rk"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://b17vn1ecnbc36" path="res://logic/world/world.tscn" id="1_tg0rs"]
|
||||
[ext_resource type="Script" uid="uid://f1n37ucrb0j4" path="res://logic/camera/camera.gd" id="2_ahkbh"]
|
||||
[ext_resource type="PackedScene" uid="uid://cgrgaehjqja4d" path="res://logic/world/chunk/chunk_drawing.tscn" id="3_gphrn"]
|
||||
|
||||
[node name="Main" type="Node2D"]
|
||||
|
||||
[node name="World" parent="." instance=ExtResource("1_tg0rs")]
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="."]
|
||||
script = ExtResource("2_ahkbh")
|
||||
|
||||
[node name="Chunk Drawing" parent="." node_paths=PackedStringArray("world", "camera") instance=ExtResource("3_gphrn")]
|
||||
world = NodePath("../World")
|
||||
camera = NodePath("../Camera2D")
|
|
@ -1 +1,6 @@
|
|||
extends Node
|
||||
|
||||
var seed : int
|
||||
|
||||
func _ready() -> void:
|
||||
seed = randi()
|
||||
|
|
41
logic/camera/camera.gd
Normal file
41
logic/camera/camera.gd
Normal file
|
@ -0,0 +1,41 @@
|
|||
extends Camera2D
|
||||
|
||||
class_name WorldCamera
|
||||
|
||||
var last_drag_position : Vector2
|
||||
|
||||
var dragging = false
|
||||
|
||||
@export var zoom_constant : float = 1.1
|
||||
|
||||
@export var min_zoom = 0.3
|
||||
@export var max_zoom = 3
|
||||
|
||||
func get_camera_rect() -> Rect2:
|
||||
var pos = position
|
||||
var size = get_viewport_rect().size / zoom
|
||||
return Rect2(pos - size / 2, size)
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if event is InputEventMouseButton:
|
||||
if event.button_index == MOUSE_BUTTON_MIDDLE:
|
||||
dragging = event.pressed
|
||||
last_drag_position = get_local_mouse_position()
|
||||
if event.button_index == MOUSE_BUTTON_WHEEL_DOWN:
|
||||
zoom_out()
|
||||
if event.button_index == MOUSE_BUTTON_WHEEL_UP:
|
||||
zoom_in()
|
||||
|
||||
func zoom_out():
|
||||
if zoom.x / zoom_constant > min_zoom:
|
||||
zoom /= zoom_constant
|
||||
|
||||
func zoom_in():
|
||||
if zoom.x * zoom_constant < max_zoom:
|
||||
zoom *= zoom_constant
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if dragging:
|
||||
var current_mouse_position = get_local_mouse_position()
|
||||
position += (last_drag_position - current_mouse_position)
|
||||
last_drag_position = current_mouse_position
|
1
logic/camera/camera.gd.uid
Normal file
1
logic/camera/camera.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://f1n37ucrb0j4
|
4
logic/mechanics/arrow/arrow.gd
Normal file
4
logic/mechanics/arrow/arrow.gd
Normal file
|
@ -0,0 +1,4 @@
|
|||
class_name Arrow
|
||||
|
||||
var direction : Vector2i
|
||||
var filter : int
|
1
logic/mechanics/arrow/arrow.gd.uid
Normal file
1
logic/mechanics/arrow/arrow.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://dlg5eb7b1xitl
|
7
logic/mechanics/item/item.gd
Normal file
7
logic/mechanics/item/item.gd
Normal file
|
@ -0,0 +1,7 @@
|
|||
class_name Item
|
||||
|
||||
var id : int
|
||||
var direction : Vector2i
|
||||
|
||||
func _init(id : int):
|
||||
self.id = id
|
1
logic/mechanics/item/item.gd.uid
Normal file
1
logic/mechanics/item/item.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://bw6aoqk7m4ter
|
6
logic/mechanics/item/item_definition.gd
Normal file
6
logic/mechanics/item/item_definition.gd
Normal file
|
@ -0,0 +1,6 @@
|
|||
extends Resource
|
||||
|
||||
class_name ItemDefinition
|
||||
|
||||
@export var name : String
|
||||
@export var base : bool = false
|
1
logic/mechanics/item/item_definition.gd.uid
Normal file
1
logic/mechanics/item/item_definition.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://shau2ou14l0t
|
5
logic/mechanics/item/item_definition_array.gd
Normal file
5
logic/mechanics/item/item_definition_array.gd
Normal file
|
@ -0,0 +1,5 @@
|
|||
extends Resource
|
||||
|
||||
class_name ItemDefinitionArray
|
||||
|
||||
@export var item_definitions : Array[ItemDefinition]
|
1
logic/mechanics/item/item_definition_array.gd.uid
Normal file
1
logic/mechanics/item/item_definition_array.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://csr0k4rp8ifm5
|
14
logic/mechanics/item/item_globals.gd
Normal file
14
logic/mechanics/item/item_globals.gd
Normal file
|
@ -0,0 +1,14 @@
|
|||
extends Node
|
||||
|
||||
var item_definitions : Array[ItemDefinition]
|
||||
var item_atlas : CompressedTexture2DArray
|
||||
|
||||
const chunk_size : int = 32
|
||||
const tile_size : int = 16
|
||||
|
||||
func _init():
|
||||
|
||||
var item_definition_array : ItemDefinitionArray = preload("res://resources/items/base_items.tres")
|
||||
item_definitions = item_definition_array.item_definitions
|
||||
|
||||
item_atlas = preload("res://resources/items/textures/item_atlas.png")
|
1
logic/mechanics/item/item_globals.gd.uid
Normal file
1
logic/mechanics/item/item_globals.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://d3rlput1on3pt
|
|
@ -1,24 +1,41 @@
|
|||
extends Node2D
|
||||
class_name Chunk
|
||||
|
||||
var tiles : Array[Tile]
|
||||
var chunk_offset : Vector2i
|
||||
var tiles : Array[int]
|
||||
var position : Vector2i
|
||||
|
||||
var items : Dictionary[Vector2i, Item]
|
||||
var arrows : Dictionary[Vector2i, Arrow]
|
||||
|
||||
func _init(position : Vector2i) -> void:
|
||||
self.position = position
|
||||
|
||||
var noise : FastNoiseLite = FastNoiseLite.new()
|
||||
noise.noise_type = FastNoiseLite.TYPE_PERLIN
|
||||
noise.fractal_type = FastNoiseLite.FRACTAL_FBM
|
||||
|
||||
noise.seed = Globals.seed
|
||||
noise.frequency = 0.025
|
||||
|
||||
noise.fractal_octaves = 5
|
||||
noise.fractal_lacunarity = 2
|
||||
noise.fractal_gain = 0.5
|
||||
|
||||
var x : int = 0
|
||||
var y : int = 0
|
||||
|
||||
var offset : Vector2i = position * TileGlobals.chunk_size
|
||||
|
||||
func _init() -> void:
|
||||
for i in range(TileGlobals.chunk_size ** 2):
|
||||
tiles.append(Tile.new())
|
||||
if x >= TileGlobals.chunk_size:
|
||||
x = 0
|
||||
y += 1
|
||||
|
||||
var point_value : float = remap(noise.get_noise_2d(x+offset.x,y+offset.y), -1, 1, 0, 1)
|
||||
var tile_id : int = TileGlobals.chunk_gradient.sample(point_value).r8
|
||||
|
||||
tiles.append(tile_id)
|
||||
|
||||
x += 1
|
||||
|
||||
func get_tile(pos : Vector2i):
|
||||
return tiles[pos.y * TileGlobals.chunk_size + pos.x]
|
||||
|
||||
func _draw() -> void:
|
||||
var x : int = 0
|
||||
var y : int = 0
|
||||
|
||||
for tile in tiles:
|
||||
var tile_definition : TileDefinition = TileGlobals.tile_definitions[tile.id]
|
||||
draw_texture(tile_definition.texture, Vector2(x, y) * TileGlobals.tile_size)
|
||||
|
||||
x += 1
|
||||
if x >= TileGlobals.chunk_size:
|
||||
y += 1
|
||||
x = 0
|
||||
|
|
25
logic/world/chunk/chunk.gdshader
Normal file
25
logic/world/chunk/chunk.gdshader
Normal file
|
@ -0,0 +1,25 @@
|
|||
shader_type canvas_item;
|
||||
|
||||
uniform float tile_count;
|
||||
|
||||
const int chunk_size = 32;
|
||||
|
||||
uniform int tiles[chunk_size*chunk_size];
|
||||
uniform int items[chunk_size*chunk_size];
|
||||
|
||||
uniform sampler2DArray tile_texture : filter_nearest_mipmap;
|
||||
uniform sampler2DArray item_texture : filter_nearest;
|
||||
|
||||
void fragment() {
|
||||
float item_id = float(items[int(floor(float(chunk_size) * UV.x) + float(chunk_size) * floor(float(chunk_size) * UV.y))]);
|
||||
COLOR = texture(item_texture,
|
||||
vec3(mod(UV.x * float(chunk_size), 1.0), mod(UV.y * float(chunk_size), 1.0), float(item_id)) // map
|
||||
);
|
||||
|
||||
if (COLOR == vec4(0,0,0,0)){
|
||||
float tile_id = float(tiles[int(floor(float(chunk_size) * UV.x) + float(chunk_size) * floor(float(chunk_size) * UV.y))]);
|
||||
COLOR = texture(tile_texture,
|
||||
vec3(mod(UV.x * float(chunk_size), 1.0), mod(UV.y * float(chunk_size), 1.0), float(tile_id)) // map
|
||||
);
|
||||
}
|
||||
}
|
1
logic/world/chunk/chunk.gdshader.uid
Normal file
1
logic/world/chunk/chunk.gdshader.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://bex8pyibcsyfa
|
|
@ -1,6 +0,0 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://b5shor4eu6vsy"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bgcupjxa6vqhj" path="res://logic/world/chunk/chunk.gd" id="1_kkcqc"]
|
||||
|
||||
[node name="Chunk" type="Node2D"]
|
||||
script = ExtResource("1_kkcqc")
|
67
logic/world/chunk/chunk_drawing.gd
Normal file
67
logic/world/chunk/chunk_drawing.gd
Normal file
|
@ -0,0 +1,67 @@
|
|||
extends Node2D
|
||||
|
||||
@export var world : World
|
||||
@export var camera : WorldCamera
|
||||
|
||||
@export var chunk_shader : Shader
|
||||
|
||||
var chunk_textures : Dictionary[Chunk, Sprite2D]
|
||||
|
||||
func _draw():
|
||||
var camera_chunk = world.tile_pos_to_chunk_pos(Vector2i(camera.position / TileGlobals.tile_size / 2))
|
||||
|
||||
var camera_size : Vector2 = camera.get_camera_rect().size / TileGlobals.chunk_size / TileGlobals.tile_size / 2
|
||||
var adjusted_size : Vector2i = Vector2i(ceil(camera_size.x) + 2, ceil(camera_size.y) + 2)
|
||||
var generation_radius = maxi(adjusted_size.x, adjusted_size.y)
|
||||
|
||||
for y in range(camera_chunk.y - generation_radius, camera_chunk.y + generation_radius):
|
||||
for x in range(camera_chunk.x - generation_radius, camera_chunk.x + generation_radius):
|
||||
draw_chunk(world.get_chunk_at(camera_chunk + Vector2i(x,y)))
|
||||
|
||||
func draw_chunk(chunk : Chunk) -> void:
|
||||
var x : int = 0
|
||||
var y : int = 0
|
||||
var offset : Vector2 = chunk.position * TileGlobals.chunk_size * TileGlobals.tile_size
|
||||
|
||||
if not chunk_textures.has(chunk):
|
||||
var new_sprite2d : Sprite2D = Sprite2D.new()
|
||||
new_sprite2d.texture = preload("res://resources/items/textures/blank_tile.png")
|
||||
new_sprite2d.position = offset
|
||||
new_sprite2d.scale = Vector2(
|
||||
TileGlobals.chunk_size,
|
||||
TileGlobals.chunk_size
|
||||
)
|
||||
|
||||
var new_shader_material : ShaderMaterial = ShaderMaterial.new()
|
||||
new_shader_material.shader = chunk_shader
|
||||
|
||||
new_sprite2d.material = new_shader_material
|
||||
|
||||
new_sprite2d.material.set_shader_parameter("tile_size", TileGlobals.tile_size)
|
||||
new_sprite2d.material.set_shader_parameter("tile_count", len(TileGlobals.tile_definitions))
|
||||
new_sprite2d.material.set_shader_parameter("tile_texture", TileGlobals.tile_atlas)
|
||||
|
||||
var item_array : Array[int]
|
||||
|
||||
for iy in range(TileGlobals.chunk_size):
|
||||
for ix in range(TileGlobals.chunk_size):
|
||||
item_array.append(0)
|
||||
|
||||
for item_pos in chunk.items.keys():
|
||||
item_array[item_pos.y*TileGlobals.chunk_size+item_pos.x] = chunk.items[item_pos].id
|
||||
|
||||
new_sprite2d.material.set_shader_parameter("item_texture", ItemGlobals.item_atlas)
|
||||
|
||||
new_sprite2d.material.set_shader_parameter("tiles", chunk.tiles)
|
||||
new_sprite2d.material.set_shader_parameter("items", item_array)
|
||||
|
||||
new_sprite2d.texture_repeat = CanvasItem.TEXTURE_REPEAT_ENABLED
|
||||
|
||||
chunk_textures[chunk] = new_sprite2d
|
||||
add_child(new_sprite2d)
|
||||
|
||||
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
queue_redraw()
|
1
logic/world/chunk/chunk_drawing.gd.uid
Normal file
1
logic/world/chunk/chunk_drawing.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://dym8afqdasvrh
|
8
logic/world/chunk/chunk_drawing.tscn
Normal file
8
logic/world/chunk/chunk_drawing.tscn
Normal file
|
@ -0,0 +1,8 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://cgrgaehjqja4d"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dym8afqdasvrh" path="res://logic/world/chunk/chunk_drawing.gd" id="1_40leb"]
|
||||
[ext_resource type="Shader" uid="uid://bex8pyibcsyfa" path="res://logic/world/chunk/chunk.gdshader" id="2_r2tw6"]
|
||||
|
||||
[node name="Chunk Drawing" type="Node2D"]
|
||||
script = ExtResource("1_40leb")
|
||||
chunk_shader = ExtResource("2_r2tw6")
|
|
@ -1,5 +0,0 @@
|
|||
extends Node
|
||||
|
||||
class_name Tile
|
||||
|
||||
var id : int = 0
|
|
@ -1 +0,0 @@
|
|||
uid://v68woe1hw3gc
|
|
@ -3,5 +3,4 @@ extends Resource
|
|||
class_name TileDefinition
|
||||
|
||||
@export var name : String
|
||||
@export var texture : Texture2D
|
||||
@export var barrier : bool = false
|
||||
|
|
|
@ -1,9 +1,18 @@
|
|||
extends Node
|
||||
|
||||
var tile_definitions : Array[TileDefinition]
|
||||
const chunk_size : int = 16
|
||||
var tile_atlas : CompressedTexture2DArray
|
||||
|
||||
var chunk_gradient : Gradient
|
||||
|
||||
const chunk_size : int = 32
|
||||
const tile_size : int = 16
|
||||
|
||||
func _init():
|
||||
|
||||
var tile_definition_array : TileDefinitionArray = preload("res://resources/tiles/base_tiles.tres")
|
||||
tile_definitions = tile_definition_array.tile_definitions
|
||||
|
||||
tile_atlas = preload("res://resources/tiles/textures/tile_atlas.png")
|
||||
|
||||
chunk_gradient = preload("res://resources/tiles/tile_gradient.tres")
|
||||
|
|
20
logic/world/world.gd
Normal file
20
logic/world/world.gd
Normal file
|
@ -0,0 +1,20 @@
|
|||
extends Node
|
||||
|
||||
class_name World
|
||||
|
||||
var chunks : Dictionary[Vector2i, Chunk]
|
||||
|
||||
func get_chunk_at(position : Vector2i) -> Chunk:
|
||||
if chunks.has(position): return chunks[position]
|
||||
|
||||
var new_chunk : Chunk = Chunk.new(position)
|
||||
|
||||
chunks[position] = new_chunk
|
||||
|
||||
return new_chunk
|
||||
|
||||
func tile_pos_to_chunk_pos(position : Vector2i):
|
||||
return position / TileGlobals.chunk_size
|
||||
|
||||
func _ready() -> void:
|
||||
pass
|
1
logic/world/world.gd.uid
Normal file
1
logic/world/world.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://b2octwbo0y3gg
|
6
logic/world/world.tscn
Normal file
6
logic/world/world.tscn
Normal file
|
@ -0,0 +1,6 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://b17vn1ecnbc36"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b2octwbo0y3gg" path="res://logic/world/world.gd" id="1_3neqc"]
|
||||
|
||||
[node name="World" type="Node"]
|
||||
script = ExtResource("1_3neqc")
|
|
@ -11,6 +11,7 @@ config_version=5
|
|||
[application]
|
||||
|
||||
config/name="FactoryExpansion"
|
||||
run/main_scene="uid://cjs660cs0u4rk"
|
||||
config/features=PackedStringArray("4.4", "GL Compatibility")
|
||||
config/icon="res://icon.svg"
|
||||
|
||||
|
@ -18,9 +19,10 @@ config/icon="res://icon.svg"
|
|||
|
||||
Globals="*res://globals.gd"
|
||||
TileGlobals="*res://logic/world/chunk/tile/tile_globals.gd"
|
||||
ItemGlobals="*res://logic/mechanics/item/item_globals.gd"
|
||||
|
||||
[rendering]
|
||||
|
||||
textures/canvas_textures/default_texture_filter=0
|
||||
textures/canvas_textures/default_texture_filter=3
|
||||
renderer/rendering_method="gl_compatibility"
|
||||
renderer/rendering_method.mobile="gl_compatibility"
|
||||
|
|
21
resources/items/base_items.tres
Normal file
21
resources/items/base_items.tres
Normal file
|
@ -0,0 +1,21 @@
|
|||
[gd_resource type="Resource" script_class="ItemDefinitionArray" load_steps=5 format=3 uid="uid://c6h53vbacghee"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://shau2ou14l0t" path="res://logic/mechanics/item/item_definition.gd" id="1_ip82l"]
|
||||
[ext_resource type="Script" uid="uid://csr0k4rp8ifm5" path="res://logic/mechanics/item/item_definition_array.gd" id="1_nowd5"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_wfoic"]
|
||||
script = ExtResource("1_ip82l")
|
||||
name = "Wood"
|
||||
base = true
|
||||
metadata/_custom_type_script = "uid://shau2ou14l0t"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_a0wvc"]
|
||||
script = ExtResource("1_ip82l")
|
||||
name = "Iron"
|
||||
base = true
|
||||
metadata/_custom_type_script = "uid://shau2ou14l0t"
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_nowd5")
|
||||
item_definitions = Array[ExtResource("1_ip82l")]([SubResource("Resource_wfoic"), SubResource("Resource_a0wvc")])
|
||||
metadata/_custom_type_script = "uid://csr0k4rp8ifm5"
|
BIN
resources/items/textures/blank_tile.png
Normal file
BIN
resources/items/textures/blank_tile.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 99 B |
|
@ -2,16 +2,16 @@
|
|||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dhj4m7xfgfr8r"
|
||||
path="res://.godot/imported/water.png-0df44c59650310c522d02ac1e8165335.ctex"
|
||||
uid="uid://bwfn65l5xb6hh"
|
||||
path="res://.godot/imported/blank_tile.png-fabd4206ee3de9b98233abcb4fd23e7e.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://resources/tiles/textures/water.png"
|
||||
dest_files=["res://.godot/imported/water.png-0df44c59650310c522d02ac1e8165335.ctex"]
|
||||
source_file="res://resources/items/textures/blank_tile.png"
|
||||
dest_files=["res://.godot/imported/blank_tile.png-fabd4206ee3de9b98233abcb4fd23e7e.ctex"]
|
||||
|
||||
[params]
|
||||
|
BIN
resources/items/textures/item_atlas.png
Normal file
BIN
resources/items/textures/item_atlas.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 468 B |
26
resources/items/textures/item_atlas.png.import
Normal file
26
resources/items/textures/item_atlas.png.import
Normal file
|
@ -0,0 +1,26 @@
|
|||
[remap]
|
||||
|
||||
importer="2d_array_texture"
|
||||
type="CompressedTexture2DArray"
|
||||
uid="uid://5qwer5ady5j"
|
||||
path="res://.godot/imported/item_atlas.png-198829602f165105f6127f163ee5406e.ctexarray"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://resources/items/textures/item_atlas.png"
|
||||
dest_files=["res://.godot/imported/item_atlas.png-198829602f165105f6127f163ee5406e.ctexarray"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
slices/horizontal=3
|
||||
slices/vertical=1
|
BIN
resources/misc/arrows.png
Normal file
BIN
resources/misc/arrows.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 417 B |
|
@ -2,16 +2,16 @@
|
|||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://31njex15xgpr"
|
||||
path="res://.godot/imported/grass.png-b9f264aaa8345ec83a51549170f38e82.ctex"
|
||||
uid="uid://d1nsg6nkifsuy"
|
||||
path="res://.godot/imported/arrows.png-f4154ffb8ad82a4cead337521dc1b0a8.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://resources/tiles/textures/grass.png"
|
||||
dest_files=["res://.godot/imported/grass.png-b9f264aaa8345ec83a51549170f38e82.ctex"]
|
||||
source_file="res://resources/misc/arrows.png"
|
||||
dest_files=["res://.godot/imported/arrows.png-f4154ffb8ad82a4cead337521dc1b0a8.ctex"]
|
||||
|
||||
[params]
|
||||
|
|
@ -1,25 +1,27 @@
|
|||
[gd_resource type="Resource" script_class="TileDefinitionArray" load_steps=7 format=3 uid="uid://7a03sai1i6fd"]
|
||||
[gd_resource type="Resource" script_class="TileDefinitionArray" load_steps=6 format=3 uid="uid://7a03sai1i6fd"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://18w861lh0xyt" path="res://logic/world/chunk/tile/tile_definition_array.gd" id="1_58vwe"]
|
||||
[ext_resource type="Script" uid="uid://cp4p3pk48mwqx" path="res://logic/world/chunk/tile/tile_definition.gd" id="2_12vs5"]
|
||||
[ext_resource type="Texture2D" uid="uid://31njex15xgpr" path="res://resources/tiles/textures/grass.png" id="3_12vs5"]
|
||||
[ext_resource type="Texture2D" uid="uid://dhj4m7xfgfr8r" path="res://resources/tiles/textures/water.png" id="4_edm72"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_c6abn"]
|
||||
script = ExtResource("2_12vs5")
|
||||
name = "Water"
|
||||
texture = ExtResource("4_edm72")
|
||||
barrier = false
|
||||
barrier = true
|
||||
metadata/_custom_type_script = "uid://cp4p3pk48mwqx"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_edm72"]
|
||||
script = ExtResource("2_12vs5")
|
||||
name = "Grass"
|
||||
texture = ExtResource("3_12vs5")
|
||||
barrier = false
|
||||
metadata/_custom_type_script = "uid://cp4p3pk48mwqx"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_58vwe"]
|
||||
script = ExtResource("2_12vs5")
|
||||
name = "Stone"
|
||||
barrier = true
|
||||
metadata/_custom_type_script = "uid://cp4p3pk48mwqx"
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_58vwe")
|
||||
tile_definitions = Array[ExtResource("2_12vs5")]([SubResource("Resource_c6abn"), SubResource("Resource_edm72")])
|
||||
tile_definitions = Array[ExtResource("2_12vs5")]([SubResource("Resource_c6abn"), SubResource("Resource_edm72"), SubResource("Resource_58vwe")])
|
||||
metadata/_custom_type_script = "uid://18w861lh0xyt"
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 210 B |
BIN
resources/tiles/textures/tile_atlas.png
Normal file
BIN
resources/tiles/textures/tile_atlas.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 426 B |
26
resources/tiles/textures/tile_atlas.png.import
Normal file
26
resources/tiles/textures/tile_atlas.png.import
Normal file
|
@ -0,0 +1,26 @@
|
|||
[remap]
|
||||
|
||||
importer="2d_array_texture"
|
||||
type="CompressedTexture2DArray"
|
||||
uid="uid://c26cvgrip1chy"
|
||||
path="res://.godot/imported/tile_atlas.png-84b81a774fcf788b1f5c08b2a31c385e.ctexarray"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://resources/tiles/textures/tile_atlas.png"
|
||||
dest_files=["res://.godot/imported/tile_atlas.png-84b81a774fcf788b1f5c08b2a31c385e.ctexarray"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
slices/horizontal=3
|
||||
slices/vertical=1
|
Binary file not shown.
Before Width: | Height: | Size: 196 B |
6
resources/tiles/tile_gradient.tres
Normal file
6
resources/tiles/tile_gradient.tres
Normal file
|
@ -0,0 +1,6 @@
|
|||
[gd_resource type="Gradient" format=3 uid="uid://bau0hpycbtfle"]
|
||||
|
||||
[resource]
|
||||
interpolation_mode = 1
|
||||
offsets = PackedFloat32Array(0, 0.44, 0.68)
|
||||
colors = PackedColorArray(0, 0, 0, 1, 0.00392157, 0.00392157, 0.0117647, 1, 0.00784314, 0.00784314, 0.0196078, 1)
|
Loading…
Reference in a new issue