Designing solutions through programming - June 1 Lesson Notes: Difference between revisions
Mr. MacKenty (talk | contribs) |
Mr. MacKenty (talk | contribs) |
||
Line 34: | Line 34: | ||
$grid[($current_player_location-1)] = 4; | $grid[($current_player_location-1)] = 4; | ||
} elseif($move == 'E' || $move == 'e'){ | } elseif($move == 'E' || $move == 'e'){ | ||
monster($current_player_location,$current_monster_location,($current_player_location+1)); | |||
if($current_player_location==50){ $grid[50]=1; } | if($current_player_location==50){ $grid[50]=1; } | ||
$grid[$current_player_location] = $_SESSION['terrain_in_destination']; | $grid[$current_player_location] = $_SESSION['terrain_in_destination']; | ||
Line 40: | Line 41: | ||
$grid[($current_player_location+1)] = 4; | $grid[($current_player_location+1)] = 4; | ||
} elseif($move == 'N' || $move == 'n'){ | } elseif($move == 'N' || $move == 'n'){ | ||
monster($current_player_location,$current_monster_location,($current_player_location-20)); | |||
if($current_player_location==50){ $grid[50]=1; } | if($current_player_location==50){ $grid[50]=1; } | ||
$grid[$current_player_location] = $_SESSION['terrain_in_destination']; | $grid[$current_player_location] = $_SESSION['terrain_in_destination']; | ||
Line 46: | Line 48: | ||
$grid[($current_player_location-20)] = 4; | $grid[($current_player_location-20)] = 4; | ||
} elseif($move == 'S' || $move == 's'){ | } elseif($move == 'S' || $move == 's'){ | ||
monster($current_player_location,$current_monster_location,($current_player_location+20)); | |||
if($current_player_location==50){ $grid[50]=1; } | if($current_player_location==50){ $grid[50]=1; } | ||
$grid[$current_player_location] = $_SESSION['terrain_in_destination']; | $grid[$current_player_location] = $_SESSION['terrain_in_destination']; |
Latest revision as of 09:25, 1 June 2017
|
|
|
|
||
|
|
|
|