Skip to content

Commit b0b63e8

Browse files
committed
Update isometric demo
1 parent 7421736 commit b0b63e8

File tree

6 files changed

+52
-54
lines changed

6 files changed

+52
-54
lines changed

2d/isometric/dungeon.tscn

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
[ext_resource path="res://tileset.tres" type="TileSet" id=1]
44
[ext_resource path="res://troll.tscn" type="PackedScene" id=2]
55

6-
[node name="dungeon" type="Node2D"]
6+
[node name="Dungeon" type="Node2D"]
77

8-
[node name="floor" type="TileMap" parent="."]
8+
[node name="Floor" type="TileMap" parent="."]
99
mode = 1
1010
tile_set = ExtResource( 1 )
1111
cell_size = Vector2( 128, 64 )
1212
cell_tile_origin = 1
1313
format = 1
1414
tile_data = PoolIntArray( -851956, 0, -1200553578, -851955, 0, -1200553578, -851954, 0, -1200553578, -786420, 1, -1200553578, -786419, 0, -1200553578, -786418, 0, -1200553578, -720884, 0, -1200553578, -720883, 0, -1200553578, -720882, 0, -1200553578, -655348, 1, -1200553578, -655347, 0, -1200553578, -655346, 0, -1200553578, -589812, 1, -1200553578, -589811, 0, -1200553578, -589810, 0, -1200553578, -524276, 0, -1200553578, -524275, 1, -1200553578, -524274, 0, -1200553578, -458740, 0, -1200553578, -458739, 0, -1200553578, -458738, 0, -1200553578, -393210, 0, -1200553578, -393209, 0, -1200553578, -393208, 0, -1200553578, -393207, 0, -1200553578, -393206, 0, -1200553578, -393205, 0, -1200553578, -393204, 0, -1200553578, -393203, 0, -1200553578, -393202, 0, -1200553578, -327674, 0, -1200553578, -327673, 0, -1200553578, -327672, 1, -1200553578, -327671, 1, -1200553578, -327670, 1, -1200553578, -327669, 1, -1200553578, -327668, 1, -1200553578, -327667, 0, -1200553578, -327666, 0, -1200553578, -262138, 0, -1200553578, -262137, 0, -1200553578, -262136, 0, -1200553578, -262135, 0, -1200553578, -262134, 0, -1200553578, -262133, 0, -1200553578, -262132, 0, -1200553578, -262131, 0, -1200553578, -262130, 0, -1200553578, -196602, 0, -1200553578, -196601, 0, -1200553578, -196600, 0, -1200553578, -196599, 0, -1200553578, -196598, 0, -1200553578, -196597, 0, -1200553578, -196596, 0, -1200553578, -196595, 0, -1200553578, -196594, 0, -1200553578, -131066, 0, -1200553578, -131065, 0, -1200553578, -131064, 0, -1200553578, -131063, 0, -1200553578, -65530, 0, -1200553578, -65529, 0, -1200553578, -65528, 0, -1200553578, -65527, 0, -1200553578, 6, 0, -1200553578, 7, 1, -1200553578, 8, 0, -1200553578, 9, 0, -1200553578, 65542, 0, -1200553578, 65543, 0, -1200553578, 65544, 0, -1200553578, 65545, 0, -1200553578, 131078, 0, -1200553578, 131079, 0, -1200553578, 131080, 0, -1200553578, 131081, 0, -1200553578, 196614, 0, -1200553578, 196615, 0, -1200553578, 196616, 0, -1200553578 )
1515

16-
[node name="walls" type="TileMap" parent="."]
16+
[node name="Walls" type="TileMap" parent="."]
1717
mode = 1
1818
tile_set = ExtResource( 1 )
1919
cell_size = Vector2( 128, 64 )
@@ -22,5 +22,5 @@ cell_y_sort = true
2222
format = 1
2323
tile_data = PoolIntArray( -917493, 2, -1200553578, -917492, 2, -1200553578, -917491, 2, -1200553578, -917490, 2, -1200553578, -917489, 2, -1200553578, -851957, 2, -1200553578, -851956, 3, -1200553578, -851954, 3, -1200553578, -851953, 2, -1200553578, -786421, 2, -1200553578, -786420, 3, -1200553578, -786418, 3, -1200553578, -786417, 2, -1200553578, -720885, 2, -1200553578, -720881, 2, -1200553578, -655349, 2, -1200553578, -655348, 2, -1200553578, -655346, 3, -1200553578, -655345, 2, -1200553578, -589813, 2, -1200553578, -589809, 2, -1200553578, -524277, 2, -1200553578, -524273, 2, -1200553578, -458747, 2, -1200553578, -458746, 2, -1200553578, -458745, 2, -1200553578, -458744, 536870916, -1200553578, -458743, 536870916, -1200553578, -458742, 2, -1200553578, -458741, 2, -1200553578, -458740, 2, -1200553578, -458738, 2, -1200553578, -458737, 2, -1200553578, -393211, 2, -1200553578, -393209, 3, -1200553578, -393205, 3, -1200553578, -393201, 2, -1200553578, -327675, 4, -1200553578, -327665, 2, -1200553578, -262139, 4, -1200553578, -262129, 2, -1200553578, -196603, 2, 0, -196601, 3, 0, -196593, 2, -1200553578, -131067, 2, 0, -131062, 2, -1200553578, -131061, 2, -1200553578, -131060, 2, -1200553578, -131059, 2, -1200553578, -131058, 2, -1200553578, -131057, 2, -1200553578, -65531, 2, 0, -65530, 2, 0, -65527, 2, -1200553578, -65526, 2, -1200553578, 5, 2, -1200553578, 10, 2, 0, 65541, 2, -1200553578, 65546, 2, 0, 131077, 2, -1200553578, 131081, 3, 0, 131082, 2, 0, 196613, 2, -1200553578, 196618, 2, 0, 262149, 2, -1200553578, 262150, 2, -1200553578, 262151, 2, -1200553578, 262152, 2, -1200553578, 262153, 2, -1200553578, 262154, 2, -1200553578 )
2424

25-
[node name="troll" parent="walls" instance=ExtResource( 2 )]
25+
[node name="Troll" parent="Walls" instance=ExtResource( 2 )]
2626
position = Vector2( 368.142, 347.007 )

2d/isometric/project.godot

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,36 @@ gen_mipmaps=false
3535

3636
[input]
3737

38-
move_bottom={
38+
move_down={
3939
"deadzone": 0.5,
4040
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"unicode":0,"echo":false,"script":null)
41+
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"unicode":0,"echo":false,"script":null)
42+
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null)
43+
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":1.0,"script":null)
4144
]
4245
}
4346
move_left={
4447
"deadzone": 0.5,
4548
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"unicode":0,"echo":false,"script":null)
49+
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"unicode":0,"echo":false,"script":null)
50+
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null)
51+
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":-1.0,"script":null)
4652
]
4753
}
4854
move_right={
4955
"deadzone": 0.5,
5056
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"unicode":0,"echo":false,"script":null)
57+
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"unicode":0,"echo":false,"script":null)
58+
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":15,"pressure":0.0,"pressed":false,"script":null)
59+
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":1.0,"script":null)
5160
]
5261
}
5362
move_up={
5463
"deadzone": 0.5,
5564
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"unicode":0,"echo":false,"script":null)
65+
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"unicode":0,"echo":false,"script":null)
66+
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null)
67+
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":-1.0,"script":null)
5668
]
5769
}
5870

2d/isometric/tileset.tres

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,80 +3,80 @@
33
[ext_resource path="res://isotiles.png" type="Texture" id=1]
44

55
[sub_resource type="ConvexPolygonShape2D" id=1]
6-
7-
custom_solver_bias = 0.0
86
points = PoolVector2Array( -4, -30, 60, 2, -4, 34, -68, 2 )
97

108
[sub_resource type="ConvexPolygonShape2D" id=2]
11-
12-
custom_solver_bias = 0.0
139
points = PoolVector2Array( -4, -22, 12, -22, 28, -6, 4, 10, -4, 10, -20, -6 )
1410

1511
[sub_resource type="ConvexPolygonShape2D" id=3]
16-
17-
custom_solver_bias = 0.0
1812
points = PoolVector2Array( -21.905, 23.3748, 50.095, -8.62516, 66.095, -0.62516, -5.90501, 31.3748 )
1913

2014
[resource]
21-
22-
0/name = "base"
15+
0/name = "Base"
2316
0/texture = ExtResource( 1 )
2417
0/tex_offset = Vector2( -66, -42 )
2518
0/modulate = Color( 1, 1, 1, 1 )
2619
0/region = Rect2( 28, 92, 132, 84 )
27-
0/is_autotile = false
20+
0/tile_mode = 0
2821
0/occluder_offset = Vector2( 0, 0 )
2922
0/navigation_offset = Vector2( 0, 0 )
3023
0/shapes = [ ]
31-
1/name = "base2"
24+
0/z_index = 0
25+
1/name = "Base2"
3226
1/texture = ExtResource( 1 )
3327
1/tex_offset = Vector2( -66, -42 )
3428
1/modulate = Color( 1, 1, 1, 1 )
3529
1/region = Rect2( 220, 92, 132, 84 )
36-
1/is_autotile = false
30+
1/tile_mode = 0
3731
1/occluder_offset = Vector2( 0, 0 )
3832
1/navigation_offset = Vector2( 0, 0 )
3933
1/shapes = [ ]
40-
2/name = "wall"
34+
1/z_index = 0
35+
2/name = "Wall"
4136
2/texture = ExtResource( 1 )
4237
2/tex_offset = Vector2( -69.3109, -99.8051 )
4338
2/modulate = Color( 1, 1, 1, 1 )
4439
2/region = Rect2( 28, 220, 132, 136 )
45-
2/is_autotile = false
40+
2/tile_mode = 0
4641
2/occluder_offset = Vector2( 0, 0 )
4742
2/navigation_offset = Vector2( 0, 0 )
4843
2/shapes = [ {
4944
"autotile_coord": Vector2( 0, 0 ),
5045
"one_way": false,
46+
"one_way_margin": 1.0,
5147
"shape": SubResource( 1 ),
5248
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
5349
} ]
54-
3/name = "column"
50+
2/z_index = 0
51+
3/name = "Column"
5552
3/texture = ExtResource( 1 )
5653
3/tex_offset = Vector2( -69.5632, -100.446 )
5754
3/modulate = Color( 1, 1, 1, 1 )
5855
3/region = Rect2( 220, 220, 132, 136 )
59-
3/is_autotile = false
56+
3/tile_mode = 0
6057
3/occluder_offset = Vector2( 0, 0 )
6158
3/navigation_offset = Vector2( 0, 0 )
6259
3/shapes = [ {
6360
"autotile_coord": Vector2( 0, 0 ),
6461
"one_way": false,
62+
"one_way_margin": 1.0,
6563
"shape": SubResource( 2 ),
6664
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
6765
} ]
68-
4/name = "door1"
66+
3/z_index = 0
67+
4/name = "Door1"
6968
4/texture = ExtResource( 1 )
7069
4/tex_offset = Vector2( -50.3623, -90.8164 )
7170
4/modulate = Color( 1, 1, 1, 1 )
7271
4/region = Rect2( 24, 408, 132, 136 )
73-
4/is_autotile = false
72+
4/tile_mode = 0
7473
4/occluder_offset = Vector2( 0, 0 )
7574
4/navigation_offset = Vector2( 0, 0 )
7675
4/shapes = [ {
7776
"autotile_coord": Vector2( 0, 0 ),
7877
"one_way": false,
78+
"one_way_margin": 1.0,
7979
"shape": SubResource( 3 ),
8080
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
8181
} ]
82-
82+
4/z_index = 0

2d/isometric/tileset_edit.tscn

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,60 +2,59 @@
22

33
[ext_resource path="res://isotiles.png" type="Texture" id=1]
44

5-
[node name="Node2D" type="Node2D"]
5+
[node name="TilesetEdit" type="Node2D"]
66

7-
[node name="base" type="Sprite" parent="."]
7+
[node name="Base" type="Sprite" parent="."]
88
position = Vector2( 150.049, 61.1264 )
99
texture = ExtResource( 1 )
1010
centered = false
1111
offset = Vector2( -66, -42 )
1212
region_enabled = true
1313
region_rect = Rect2( 28, 92, 132, 84 )
1414

15-
[node name="base2" type="Sprite" parent="."]
15+
[node name="Base2" type="Sprite" parent="."]
1616
position = Vector2( 257.013, 124.86 )
1717
texture = ExtResource( 1 )
1818
centered = false
1919
offset = Vector2( -66, -42 )
2020
region_enabled = true
2121
region_rect = Rect2( 220, 92, 132, 84 )
2222

23-
[node name="wall" type="Sprite" parent="."]
23+
[node name="Wall" type="Sprite" parent="."]
2424
position = Vector2( 421.311, 137.805 )
2525
texture = ExtResource( 1 )
2626
centered = false
2727
offset = Vector2( -69.3109, -99.8051 )
2828
region_enabled = true
2929
region_rect = Rect2( 28, 220, 132, 136 )
3030

31-
[node name="StaticBody2D" type="StaticBody2D" parent="wall"]
31+
[node name="StaticBody2D" type="StaticBody2D" parent="Wall"]
3232

33-
[node name="collision" type="CollisionPolygon2D" parent="wall/StaticBody2D"]
33+
[node name="collision" type="CollisionPolygon2D" parent="Wall/StaticBody2D"]
3434
polygon = PoolVector2Array( -68, 2, -4, 34, 60, 2, -4, -30 )
3535

36-
[node name="column" type="Sprite" parent="."]
36+
[node name="Column" type="Sprite" parent="."]
3737
position = Vector2( 359.563, 266.446 )
3838
texture = ExtResource( 1 )
3939
centered = false
4040
offset = Vector2( -69.5632, -100.446 )
4141
region_enabled = true
4242
region_rect = Rect2( 220, 220, 132, 136 )
4343

44-
[node name="StaticBody" type="StaticBody2D" parent="column"]
44+
[node name="StaticBody" type="StaticBody2D" parent="Column"]
4545

46-
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="column/StaticBody"]
46+
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Column/StaticBody"]
4747
polygon = PoolVector2Array( -20, -6, -4, 10, 4, 10, 28, -6, 12, -22, -4, -22 )
4848

49-
[node name="door1" type="Sprite" parent="."]
49+
[node name="Door1" type="Sprite" parent="."]
5050
position = Vector2( -24.1548, 142.216 )
5151
texture = ExtResource( 1 )
5252
centered = false
5353
offset = Vector2( -50.3623, -90.8164 )
5454
region_enabled = true
5555
region_rect = Rect2( 24, 408, 132, 136 )
5656

57-
[node name="StaticBody2D" type="StaticBody2D" parent="door1"]
57+
[node name="StaticBody2D" type="StaticBody2D" parent="Door1"]
5858

59-
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="door1/StaticBody2D"]
59+
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Door1/StaticBody2D"]
6060
polygon = PoolVector2Array( -5.90501, 31.3748, 66.095, -0.62516, 50.095, -8.62516, -21.905, 23.3748 )
61-

2d/isometric/troll.gd

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,12 @@
11
extends KinematicBody2D
22

3-
# This is a demo showing how KinematicBody2D
4-
# move_and_slide works.
5-
6-
# Member variables
73
const MOTION_SPEED = 160 # Pixels/second
84

9-
105
func _physics_process(_delta):
116
var motion = Vector2()
12-
13-
if Input.is_action_pressed("move_up"):
14-
motion += Vector2(0, -1)
15-
if Input.is_action_pressed("move_bottom"):
16-
motion += Vector2(0, 1)
17-
if Input.is_action_pressed("move_left"):
18-
motion += Vector2(-1, 0)
19-
if Input.is_action_pressed("move_right"):
20-
motion += Vector2(1, 0)
21-
7+
motion.x = Input.get_action_strength("move_right") - Input.get_action_strength("move_left")
8+
motion.y = Input.get_action_strength("move_down") - Input.get_action_strength("move_up")
9+
motion.y *= 0.5
2210
motion = motion.normalized() * MOTION_SPEED
23-
11+
#warning-ignore:return_value_discarded
2412
move_and_slide(motion)

2d/isometric/troll.tscn

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[sub_resource type="CircleShape2D" id=1]
77
radius = 16.0
88

9-
[node name="troll" type="KinematicBody2D"]
9+
[node name="Troll" type="KinematicBody2D"]
1010
script = ExtResource( 1 )
1111

1212
[node name="Sprite" type="Sprite" parent="."]
@@ -19,4 +19,3 @@ shape = SubResource( 1 )
1919

2020
[node name="Camera2D" type="Camera2D" parent="."]
2121
current = true
22-

0 commit comments

Comments
 (0)