-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtoga
More file actions
78 lines (76 loc) · 2.34 KB
/
toga
File metadata and controls
78 lines (76 loc) · 2.34 KB
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
rem sprite demo
1 print chr$(5)" toga - arrow key to move "
2 print chr$(154)
3 r$=chr$(29):l$=chr$(157):rem rt lt
4 u$=chr$(145):d$=chr$(17):rem up dn
10 for n=0 to 24:poke 1024+34+40*n,160
11 next
12 for n=1 to 64*5:read dt
20 poke 8191+n,dt
30 next
31 poke 2040,128
32 poke 53248+0,96:poke 53248+1,98
34 poke 53248+23,1:poke 53248+29,1
36 poke 53248+28,1:poke 53248+21,1
40 dx=0:dy=0:x=96:y=98
50 get keyb$:
51 if x>25 and sgn(dx)=-1 then x=x+dx
52 if x<255 and sgn(dx)=1 then x=x+dx
53 if y>50 and sgn(dy)=-1 then y=y+dy
54 if y<210 and sgn(dy)=1 then y=y+dy
55 poke 53248+0,x:poke 53248+1,y
56 if keyb$ ="" then poke 2040,128:::goto 50
57 if keyb$<>r$ then goto 59
58 poke 2040,129:if dx<1 then dx=dx+.1
59 if keyb$<>l$ then goto 62
61 poke 2040,130:if dx>-1 then dx=dx-.1
62 if keyb$<>u$ then goto 66
64 poke 2040,131:if dy>-1 then dy=dy-.1
66 if keyb$<>d$ then goto 69
68 poke 2040,132:if dy<1 then dy=dy+.1
69 goto 50
1100 rem no-move
1101 data 240,0,240,240,0,240,240,0,240
1102 data 240,0,240,12,243,0,12,243,0
1103 data 3,12,0,3,12,0,12,243,0
1104 data 12,243,0,12,243,0,12,243,0
1105 data 3,12,0,3,12,0,12,243,0
1106 data 12,243,0,240,0,240,240,0,240
1107 data 240,0,240,240,0,240,0,0,0
1108 data 0
1200 rem move to right
1201 data 240,0,240,240,0,240,240,0,240
1202 data 240,0,240,12,243,0,12,243,0
1203 data 19,12,0,19,12,0,140,243,0
1204 data 140,243,0,140,243,0,140,243,0
1205 data 19,12,0,19,12,0,12,243,0
1206 data 12,243,0,240,0,240,240,0,240
1207 data 240,0,240,240,0,240,0,0,0
1208 data 0
1300 rem move to left
1301 data 240,0,240,240,0,240,240,0,240
1302 data 240,0,240,12,243,0,12,243,0
1303 data 3,12,64,3,12,64,12,243,32
1304 data 12,243,32,12,243,32,12,243,32
1305 data 3,12,64,3,12,64,12,243,0
1306 data 12,243,0,240,0,240,240,0,240
1307 data 240,0,240,240,0,240,0,0,0
1308 data 0
1400 rem move up
1401 data 240,0,240,240,0,240,240,0,240
1402 data 240,0,240,12,243,0,12,243,0
1403 data 3,12,0,3,12,0,12,243,0
1404 data 12,243,0,12,243,0,12,243,0
1405 data 3,12,0,3,12,0,12,243,0
1406 data 12,243,0,241,4,240,241,4,240
1407 data 240,160,240,240,160,240,0,0,0
1408 data 0
1500 rem move down
1501 data 240,160,240,240,160,240,241,4,240
1502 data 241,4,240,12,243,0,12,243,0
1503 data 3,12,0,3,12,0,12,243,0
1504 data 12,243,0,12,243,0,12,243,0
1505 data 3,12,0,3,12,0,12,243,0
1506 data 12,243,0,240,0,240,240,0,240
1507 data 240,0,240,240,0,240,0,0,0
1508 data 0