-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfood.asm
79 lines (58 loc) · 1.1 KB
/
food.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
update_food:
lda FoodActive
cmpa #1
bne update_food_exist_over
jsr update_food_position
jsr update_food_collision
jsr draw_food
jmp update_food_over
update_food_exist_over
jsr update_food_activation
update_food_over
rts
update_food_activation:
lda SharkIsInWater
cmpa #1
beq update_food_activation_over
lda #1
sta FoodActive
lda #60
sta FoodPositionX
update_food_activation_over
rts
draw_food:
lda #-122
ldb FoodPositionX
jsr Moveto_d
ldx #food_list
jsr Draw_VLc
lda #122
ldb FoodPositionX
negb
jsr Moveto_d
rts
update_food_position:
lda SharkVelocityX
nega
adda FoodPositionX
sta FoodPositionX
rts
update_food_collision:
lda FoodPositionX
cmpa #-20
blt update_food_collision_over
cmpa #20
bgt update_food_collision_over
lda SharkPositionY
cmpa #-118
bgt update_food_collision_over
lda #0
sta FoodActive
lda TimerValue
adda #3
sta TimerValue
lda #3
ldx #Timer
jsr Add_Score_a
update_food_collision_over
rts