Sparse Invaders: Source
From Retrosoftware
(→The Shell (stripped bare project for starting that new game) |
(→Source Description) |
||
| Line 62: | Line 62: | ||
<tr><td> [[Sparse Invaders Source - Screen.txt|'''Screen.txt''']]</td><td>Screen drawing functionality</td></tr> | <tr><td> [[Sparse Invaders Source - Screen.txt|'''Screen.txt''']]</td><td>Screen drawing functionality</td></tr> | ||
<tr><td> [[Sparse Invaders Source - Sound.txt|'''Sound.txt''']]</td><td>Sound initialization and generation</td></tr> | <tr><td> [[Sparse Invaders Source - Sound.txt|'''Sound.txt''']]</td><td>Sound initialization and generation</td></tr> | ||
| - | <tr><td>'''Timer.txt'''</td><td>Timer interrupt</td></tr> | + | <tr><td> [[Sparse Invaders Soruce - Timer.txt|'''Timer.txt''']]</td><td>Timer interrupt</td></tr> |
<tr><td>'''SpriteController.txt'''</td><td>Sprite Controller (Over complex)</td></tr> | <tr><td>'''SpriteController.txt'''</td><td>Sprite Controller (Over complex)</td></tr> | ||
<tr><td>'''Invaders_Baddies.txt'''</td><td>Setup,draw and control for invaders and mother ship</td></tr> | <tr><td>'''Invaders_Baddies.txt'''</td><td>Setup,draw and control for invaders and mother ship</td></tr> | ||
| Line 80: | Line 80: | ||
<tr><td> '''LICENSE ''' </td><td>GPLv3 - Please read.</td></tr> | <tr><td> '''LICENSE ''' </td><td>GPLv3 - Please read.</td></tr> | ||
</table> | </table> | ||
| - | |||
== The Shell (stripped bare project for starting that new game) == | == The Shell (stripped bare project for starting that new game) == | ||
Revision as of 17:39, 9 November 2009
Contents |
Sparse Invaders : Source Breakdown
Introduction
Haven't not developed on the Beeb, I thought it was about time. Within a matter of minutes I had a document containing the 6502 instruction set , SWIFT installed with P65 and I was watching the videos supplied by Steve. Thus 'sparse invaders' was born.
To develop a game or application on the Beeb, the following knowledge is needed:
1. The idea - as in the game or app you want to develop! 2. Patience!
All else can be learnt, by reading and also asking questions. That's what I did, as I'm sure a lot on the forum will agree! Please do not be put off by the fact that it's 6502 assembler.
From my experience the only other assembler as easy as the 6502 is the 8080 (this is from memory as I last did that in 1984). It has limited register and instruction set, simple to pick up - however it does enable you to do some pretty wonderful stuff on the BBC B. I only need one example, ELite!
Tools for this development -
1 Swift [add link] 2 Beebem [add link]
Swift is perfect for starting your first project. It contains project management, text editor for the source, graphic editor for the sprites and with a simple click on an icon - it will build your app and create the disk THEN launch the BBC B emulator so you can see it playing.
How EASY is that!!
Going back to Sparse Invaders, I picked Space Invaders as my game of choice, as to be honest it's a simple game to write, but not that simple as to not supply a little challenge while writing it.
Final thought, when developing, as long as you understand what you need to code, it's fun. If you have any confusion then it's time out to comtemplate the problem and discuss the issue.
Programming on the BBC should be fun!!
Summary of the source
Sparse Invaders is not optimised. That said, I used techniques in drawing the invaders that allows the game to run very smoothly. However the source code has been left as is, to enable better understanding of what is going on.
I will add the complete source at some point within the next few days, at present I am going through the files giving a brief summary to what is actually happening. I'll try and explain the techniques used and the reasons why.
Please note that this online source breakdown is useful reading, however viewing the source in Swift adds colour and correct tabbing etc making it far more pleasing to the eye! :-)
Any questions please ask away on the forum.
Sparse Invaders Source Files
The Source Zip
At Last the source is here! Once you have Swift setup, just open the Sparse Invaders and ENJOY!
- THE SOURCE * \/ \/ \/ \/ \/
- THE SOURCE * /\ /\ /\ /\ /\
Source Description
| Source | Description |
|---|---|
| Main.txt | Starting point, main setup and control loop for game |
| BlockDrawer.txt | Basic Block drawer |
| Keyboard.txt | Keyboard handler |
| Screen.txt | Screen drawing functionality |
| Sound.txt | Sound initialization and generation |
| Timer.txt | Timer interrupt |
| SpriteController.txt | Sprite Controller (Over complex) |
| Invaders_Baddies.txt | Setup,draw and control for invaders and mother ship |
| Invaders_Bases.txt | Setup, draw and control for the three bases |
| Invaders_Bullets.txt | Bullet control. |
| Invaders_Hiscore.txt | Hiscore calculations and display |
| Invaders_Player.txt | Player control |
| Constants.txt | Constants used throughout the game |
| Macros.txt | Macros used throughout the game |
| Blocks.bin | Block sprite collection |
| Boot.bin | Boot txt file - loads main and then runs reloc |
| LookUpTable640.bin | 640 lookup table used for screen navagation. |
| SpriteTest.bin | Main sprites (not really test) |
| Relocate.txt | Small code, loaded into 0x880 to relocate invaders down to 0x900 |
| Beeb-Invaders.swfpj | Swift 4.2.2 (onwards) project file. |
| BeebDisk1.ssd | Build disk image |
| LICENSE | GPLv3 - Please read. |
The Shell (stripped bare project for starting that new game)
UPDATE: THE SHELL
This is the invaders source stripped leaving a basic shell. It does show text display, sprite creation and moving in a good documented effort.
Please download and use the shell to create your game, using Sparse Invader source as a working example.