====== Tutorial 1: TETRIS ====== This tutorial will guide you in writing a simple Tetris game in **XC=BASIC**. The game is relatively easy to implement and I think it is going to be a good start to get you started. ===== Index ===== * [[tutorial1-tetris:step1|Step 1: Setting up the development environment]] * [[tutorial1-tetris:step2|Step 2: Planning the game]] * [[tutorial1-tetris:step2.1|Step 2.1: Designing the screen]] * [[tutorial1-tetris:step2.2|Step 2.2: Designing the shapes]] * [[tutorial1-tetris:step2.3|Step 2.3: Designing the playfield]] * [[tutorial1-tetris:step2.4|Step 2.4: Planning the program flow]] * [[tutorial1-tetris:step3|Step 3: Coding]] * [[tutorial1-tetris:step3.1|Step 3.1: Defining data and variables]] * [[tutorial1-tetris:step3.2|Step 3.2: Coding the routines]] * [[tutorial1-tetris:step3.2.1|Step 3.2.1: Finding a shape]] * [[tutorial1-tetris:step_3.2.2|Step 3.2.2: Testing if piece overlaps]] * [[tutorial1-tetris:step_3.2.3|Step 3.2.3: Drawing a piece]] * [[tutorial1-tetris:step_3.2.4|Step 3.2.4: Locking a piece]] * [[tutorial1-tetris:step_3.2.5|Step 3.2.5: Clearing a row]] * [[tutorial1-tetris:step3.3|Step 3.3: Coding the loops]] * [[tutorial1-tetris:step_3.3.1|Step 3.3.1: The update loop]] * [[tutorial1-tetris:step_3.3.2|Step 3.3.2: Checking how far we've got]] * [[tutorial1-tetris:step_3.3.3|Step 3.3.3: The game loop]] * [[tutorial1-tetris:step_3.3.4|Step 3.3.4: The program loop]] ===== Prerequisites ===== I will try to explain most of the things as detailed as I can but there are some assumptions I'm making: * I assume you know the Commodore BASIC (CBM BASIC or BASIC V2) programming language. I'll only explain commands that are different in XC=BASIC or don't exist in CBM BASIC. * You're familiar with the Screen RAM and Color RAM. * You understand bitwise operations OR, AND, XOR. * You're okay with binary and hexadecimal numbers. If you need to refresh your memory, I suggest you to refer to the [[https://archive.org/details/c64-programmer-ref|Commodore 64 Programmer's Reference Guide]]. ===== About the author ===== {{:tutorial1-tetris:2019-09-13.jpg?nolink&70 |}} My name is Csaba (IPA: [ˈt͡ʃɒbɒ]) Fekete and I'm the author of XC=BASIC. If you have any questions or suggestions feel free to email me to feketecsaba (at) gmail (dot) com or mention @xc_basic in your tweet. If you like what I do, [[https://ko-fi.com/S6S613XO0|consider supporting me on Ko-fi]]! Thanks for reading! <- ^ start|Tetris tutorial ^ step1|Next page ->