-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit inicial, al tilemap se le pueden añadir y quitar sprites
- Loading branch information
1 parent
4d42038
commit 04918da
Showing
12 changed files
with
246 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[gd_resource type="Environment" load_steps=2 format=2] | ||
|
||
[sub_resource type="ProceduralSky" id=1] | ||
|
||
[resource] | ||
background_mode = 2 | ||
background_sky = SubResource( 1 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[remap] | ||
|
||
importer="texture" | ||
type="StreamTexture" | ||
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" | ||
metadata={ | ||
"vram_texture": false | ||
} | ||
|
||
[deps] | ||
|
||
source_file="res://icon.png" | ||
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] | ||
|
||
[params] | ||
|
||
compress/mode=0 | ||
compress/lossy_quality=0.7 | ||
compress/hdr_mode=0 | ||
compress/bptc_ldr=0 | ||
compress/normal_map=0 | ||
flags/repeat=0 | ||
flags/filter=true | ||
flags/mipmaps=false | ||
flags/anisotropic=false | ||
flags/srgb=2 | ||
process/fix_alpha_border=true | ||
process/premult_alpha=false | ||
process/HDR_as_SRGB=false | ||
process/invert_color=false | ||
stream=false | ||
size_limit=0 | ||
detect_3d=true | ||
svg/scale=1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[gd_scene load_steps=3 format=2] | ||
|
||
[ext_resource path="res://scripts/editorScript.gd" type="Script" id=1] | ||
[ext_resource path="res://tileSet/tileset.tres" type="TileSet" id=2] | ||
|
||
[node name="Node2D" type="Node2D"] | ||
script = ExtResource( 1 ) | ||
|
||
[node name="TileMap" type="TileMap" parent="."] | ||
tile_set = ExtResource( 2 ) | ||
format = 1 | ||
tile_data = PoolIntArray( 65539, 0, 0, 131078, 1, 0, 196612, 0, 0 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
; 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=4 | ||
|
||
_global_script_classes=[ ] | ||
_global_script_class_icons={ | ||
|
||
} | ||
|
||
[application] | ||
|
||
config/name="EditorDeMapas" | ||
run/main_scene="res://mapaProvicional.tscn" | ||
config/icon="res://icon.png" | ||
|
||
[rendering] | ||
|
||
environment/default_environment="res://default_env.tres" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
extends Node2D | ||
|
||
#primero funcion los botones izquierdo y derecho | ||
#la escena debe tener mas controles, cambiando los tiles a colocar | ||
#codigo de prototipo finalizado 21/sep/19 | ||
# :3 | ||
#de anubarak para quien lo necesite | ||
#licencia MIT :D | ||
|
||
var tileMap | ||
func _ready(): | ||
tileMap = $TileMap | ||
#se toma el nodo hijo para mayor comodidad | ||
|
||
func _input(event): | ||
if(event is InputEventMouseButton): | ||
#toma las presiones del mouse | ||
if(event.button_index == BUTTON_LEFT and event.pressed): | ||
#en caso de presionar el boton izquierdo | ||
var tilePos = tileMap.world_to_map(event.position) | ||
#toma un vector(x,y) y lo traduce en coordenadas de malla | ||
tileMap.set_cellv(tilePos, 0) | ||
#cambia la celda de la posicion por el sprite 0 | ||
|
||
if(event.button_index == BUTTON_RIGHT and event.pressed): | ||
#igual pero con el boton contrario | ||
var tilePos = tileMap.world_to_map(event.position) | ||
#exactamente lo mismo, pero la posicion cambiará | ||
tileMap.set_cellv(tilePos, -1) | ||
#un -1 va a eliminar el sprite en ese sitio de la malla | ||
|
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[remap] | ||
|
||
importer="texture" | ||
type="StreamTexture" | ||
path="res://.import/hierba.png-5818438993c6964ef9066feef6a28700.stex" | ||
metadata={ | ||
"vram_texture": false | ||
} | ||
|
||
[deps] | ||
|
||
source_file="res://sprites/hierba.png" | ||
dest_files=[ "res://.import/hierba.png-5818438993c6964ef9066feef6a28700.stex" ] | ||
|
||
[params] | ||
|
||
compress/mode=0 | ||
compress/lossy_quality=0.7 | ||
compress/hdr_mode=0 | ||
compress/bptc_ldr=0 | ||
compress/normal_map=0 | ||
flags/repeat=0 | ||
flags/filter=true | ||
flags/mipmaps=false | ||
flags/anisotropic=false | ||
flags/srgb=2 | ||
process/fix_alpha_border=true | ||
process/premult_alpha=false | ||
process/HDR_as_SRGB=false | ||
process/invert_color=false | ||
stream=false | ||
size_limit=0 | ||
detect_3d=true | ||
svg/scale=1.0 |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[remap] | ||
|
||
importer="texture" | ||
type="StreamTexture" | ||
path="res://.import/tierra.png-b6af56920143da16a10e0b18c4251412.stex" | ||
metadata={ | ||
"vram_texture": false | ||
} | ||
|
||
[deps] | ||
|
||
source_file="res://sprites/tierra.png" | ||
dest_files=[ "res://.import/tierra.png-b6af56920143da16a10e0b18c4251412.stex" ] | ||
|
||
[params] | ||
|
||
compress/mode=0 | ||
compress/lossy_quality=0.7 | ||
compress/hdr_mode=0 | ||
compress/bptc_ldr=0 | ||
compress/normal_map=0 | ||
flags/repeat=0 | ||
flags/filter=true | ||
flags/mipmaps=false | ||
flags/anisotropic=false | ||
flags/srgb=2 | ||
process/fix_alpha_border=true | ||
process/premult_alpha=false | ||
process/HDR_as_SRGB=false | ||
process/invert_color=false | ||
stream=false | ||
size_limit=0 | ||
detect_3d=true | ||
svg/scale=1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[gd_scene load_steps=4 format=2] | ||
|
||
[ext_resource path="res://sprites/hierba.png" type="Texture" id=1] | ||
[ext_resource path="res://sprites/tierra.png" type="Texture" id=2] | ||
|
||
[sub_resource type="RectangleShape2D" id=1] | ||
extents = Vector2( 31.9665, 31.9681 ) | ||
|
||
[node name="Node2D" type="Node2D"] | ||
|
||
[node name="hierba" type="Sprite" parent="."] | ||
position = Vector2( 40, 40 ) | ||
texture = ExtResource( 1 ) | ||
|
||
[node name="StaticBody2D" type="StaticBody2D" parent="hierba"] | ||
|
||
[node name="CollisionShape2D" type="CollisionShape2D" parent="hierba/StaticBody2D"] | ||
shape = SubResource( 1 ) | ||
|
||
[node name="tierra" type="Sprite" parent="."] | ||
position = Vector2( 110, 40 ) | ||
texture = ExtResource( 2 ) | ||
|
||
[node name="StaticBody2D2" type="StaticBody2D" parent="tierra"] | ||
|
||
[node name="CollisionShape2D" type="CollisionShape2D" parent="tierra/StaticBody2D2"] | ||
shape = SubResource( 1 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
[gd_resource type="TileSet" load_steps=4 format=2] | ||
|
||
[ext_resource path="res://sprites/hierba.png" type="Texture" id=1] | ||
[ext_resource path="res://sprites/tierra.png" type="Texture" id=2] | ||
|
||
|
||
|
||
[sub_resource type="RectangleShape2D" id=1] | ||
extents = Vector2( 31.9665, 31.9681 ) | ||
|
||
[resource] | ||
0/name = "hierba" | ||
0/texture = ExtResource( 1 ) | ||
0/tex_offset = Vector2( 0, 0 ) | ||
0/modulate = Color( 1, 1, 1, 1 ) | ||
0/region = Rect2( 0, 0, 64, 64 ) | ||
0/tile_mode = 0 | ||
0/occluder_offset = Vector2( 32, 32 ) | ||
0/navigation_offset = Vector2( 32, 32 ) | ||
0/shapes = [ { | ||
"autotile_coord": Vector2( 0, 0 ), | ||
"one_way": false, | ||
"one_way_margin": 1.0, | ||
"shape": SubResource( 1 ), | ||
"shape_transform": Transform2D( 1, 0, 0, 1, 32, 32 ) | ||
} ] | ||
0/z_index = 0 | ||
1/name = "tierra" | ||
1/texture = ExtResource( 2 ) | ||
1/tex_offset = Vector2( 0, 0 ) | ||
1/modulate = Color( 1, 1, 1, 1 ) | ||
1/region = Rect2( 0, 0, 64, 64 ) | ||
1/tile_mode = 0 | ||
1/occluder_offset = Vector2( 32, 32 ) | ||
1/navigation_offset = Vector2( 32, 32 ) | ||
1/shapes = [ { | ||
"autotile_coord": Vector2( 0, 0 ), | ||
"one_way": false, | ||
"one_way_margin": 1.0, | ||
"shape": SubResource( 1 ), | ||
"shape_transform": Transform2D( 1, 0, 0, 1, 32, 32 ) | ||
} ] | ||
1/z_index = 0 |