-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.asm
63 lines (34 loc) · 910 Bytes
/
main.asm
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
INCLUDE \masm32\include\masm32rt.inc
;Include essential masm stuff
INCLUDE mainFuncs.inc
;Include all of the functions
.CODE
main PROC
;Start of main function
INVOKE init
;Call the initialize function
loopa:
;Start main loop
;Call all drawing and updating functions and repeat them infinitley
INVOKE draw
CMP pScored, 1
JE startTime
;pScored is increased when a player scores a point
JMP after
startTime:
INVOKE Sleep, 1000
DEC pScored
;Add a timeout before starting the game again and reset pScored value
after:
INVOKE update
INVOKE scoring, OFFSET ball, OFFSET scoreImgP1, OFFSET scoreImgP2, OFFSET scoreImgP12 , OFFSET scoreImgP22
CMP endTheGame, 1
JE endItAll
;endTheGame is increased when a player presses escape
JMP loopa
endItAll:
INVOKE ExitProcess, 0
;End and exit the code
RET
main ENDP
END main