@@ -64,6 +64,7 @@ pub const AMIDAR_ENEMY_POSITIONS_DATA: &str = include_str!("resources/amidar_ene
64
64
pub struct Amidar {
65
65
pub rand : random:: Gen ,
66
66
board : Vec < String > ,
67
+ pub player_start : TilePoint ,
67
68
bg_color : Color ,
68
69
player_color : Color ,
69
70
unpainted_color : Color ,
@@ -100,6 +101,7 @@ impl Default for Amidar {
100
101
Amidar {
101
102
rand : random:: Gen :: new_from_seed ( 13 ) ,
102
103
board : AMIDAR_BOARD . lines ( ) . map ( |s| s. to_owned ( ) ) . collect ( ) ,
104
+ player_start : TilePoint :: new ( 31 , 15 ) ,
103
105
bg_color : Color :: black ( ) ,
104
106
player_color : Color :: rgb ( 255 , 255 , 153 ) ,
105
107
unpainted_color : Color :: rgb ( 148 , 0 , 211 ) ,
@@ -1033,7 +1035,6 @@ pub struct StateCore {
1033
1035
pub chase_timer : i32 ,
1034
1036
pub jump_timer : i32 ,
1035
1037
pub player : Mob ,
1036
- pub player_start : TilePoint ,
1037
1038
pub enemies : Vec < Mob > ,
1038
1039
pub board : Board ,
1039
1040
}
@@ -1053,8 +1054,7 @@ impl State {
1053
1054
. iter ( )
1054
1055
. map ( |ai| board. make_enemy ( ai. clone ( ) ) )
1055
1056
. collect ( ) ;
1056
- let player_start = TilePoint :: new ( 31 , 15 ) ;
1057
- let player = Mob :: new_player ( player_start. to_world ( ) ) ;
1057
+ let player = Mob :: new_player ( config. player_start . to_world ( ) ) ;
1058
1058
1059
1059
let core = StateCore {
1060
1060
rand : random:: Gen :: new_child ( & mut config. rand ) ,
@@ -1064,7 +1064,6 @@ impl State {
1064
1064
jumps : config. start_jumps ,
1065
1065
jump_timer : 0 ,
1066
1066
player,
1067
- player_start,
1068
1067
enemies,
1069
1068
board,
1070
1069
} ;
@@ -1079,7 +1078,7 @@ impl State {
1079
1078
pub fn reset ( & mut self ) {
1080
1079
self . state
1081
1080
. player
1082
- . reset ( & self . state . player_start , & self . state . board ) ;
1081
+ . reset ( & self . config . player_start , & self . state . board ) ;
1083
1082
// On the default board, we imagine starting from below the initial place.
1084
1083
// This way going up paints the first segment.
1085
1084
if self . config . default_board_bugs {
@@ -1091,7 +1090,7 @@ impl State {
1091
1090
) ;
1092
1091
}
1093
1092
for enemy in & mut self . state . enemies {
1094
- enemy. reset ( & self . state . player_start , & self . state . board ) ;
1093
+ enemy. reset ( & self . config . player_start , & self . state . board ) ;
1095
1094
}
1096
1095
}
1097
1096
pub fn board_size ( & self ) -> WorldPoint {
0 commit comments