DusanStrakl 90 Posted January 16 (edited) I wrote a series of blog posts/articles on Commander X16 architecture and coding. I have started with focus on beginners and then slowly moved to more advanced topics and techniques. First I tackle smaller chunks and use simple examples to show the topic in practice. After enough new knowledge is covered I write a complete game to utilize several of the techniques to illustrate how it all comes together so each new complete project is more complex than the one before. I do cover only Commander X16 specific so I recommend reading Commodore C64 BASIC tutorials and guides. Please note that the games and most examples are written with a goal to be as clearly readable and understandable so there is very little source code optimizations. Snake Game This game is written in very clean BASIC with very little trickery so not much special Commander X16 knowledge is required. We do VPOKE directly into video memory so only understanding of fundamentals is required. Recommended reading VERA Overview Topics Covered in Game Analyzing the game itself is a great way to learn basics like: How to structure source code (outer loops, game loop) What is Game loop Use of Data structure like multiple Arrays How to read Joystick, Keyboard How to use VPOKE to “talk to” VERA Video RAM organization and using colors Writing to certain location on the screen Using PETSCII control characters to display messages and title screen GOTO Crazy Snake Tutorial GOTO Download Tetris Clone This game introduces some more advanced features of Commander X16 and we have to take a bit more care of how to use data structures and optimize some parts of the game to make it playable. Recommended reading VERA Overview Tiles in Basic I - Video Modes 0 and 1 Colors and Palettes Topics Covered in Game Tetris clone requires us to improve on pretty much all parts of the snake game structure: We have additional loops outside and inside game loop Advanced game collisions based on screen state Pre-calculate relative positions of four segments of each tetromino Customize color palette Customize tiles (characters) Speed increase per level Adding sound to the game GOTO Crazy Tetrominoes Tutorial GOTO Download Boulder Dash style game With this game we are using most of the Commander X16 hardware capabilities and we are getting close to squeezing most out of it for BASIC games. We have to pay close attention to timings, synchronizing scrolling and animation, take care of different types of collisions, etc. Recommended reading VERA Overview Tiles in Basic I - Video Modes 0 and 1 Sprites in Basic I - Setup Sprites in Basic II - Animation Scrolling and Layers in BASIC Colors and Palettes Simplest Sound Effects Library for BASIC Font Library for Commander X16 Topics Covered in Game This game is taking advantage of hardware features of Commander X16 to the level it almost looks like 16bit game or something written in Assembly for 8 bit computer like: Two phase approach to development Full color mode Full screen scrolling Two layer graphics Scrollable playfield Static HUD Animated full color sprites 256 color title screen in graphics mode Advanced physics and game mechanics Loading assets to memory from binary files for: Tileset Sprite Sheet Fonts Sound effects library Title screen GOTO Crazy Boulders Tutorial GOTO Download Edited January 17 by DusanStrakl 5 5 Quote Share this post Link to post Share on other sites
rje 193 Posted January 16 These are fantastic tutorials! Quote Share this post Link to post Share on other sites
DusanStrakl 90 Posted January 16 1 hour ago, rje said: These are fantastic tutorials! Thanks Rob, I appreciate it. Quote Share this post Link to post Share on other sites
Jakebullet70 7 Posted Saturday at 06:16 AM This is real good stuff. Sometimes I think people forget this is still a BASIC machine. 1 Quote Share this post Link to post Share on other sites
DusanStrakl 90 Posted Saturday at 07:09 PM 12 hours ago, Jakebullet70 said: This is real good stuff. Sometimes I think people forget this is still a BASIC machine. Thanks Jake. I agree and with powerful hardware supported graphics and 8Mhz clock speed a lot can be done in BASIC. I am working mostly on my Assembly tutorials now but I am sure I will add some more BASIC tutorials and games soon. 1 Quote Share this post Link to post Share on other sites
Lucky Phil 6 Posted Monday at 09:37 AM Terrific stuff... very nicely done! From a novice point of view, it's great to see what can still be achieved in BASIC - without diving head-first into assembly language. I guess that the relatively fast clock rate and sophisticated code (as opposed to what were on offer in the beloved, original Commodore 64) negate many of the arguments against developing in BASIC, after all? Quote Share this post Link to post Share on other sites
DusanStrakl 90 Posted Monday at 10:06 PM 12 hours ago, Lucky Phil said: Terrific stuff... very nicely done! From a novice point of view, it's great to see what can still be achieved in BASIC - without diving head-first into assembly language. I guess that the relatively fast clock rate and sophisticated code (as opposed to what were on offer in the beloved, original Commodore 64) negate many of the arguments against developing in BASIC, after all? Thanks Lucky Phil. I agree, Commodore BASIC is not ideal language but then again there is no such thing anyway. I find it very convenient to tinker with, prototype and with some effort and clever coding a lot of fun results can be achieved. 1 Quote Share this post Link to post Share on other sites
Jakebullet70 7 Posted yesterday at 05:45 AM (edited) Would love to see an extended BASIC that can be tucked into one of the ROM banks like say something like DotBASIC: http://dotbasic.cbm8bit.com/about.html Or even the addition of Commodore BASIC V7 commands in ROM somewhere. http://dotbasic.cbm8bit.com/dc.html -- .BASIC command summery. I played with these years ago. Edited yesterday at 05:50 AM by Jakebullet70 Quote Share this post Link to post Share on other sites