-
Notifications
You must be signed in to change notification settings - Fork 0
/
Wheel.php
41 lines (37 loc) · 819 Bytes
/
Wheel.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
<?php
/**
* Created by PhpStorm.
* User: Zver
* Date: 11.03.2019
* Time: 20:26
*/
class Wheel
{
private $pressure,
$d,
$owner;
function __construct($owner = NULL, $pressure = 2.0, $d = 13)
{
$this->pressure = $pressure;
$this->d = $d;
$this->owner = $owner;
}
function getPressure() {return $this->pressure;}
function setPressure($pressure)
{
if ($pressure < 0) $pressure = 0;
if ($pressure > 5)
{
echo "BABAH!!!<br>";
$pressure = 0;
}
if ($this->owner != NULL)
{
if ($pressure == 0)
$this->owner->speed = 0;
else if($pressure < 0.5)
$this->owner->speed /= 2;
}
$this->pressure = $pressure;
}
}