Skip to content

Commit 85fb597

Browse files
committed
smoe rewrite, editor works smoother now and is easier to code
1 parent 7a15a6d commit 85fb597

202 files changed

Lines changed: 10189 additions & 16557 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Editor.gd

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
2+
extends Node2D
3+
4+
5+
# Declare member variables here. Examples:
6+
# var a: int = 2
7+
# var b: String = "text"
8+
9+
signal stage_preloaded
10+
11+
func preload_stage(path):
12+
load_stage(path)
13+
emit_signal("stage_preloaded")
14+
# Declare member variables here. Examples:
15+
# var a: int = 2
16+
# var b: String = "text"
17+
func load_stage(path):
18+
pass
19+
# Called when the node enters the scene tree for the first time.
20+
func _ready() -> void:
21+
$TileMap.paint_tile(Vector2(100, 100), 4)
22+
func clear_all():
23+
$TileMap.clear()
24+
25+
# Called every frame. 'delta' is the elapsed time since the previous frame.
26+
func _process(delta: float) -> void:
27+
$TileMap.paint_tile(get_global_mouse_position(), 8)
28+
29+
func save_level():
30+
var p_scn = PackedScene.new()
31+
p_scn.get_local_scene()
32+
ResourceSaver.save(MainSingleton.level_path + "/" + MainSingleton.level_name + ".tscn", p_scn)

Editor.tscn

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[gd_scene load_steps=5 format=2]
2+
3+
[ext_resource path="res://EditorLevelScene.tscn" type="PackedScene" id=1]
4+
[ext_resource path="res://EditorMain.gd" type="Script" id=4]
5+
[ext_resource path="res://ui/TileSelector.tscn" type="PackedScene" id=5]
6+
[ext_resource path="res://ui/navbar.tscn" type="PackedScene" id=6]
7+
8+
[node name="root" type="Node2D"]
9+
script = ExtResource( 4 )
10+
11+
[node name="Node2D" parent="." instance=ExtResource( 1 )]
12+
13+
[node name="CanvasLayer" type="CanvasLayer" parent="."]
14+
15+
[node name="TileSelector" parent="CanvasLayer" instance=ExtResource( 5 )]
16+
17+
[node name="navbar" parent="CanvasLayer" instance=ExtResource( 6 )]

EditorLevelScene.tscn

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[gd_scene load_steps=4 format=2]
2+
3+
[ext_resource path="res://Tiles/new_tileset.tres" type="TileSet" id=1]
4+
[ext_resource path="res://Editor.gd" type="Script" id=2]
5+
[ext_resource path="res://TilePainter.gd" type="Script" id=3]
6+
7+
[node name="Node2D" type="Node2D"]
8+
script = ExtResource( 2 )
9+
10+
[node name="TileMap" type="TileMap" parent="."]
11+
tile_set = ExtResource( 1 )
12+
cell_size = Vector2( 16, 16 )
13+
compatibility_mode = true
14+
format = 1
15+
script = ExtResource( 3 )

EditorMain.gd

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
extends Node2D
2+
3+
4+
# Called when the node enters the scene tree for the first time.
5+
func _ready() -> void:
6+
$CanvasLayer/TileSelector.connect("new_tile_selected", self, "on_new_tile_selected")
7+
8+
func on_new_tile_selected(tile_name):
9+
MainSingleton.current_tile_name = tile_name

GlobalsEditor.gd

Lines changed: 0 additions & 2 deletions
This file was deleted.

Graphics/Sprites/ntf_sprite.png

73.3 KB
Loading
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="StreamTexture"
5+
path="res://.import/ntf_sprite.png-aee431c22b932bf236ae6a41f96cff5a.stex"
6+
metadata={
7+
"vram_texture": false
8+
}
9+
10+
[deps]
11+
12+
source_file="res://Graphics/Sprites/ntf_sprite.png"
13+
dest_files=[ "res://.import/ntf_sprite.png-aee431c22b932bf236ae6a41f96cff5a.stex" ]
14+
15+
[params]
16+
17+
compress/mode=0
18+
compress/lossy_quality=0.7
19+
compress/hdr_mode=0
20+
compress/bptc_ldr=0
21+
compress/normal_map=0
22+
flags/repeat=0
23+
flags/filter=false
24+
flags/mipmaps=false
25+
flags/anisotropic=false
26+
flags/srgb=2
27+
process/fix_alpha_border=true
28+
process/premult_alpha=false
29+
process/HDR_as_SRGB=false
30+
process/invert_color=false
31+
stream=false
32+
size_limit=0
33+
detect_3d=true
34+
svg/scale=1.0

Graphics/Sprites/ntf_sprite.xcf

624 KB
Binary file not shown.

Graphics/Sprites/tails_sprite.png

75.3 KB
Loading
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="StreamTexture"
5+
path="res://.import/tails_sprite.png-adf076992f20a20e98fff86969d05660.stex"
6+
metadata={
7+
"vram_texture": false
8+
}
9+
10+
[deps]
11+
12+
source_file="res://Graphics/Sprites/tails_sprite.png"
13+
dest_files=[ "res://.import/tails_sprite.png-adf076992f20a20e98fff86969d05660.stex" ]
14+
15+
[params]
16+
17+
compress/mode=0
18+
compress/lossy_quality=0.7
19+
compress/hdr_mode=0
20+
compress/bptc_ldr=0
21+
compress/normal_map=0
22+
flags/repeat=0
23+
flags/filter=false
24+
flags/mipmaps=false
25+
flags/anisotropic=false
26+
flags/srgb=2
27+
process/fix_alpha_border=true
28+
process/premult_alpha=false
29+
process/HDR_as_SRGB=false
30+
process/invert_color=false
31+
stream=false
32+
size_limit=0
33+
detect_3d=true
34+
svg/scale=1.0

0 commit comments

Comments
 (0)