@@ -53,29 +53,34 @@ impl Map {
53
53
'[' => {
54
54
let tile = Tile :: new ( draw_pos, physics, asset_manager, TileType :: LEFT ) ;
55
55
56
- draw_inc = tile. dimensions ( ) . x ;
57
- ground. push ( tile) ;
58
-
56
+ draw_inc = ( tile. dimensions ( ) . x / 2.0 ) + 32.0 ;
59
57
draw_pos += draw_inc;
58
+
59
+ ground. push ( tile) ;
60
60
}
61
61
62
62
'-' => {
63
63
let tile =
64
64
Tile :: new ( draw_pos, physics, asset_manager, TileType :: CENTER ) ;
65
65
66
- draw_inc = tile. dimensions ( ) . x ;
67
- ground. push ( tile) ;
68
-
66
+ draw_inc = ( tile. dimensions ( ) . x / 2.0 ) + 32.0 ;
69
67
draw_pos += draw_inc;
68
+
69
+ ground. push ( tile) ;
70
70
}
71
71
72
72
']' => {
73
- let tile = Tile :: new ( draw_pos, physics, asset_manager, TileType :: RIGHT ) ;
73
+ let tile = Tile :: new (
74
+ ( draw_pos - 32.0 ) + 20.0 ,
75
+ physics,
76
+ asset_manager,
77
+ TileType :: RIGHT ,
78
+ ) ;
79
+
80
+ draw_inc = ( tile. dimensions ( ) . x / 2.0 ) + 32.0 ;
81
+ draw_pos += draw_inc;
74
82
75
- draw_inc = tile. dimensions ( ) . x ;
76
83
ground. push ( tile) ;
77
-
78
- draw_pos += draw_inc;
79
84
}
80
85
81
86
'_' => {
@@ -87,7 +92,7 @@ impl Map {
87
92
let tile =
88
93
Tile :: new ( draw_pos, physics, asset_manager, TileType :: CENTER ) ;
89
94
90
- draw_inc = tile. dimensions ( ) . x ;
95
+ draw_inc = ( tile. dimensions ( ) . x / 2.0 ) + 32.0 ;
91
96
92
97
ground. push ( tile) ;
93
98
enemies. push ( Enemy :: new ( draw_pos, physics, asset_manager) ) ;
@@ -100,12 +105,12 @@ impl Map {
100
105
let tile =
101
106
Tile :: new ( draw_pos, physics, asset_manager, TileType :: CENTER ) ;
102
107
103
- draw_inc = tile. dimensions ( ) . x ;
104
-
105
- ground. push ( tile) ;
106
108
player = Some ( Player :: new ( draw_pos, physics, asset_manager) ) ;
107
109
110
+ draw_inc = tile. dimensions ( ) . x ;
108
111
draw_pos += draw_inc;
112
+
113
+ ground. push ( tile) ;
109
114
}
110
115
111
116
'*' => {
0 commit comments