summaryrefslogtreecommitdiffstats
path: root/TemplePushing.c4s/Locals.c4d/Brick.c4d/Script.c
blob: 02b3933b7daf6b866fb27c75aa6d90b863e7200b (plain)
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
/*-- Brick --*/

#strict
local pSchatten;
local fVer,iYL,iYH;

func Initialize() {
  SetAction("Flying");
  SetPhase(Random(2));
  SetDir(Random(2)); 
  ContactTop(); 
  iYL = 650;
  iYH = 100;
  return(1);
}

func ContactBottom() { SetYDir(-10); }
func ContactTop() { SetYDir(10); }

func CheckHit()
{
 if (GetXDir() == 0 && GetYDir() == 0)
 {
 SetXDir(RandomX(-100,100));
 SetYDir(RandomX(-100,100));
 }
 if (GetY() >= iYL) ContactBottom(); 
 if (GetY() <= iYH) ContactTop(); 
 return(1);
}