home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Light
/
Light_Vol.1_August_1992_Datasphere_Publications_Disk_1_of_2_Side_B.d64
/
demo.bas
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2023-02-26
|
5KB
|
280 lines
1000 rem ******************************
1001 rem **** demonstration patterns
1002 rem **** for 'spritez basic',
1003 rem **** by ian goffe, 1991.
1004 rem ******************************
1005 rem
1006 rem **** 'flush' movement patterns
1007 rem
1008 reset
1009 rem
1010 rem **** define an array to hold
1011 rem **** progressive 'jump' values
1012 rem **** to give the effect of
1013 rem **** gravitational velocity.
1014 rem
1015 dim delay(20)
1016 for l=1 to 20:read delay(l):next
1017 rem
1018 rem **** border/background colours
1019 poke761,0:poke762,0
1020 rem
1021 rem **** define background/sprite
1022 rem **** multi-colours.
1023 rem
1024 poke763,9:poke764,15:poke53285,6:poke53286,14
1025 rem
1026 rem 'pattern 0'
1027 rem ------------
1028 rem
1029 rem this pattern sets the
1030 rem animation speed, sets
1031 rem no vertical movement, but
1032 rem sets horizontal motion with
1033 rem a jump of 2, until x
1034 rem reaches value 200+256; the
1035 rem 256 being governed by the
1036 rem '1' in the 'xto' syntax.
1037 rem
1038 rem once this is reached, then
1039 rem a loop is set up which
1040 rem continues as:-
1041 rem
1042 rem move up and left until
1043 rem the y co-ordinate is
1044 rem at position 50, then
1045 rem move down and right
1046 rem until y is at 190.
1047 rem then repeat the above...
1048 rem
1049 pattern 0:aspeed 3
1050 yjump 0
1051 xfunc 1:right:yfunc 0:xjump 2:xto 20,1
1052 move
1053 yfunc 1:xfunc 0
1054 label:yto 50
1055 left:up:xjump 1:yjump 1
1056 move
1057 right:down:xjump 2:yjump 2:yto 190
1058 move
1059 loop
1060 rem
1061 rem
1062 rem
1063 rem
1064 rem
1065 rem
1066 rem
1067 rem
1068 rem
1069 rem
1070 rem pattern 1
1071 rem ---------
1072 rem
1073 rem moves right until x is at
1074 rem position 60+256;
1075 rem then move left until x is
1076 rem at position 40.
1077 rem repeat the above steps....
1078 rem
1079 pattern 1
1080 aspeed 2
1081 yfunc 0:xfunc 1:xjump 1:yjump 0
1082 label
1083 right:xto 60,1
1084 move
1085 left:xto 40,0
1086 move
1087 loop
1088 rem
1089 rem
1090 rem
1091 rem
1092 rem
1093 rem
1094 rem
1095 rem
1096 rem
1097 rem
1098 rem pattern 2
1099 rem ---------
1100 rem
1101 rem this pattern only differs
1102 rem from pattern 1 in the
1103 rem fact that the speed
1104 rem of movement is changed
1105 rem between left & right
1106 rem 'bounces'.
1107 rem
1108 rem
1109 pattern 2:aspeed 5
1110 yfunc 0:xfunc 1
1111 label:xjump 1:yjump 0
1112 right:xto 160,0:xjump 1
1113 move
1114 left:xto 40,0:xjump 2
1115 move
1116 loop
1117 rem
1118 rem
1119 rem
1120 rem
1121 rem
1122 rem
1123 rem
1124 rem pattern 3
1125 rem ---------
1126 rem
1127 rem this pattern 'bounces'
1128 rem between the vertical
1129 rem screen positions, 60 and 200
1130 rem
1131 rem
1132 pattern 3
1133 yfunc1:xfunc0:xjump 0:yjump 1:aspeed 6
1134 label
1135 yto 60:up:move
1136 yto 200:down:move
1137 loop
1138 rem
1139 rem
1140 rem
1141 rem
1142 rem
1143 rem
1144 rem
1145 rem
1146 rem pattern 4
1147 rem ---------
1148 rem
1149 rem here is an example of the
1150 rem use of the 'count' command.
1151 rem what is actually happening
1152 rem here is that downward motion
1153 rem is specified, then a 'pixel'
1154 rem jump value is read from the
1155 rem pre-defined array, this is
1156 rem then moved for a count of
1157 rem '1', for each of the 20
1158 rem jump values.
1159 rem the 'jump' table is then
1160 rem read and moved 'backwards',
1161 rem giving upward motion; this
1162 rem is then repeated...
1163 rem
1164 rem
1165 pattern 4:aspeed5
1166 xjump0:label:down:forl=1to20:count 1:yjump delay(l)
1167 move:nextl
1168 up:for l=20 to 1 step -1
1169 count 1:yjump delay(l)
1170 move:nextl
1171 loop
1172 rem
1173 rem
1174 rem
1175 rem
1176 rem
1177 rem
1178 rem pattern 5
1179 rem ---------
1180 rem
1181 rem 'pattern 5' is a reverse
1182 rem of the previous pattern,
1183 rem starting with upward motion
1184 rem
1185 rem
1186 rem
1187 rem
1188 pattern 5:aspeed 4
1189 xjump0:label:up:forl=20to1step-1:count 1:yjump delay(l)
1190 move:nextl
1191 down:for l=1 to 20
1192 count 1:yjump delay(l)
1193 move:nextl
1194 loop
1195 rem
1196 rem
1197 rem
1198 rem
1199 rem
1200 rem
1201 rem
1202 rem pattern 6
1203 rem ----------
1204 rem
1205 rem the same delay/jump
1206 rem principle is used here...
1207 rem but in diagonal movement.
1208 rem
1209 rem
1210 rem
1211 rem
1212 rem
1213 pattern 6
1214 aspeed6:yjump1:label:down:right:forl=1to19:count 2:xjump delay(l)
1215 move:nextl
1216 up:left:for l=19 to 1 step -1
1217 count 2:xjump delay(l)
1218 move:nextl
1219 loop
1220 rem
1221 rem
1222 rem
1223 rem
1224 rem
1225 rem
1226 rem
1227 rem
1228 rem pattern 7
1229 rem ---------
1230 rem
1231 rem a mixture of 'straight'
1232 rem and 'diagonal' movement...
1233 rem using a count value of 2,
1234 rem this moves 'twice' for each
1235 rem specified 'jump' value...
1236 rem
1237 rem
1238 rem
1239 pattern 7
1240 label:yjump1:animate1:aspeed3:down:left:forl=1to17:count 2:xjump delay(l)
1241 move:nextl:animate 0:aspeed3
1242 up:right:for l=17 to 1 step -1
1243 count 2:xjump delay(l)
1244 move:nextl:yjump 0
1245 xfunc1:xto 170,0:xjump 1:move
1246 loop
1247 pattern 8
1248 rem
1249 rem
1250 rem
1251 rem
1252 rem
1253 rem pattern 8
1254 rem ---------
1255 rem
1256 rem yet another example of
1257 rem diagonal/delay movement...
1258 rem
1259 rem
1260 rem
1261 aspeed6:yjump1:label:up:left:forl=1to19:count 2:xjump delay(l)
1262 move:nextl
1263 down:right:for l=19 to 1 step -1
1264 count 2:xjump delay(l)
1265 move:nextl
1266 loop
1267 rem
1268 rem
1269 rem
1270 rem pack movement definitions...
1271 rem
1272 pack
1273 rem
1274 rem
1275 rem delay values for movement...
1276 rem
1277 data 0,0,1,1,1,1,2,2,2,2,2,2,2,2
1278 data 3,3,3,3,3,4