tilemap + click to create house

main
Valentin Stark 2 months ago
parent e09b7a5852
commit 6ae62ebf26
  1. 4
      .editorconfig
  2. 2
      .gitattributes
  3. 3
      .gitignore
  4. BIN
      Buildings/buildings.png
  5. 40
      Buildings/buildings.png.import
  6. BIN
      Tiles/BridgeRocks.png
  7. 40
      Tiles/BridgeRocks.png.import
  8. BIN
      Tiles/tiles.png
  9. 40
      Tiles/tiles.png.import
  10. 2
      icon.svg.import
  11. 16
      node_2d.gd
  12. 1
      node_2d.gd.uid
  13. 21
      node_2d.tscn
  14. 3620
      tileset.tres

@ -0,0 +1,4 @@
root = true
[*]
charset = utf-8

2
.gitattributes vendored

@ -0,0 +1,2 @@
# Normalize EOL for all files that Git considers text files.
* text=auto eol=lf

3
.gitignore vendored

@ -0,0 +1,3 @@
# Godot 4+ specific ignores
.godot/
/android/

Binary file not shown.

After

Width:  |  Height:  |  Size: 372 KiB

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://daqppjqybd4w3"
path="res://.godot/imported/buildings.png-cabbc1d45a2e17e8195bd05242ddee34.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Buildings/buildings.png"
dest_files=["res://.godot/imported/buildings.png-cabbc1d45a2e17e8195bd05242ddee34.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://djt7xasxbysog"
path="res://.godot/imported/BridgeRocks.png-d520f3d7e675908da2befa421c1920bd.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Tiles/BridgeRocks.png"
dest_files=["res://.godot/imported/BridgeRocks.png-d520f3d7e675908da2befa421c1920bd.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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

Binary file not shown.

After

Width:  |  Height:  |  Size: 403 KiB

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b87s8wwo1vw7u"
path="res://.godot/imported/tiles.png-cc9ccae17b9e255b48c7a4528cd6a6f5.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Tiles/tiles.png"
dest_files=["res://.godot/imported/tiles.png-cc9ccae17b9e255b48c7a4528cd6a6f5.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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

@ -2,7 +2,7 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://b88wfht0s0bgu"
uid="uid://btbus1u61pdf4"
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"
metadata={
"vram_texture": false

@ -0,0 +1,16 @@
extends Node2D
@onready var highlight: Sprite2D = $highlight
@onready var ground: TileMapLayer = $Ground
@onready var objects: TileMapLayer = $Objects
var selected = Vector2i(0, 0)
func _input(event: InputEvent) -> void:
if event is InputEventMouseMotion:
selected = ground.local_to_map(event.position)
highlight.position = ground.map_to_local(selected)
if event is InputEventMouseButton:
if event.button_index == MOUSE_BUTTON_LEFT:
objects.set_cell(selected, 37, Vector2i(0, 0))

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save