-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
61 lines (38 loc) · 853 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
session_start();
require_once 'baseball.php';
$baseball = new Baseball();
$team1 = 'teams/team_fire.json';
$team2 = 'teams/team_water.json';
if(isset($_GET['action']) && $_GET['action'] == 'reset'){
$info = $baseball->resetGame();
}
$baseball->initGame($team1,$team2);
if(isset($_GET['action']) && $_GET['action'] == 'next'){
$info = $baseball->simNext();
}
$nextBatter = $baseball->getNextBatter();
$pitcher = $baseball->getTeamPitcher();
require ('assets/view.php');
//players
$hitterWeak = [
'contact' => 50,
'power' => 50,
'speed' => 50,
];
$pitcherWeak = [
'fastball' => 60,
'control' => 50,
'movement' => 60
];
$hitterStrong = [
'contact' => 90,
'power' => 90,
'speed' => 80,
];
$pitcherStrong = [
'fastball' => 100,
'control' => 90,
'movement' => 80
];
?>