End of lesson 14, World map, terrain data.

This commit is contained in:
Penelope 2025-04-05 15:42:17 -03:00
parent e882e0e5fd
commit fc038ba113
13 changed files with 2094 additions and 22 deletions

BIN
gfx/game/tiles/PokemonLike.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://n75ma6vtgg1n"
path="res://.godot/imported/PokemonLike.png-56742e48da9fabb842b8d7c89aee0d95.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://gfx/game/tiles/PokemonLike.png"
dest_files=["res://.godot/imported/PokemonLike.png-56742e48da9fabb842b8d7c89aee0d95.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

BIN
gfx/game/tiles/colored_packed.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bontlwwdkdkd2"
path="res://.godot/imported/colored_packed.png-3acba825e877d53703c17fa54230f8c8.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://gfx/game/tiles/colored_packed.png"
dest_files=["res://.godot/imported/colored_packed.png-3acba825e877d53703c17fa54230f8c8.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

View File

@ -19,6 +19,7 @@ config/icon="res://icon.svg"
[autoload]
Loader="*res://scripts/loader.gd"
GameManager="*res://scripts/GameManager.gd"
[display]

View File

@ -1,25 +1,9 @@
[gd_scene format=3 uid="uid://c0b5w48jk67qd"]
[gd_scene load_steps=2 format=3 uid="uid://c0b5w48jk67qd"]
[node name="Game" type="Node2D"]
[ext_resource type="Script" uid="uid://dq5qq5xj76nwe" path="res://scripts/game/game_screen.gd" id="1_uwrxv"]
[node name="Control" type="Control" parent="."]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_right = 640.0
offset_bottom = 360.0
grow_horizontal = 2
grow_vertical = 2
[node name="Game" type="Node" node_paths=PackedStringArray("map")]
script = ExtResource("1_uwrxv")
map = NodePath("Map")
[node name="CenterContainer" type="CenterContainer" parent="Control"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="Label" type="Label" parent="Control/CenterContainer"]
layout_mode = 2
text = "Game!"
[node name="Map" type="Node" parent="."]

File diff suppressed because one or more lines are too long

17
scripts/GameManager.gd Normal file
View File

@ -0,0 +1,17 @@
extends Node
var defaultMapPath: String = "res://scenes/game/maps/world_map.tscn"
var currentMapPath: String = ""
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func startNewGame():
currentMapPath = defaultMapPath

View File

@ -0,0 +1 @@
uid://0mhwqcwput71

View File

@ -0,0 +1,14 @@
extends Node
class_name GameScreen
@export var map: Node
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
map.add_child(load(GameManager.currentMapPath).instantiate())
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass

View File

@ -0,0 +1 @@
uid://dq5qq5xj76nwe

View File

@ -12,4 +12,6 @@ func _process(delta: float) -> void:
func _on_new_game_button_pressed() -> void:
GameManager.startNewGame()
Loader.loadScene(self, "res://scenes/game.tscn")

1970
tilesets/default.tres Normal file

File diff suppressed because it is too large Load Diff