-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathballs.CB
83 lines (67 loc) · 2.05 KB
/
balls.CB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
InitFogs:
Type FOGS
Field img
Field x As Float
Field y As Float
Field vx As Float
Field vy As Float
Field a As Float
EndType
h = LoadImage("fog.png")
count = 48
For i = 0 To count
fog.FOGS = New(FOGS)
fog\img = CloneImage(h)
fog\x = Rand(sw) + (1 - Rand(1) * 2) * sw * 1.25
fog\y = Rand(sh)
fog\vx = 6 * (1 - (fog\x > sw) * 2)
fog\vy = Rnd(-2,2)
fog\a = Rnd(360)
If sw<>960 Or sh<>540 Then ResizeImage fog\img, 722 * swra, 477 * shra
RotateImage fog\img, fog\a // Pakko kääntää, muuten menee huonosti
Text 0,0,Int((i/Float(count))*100)+"%"
DrawScreen
Next i
once = True
Return
CalcFogs:
// Kauheeta kopiointia Wingin synkkaus esimerkistä
If isku1<>wisku1 And runTime>9000 And (runTime<37000 Or runTime>46000) Then
c# = 255
Else
c# = smooth(0,c,10)
EndIf
If isku2<>wisku2 And runTime>18000 And runTime<37000 Then
c2# = 255
Else
c2# = smooth(0,c2,20)
EndIf
For fog.FOGS = Each FOGS
If runTime < 5000 Then // Slide in from the sides
fog\x = fog\x + fog\vx * swra * multiplier * 0.5
fog\y = fog\y - Sin(fog\a) * shra * multiplier
ElseIf runTime > 5000 And runTime < 37000
If once Then fog\vx = Rnd(-3, 3)
fog\x = fog\x + fog\vx*((c#+c2#+64)/64.0)*swra#*multiplier
fog\y = fog\y + fog\vy*((c#+c2#+64)/64.0)*shra#*multiplier
// Change direction if the fog is moving out from the screenarea
If fog\x > sw And fog\vx > 0 Then fog\vx = -fog\vx
If fog\x < 0 And fog\vx < 0 Then fog\vx = -fog\vx
If fog\y > sh And fog\vy > 0 Then fog\vy = -fog\vy
If fog\y < 0 And fog\vy < 0 Then fog\vy = -fog\vy
Else
fog\x = fog\x + Cos(fog\a) * swra * multiplier * 3
fog\y = fog\y - Sin(fog\a) * shra * multiplier * 3
EndIf
Next fog
If runTime > 5000 And runTime < 6000 Then once = False
Return
DrawFogs:
cbeSetBlendMode(CBE_BLEND_RESET)
cbEColor(c#, c2#, 0, 200)
Box 0, 0, ScreenWidth(), ScreenHeight()
cbeSetBlendMode(CBE_BLEND_ADDITIVE)
For fog.FOGS = Each FOGS
DrawImage fog\img, fog\x, fog\y
Next fog
Return