Thanks for the detailed reply :) Can`t wait to be able to afford a Mayhem, hopefully sometime after Christmas :) I`ve got loads of ideas, but it`s hard coding for it on emulator in some ways.
anywayz, If I had a black track instead of textured then there could even be no need to mask the sprites, or switch between two screens, could just have some black below them etc to rub the car out itself? That 8*8 pixel machine code (on a Flex disk I think) has got me thinking that the smaller the graphics the better. And I presume it would be quicker for the/a MC sprite routine if all "Sprite`s" were a fixed size... Could I just ask please if it`s much of an inconvenience, if you wanted to write say three different small (or unrolled) graphics routines, for different sized graphics, and load them all and use them all? How practible would this be? The Basic part could be speeded up a lot, by Gosubing a script, that would place the Computer cars at certain places, so they`d be quite dumb like a skaletrix, but would be able to randomly (or not so randomly) switch between about 5 tracks and stuff to get in the way etc. Just so that there`s Let Car1X=Car1X+2 and other code etc needed. something like 1000 Def Proc Lev1 1010 Gosub Car1 : Gosub Car2 : Gosub Car3 1020 Car1Switch :Car2Switch : Car3Switch : procs would only be 3 or 4 lines 1030 if Inkey$=L$ or Inkey$= l$ then SwitchToL :rem Code to switch tracks or ram car 1040 If Inkey$=R$ or inkey$=r$ then SwitchToR 1050 If (Code to test Shift Key) then Let Speed=Speed+1 AND Speed<6 1060 If Inkey$=firesaysthepirate and Arrrgg=0 then then Gosub FireInit:Let arrrgg=1 1065 If Arrrgg=1 then gosub MovBullit 1070 If Inkey$=Oil$ and Oils>0 then Gosub Oils: Let Oils=Oils-1 1080 GoSub Tim : Another script like thing to do other extras and place pickups 1090 Call Cars (Machine Code Routine) 1095 GoTo 1010: End Proc ` ` 2000 Car1 Script 2010 Let Car1X=200,Car1Y=55 : Let Car1=Car1+10 : Return 2020 Let Car1X=204,Car1Y=55 : Let Car1=Car1+10 : Return etc etc, with a once per loop jump to a Line that randomly speeds the car up, or slows it down, by adding or taking away 5 or 7 etc to the variable Car1 or switches it Track, by affecting Car1Y 2030 Let Car1X=208,Car1Y=55 : Let Car1=Car1+10 : Return 2035 Let Car1x=208,Car1Y=58 : Let Car1=Car1+10 : Return 2040 Let Car1X=212,Car1Y=55 : Let Car1=Car1+10 : Return 2045 Let Car1X=212,Car1Y=58 : Let Car1=Car1+10 : etc etc, or diff line for X speed 2050 Let Car1X=216,Car1Y=55 : Let Car1=Car1+10: Return The code for collisions could hopefully be handled by a look up table, or some fancy Def FN`s, but I`m afraid I`d need some help possibly,as never really done that before, or possibly the code could be initially handled by comparing the Car1 gosub variables, Car2 etc with player and each other initially, as it`d know there basic position quickly and know if there at other ends of track, anyhow that`s the only real thing making me worry... Collision detections gonna be the biggest amount of code needs doing, and I`m not sure if Basics gonna be fast enough to show the MC code off reasonably if I just call it after each loop. I was thinking the main Player would work much the same, way but have more lanes perhaps, so you could give more of a nice, feel and not make the controls too fiddly if you instantly switch three lanes by mistake, or you could perhaps slide out dureing corner`s... What do you think, would it be worth tackling it in this way, I`m not sure how much speed could be got from some MC in there verses Put, but SAMs basic is quite slow once you start giving it a lot of commands to process, some MC could hopefully give more time back to run more of a complicated game engine, so I just hope it could be more advanced than another glorified LCD type game, but with quick graphics :) The one thing tuff about doing it this way, is all the lines of Gosub code needed to place each car, it`d be a sqeeze getting it under 64K, and Basic startes crashing, locking up then :( I`m truly sorry for my stoned ramble, but it`s nice talking about programming ;) Cal... Adrian Brown <[EMAIL PROTECTED]> wrote: v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} Dont worry about the speed, just order a mayhem accelerator ;) But yes, redrawing the entire screen can be very slow. Ideally what you do is more like: Clear the grab buffers Loop: Set the display to page 1 Update your game logic, move the cars etc Put the contents of grab buffer 2 back in the old position for each sprite Grab the area under each sprite into their grab buffer 2, remember the position for redrawing Use the MC sprite routine to draw the sprites on page 2 in the positions Set the display to page 2, showing the sprites in the new position Update your game logic, move cars etc Put the contents of grab buffer 1 back in the old position for each sprite Grab the area under each sprite into their grab buffer 1, remember the position for redrawing Use the MC sprite routine to draw the sprites on page 1 in the positions Repeat This is a little more tricky as you have to keep 2 copies of the grab buffer (one for each screen, apparently some people say you can do it with one buffer but ive not had much luck with that). It depends on the MC routine, some do know about the Screen/display commands, some dont, its not always that hard to alter. The grabbing is a similar MC routine. Adrian From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Calvin Allett Sent: 16 May 2007 02:46 To: Adrian Subject: RE: MC Interrupts `Did someone call? ;) Yes it was the early issues, it was issues 1-5 i think, ` i was only talking to colin this evening about that, now ive moved i ` really need to get on with finishing it, although i lost all my code ` when i lost the sam harddrive. Ive now got a sam in a can and have ` some new flash cards on order so ill get back to it and finish the ` little game, maybe some articles on learning mc can be arranged. A S-I-A-Can.... Lucky Bas... erm... I mean sweet :D I haven`t got the articles in question, but meaning to get those issue`s, so if you`ll be hopefully doing more then that`s brilliant. `To use something like that from basic, you could just do the following ` (this is off the top of my head after a bottle of wine, so it maybe ` wrong ;) ) But each frame you could do the following (its basically ` a double buffer system but from basic). When i say page 1, page 2 ` i dont mean physical memory pages, but any particular page, again ` from memory it might have been the screen command that allowed you ` to open up and use different screens. If you dont know then ill ` try and dig up the info tomorrow. Yeah, your right, it`s the Screen command, with also the Display command for the flipping.. :) Would a MC routine, know which area in RAM to draw too, if Basic was flipping screens though, just thought. OR could a copy of a routine be used to either draw to screen 1 or 2, so from Basic call the correct one? I`m never sure if you can have a small MC routine, and a copy, because if they both need to be paged in or whatever... `IN BASIC: ` ` Set the display to page 1` ` ` Update your game logic, move the cars etc` ` ` Use the MC sprite routine to draw the sprites on page 2 in the positions` ` ` Set the display to page 2, showing the sprites in the new position` ` ` Update your game logic, move cars etc ` ` Use the MC sprite routine to draw the sprites on page 1 in the positions ` ` ` ` Repeat ;) ` ` ` `You still need to either A) handle storing what was under the sprites ` and putting it back, or B) just redraw the entire screen before you ` draw the sprites. B) is the easiest to start with but can be slow, ` but the key is to get things working then speed them up. Doing this ` you are only actually updating when you want to, you dont need interrupts, ` you dont need anything clever in MC to do checking etc. I`ve tried drawing the complete (well 2/3rd`s of the screen) using double buffering in `Jimf `n Oobs` and it knocks it to about 4 fps, so been thinking of for a car game, defining area`s where cars may be, since the tracks will only be about 24 pixels high or wide and drawing that if a car/s is in that region, this shouldn`t be much of a problem... I`ll try and knock up a demo of what I have in mind over the next few days, and you can hopefully see whether or not you think a MC routine would be possible/beneficial :) `I might be completely off track here, so let me know J `Adrian. Your not ;) Oh, and `off track`.... very good, is that a pun :) Cal... --------------------------------- The all-new Yahoo! Mail goes wherever you go - free your email address from your Internet provider. --------------------------------- APB Computer Services Ltd. Registered Address: 3 Springfield, Trevadlock, Congdons Shop, Launceston, Cornwall, PL15 7PW. Registration Number: 4942193. V.A.T. No: 826 0005 70 --------------------------------- This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. --------------------------------- Yahoo! Answers - Got a question? Someone out there knows the answer. Tryit now.