I noticed a number of posts recently about compiled BASIC games, and some of the titles feature smooth scrolling. How was this done?
I'm aware one of the HiSoft compilers included software sprites, but I think that was a one off.
Thanks
Compiled BASIC games with smooth scrolling
- Turtle_Quality
- Manic Miner
- Posts: 506
- Joined: Fri Dec 07, 2018 10:19 pm
Re: Compiled BASIC games with smooth scrolling
Compiled games can often call a machine code routine for sprites or scrolling. If your reference to "recent posts about compiled games" means the ones I was trawling through with source code, we could probably find a USR keyword in the BASIC.
Definition of loop : see loop
Re: Compiled BASIC games with smooth scrolling
Well, there is no better example than Loxley.
There are ROM calls, but no machine code executed in RAM.
More about development:
There are ROM calls, but no machine code executed in RAM.
More about development:
Re: Compiled BASIC games with smooth scrolling
I don't see any scrolling in it though! (Oh, OK, a fairly jerky bit early on. Probably the worst looking bit of the whole game!).
You can scroll by whole characters fairly easily in BASIC, by re-printing everything you need in a new position. Though you need to (a) try and keep the re-draw to a single PRINTed string for speed and (b) update as little of the screen as possible, i.e. just a few rows.
For finer scrolling, you can define pre-shifted UDGs either in one or multiple banks. Then when you re-print them, things can move by a few pixels in a limited animation, then you move them a whole character and repeat.
But to do a full-screen scroll you'll want a BASIC language extension like my own CharAde, which to my great surprise can be compiled by HiSoft BASIC.
You can scroll by whole characters fairly easily in BASIC, by re-printing everything you need in a new position. Though you need to (a) try and keep the re-draw to a single PRINTed string for speed and (b) update as little of the screen as possible, i.e. just a few rows.
For finer scrolling, you can define pre-shifted UDGs either in one or multiple banks. Then when you re-print them, things can move by a few pixels in a limited animation, then you move them a whole character and repeat.
But to do a full-screen scroll you'll want a BASIC language extension like my own CharAde, which to my great surprise can be compiled by HiSoft BASIC.
- Turtle_Quality
- Manic Miner
- Posts: 506
- Joined: Fri Dec 07, 2018 10:19 pm
Re: Compiled BASIC games with smooth scrolling
There was also a character scroll upwards in that video used to clear the screen, but that's quite easy to achieve in basic by printing at the bottom of screen to force a scroll, you just need to do a POKE to suppress the "scroll ?" prompt.
Definition of loop : see loop
Re: Compiled BASIC games with smooth scrolling
You can smooth scroll in uncompiled BASIC if you use the strengths of the PRINT command and spare character sets / UDGs.