Sparse Invaders: Source

From Retrosoftware

(Difference between revisions)
Jump to: navigation, search
(Source Description)
(Source Description)
Line 66: Line 66:
<tr><td> [[Sparse Invaders Source - Invaders_Baddies.txt|'''Invaders_Baddies.txt''']]</td><td>Setup,draw and control for invaders and mother ship</td></tr>
<tr><td> [[Sparse Invaders Source - Invaders_Baddies.txt|'''Invaders_Baddies.txt''']]</td><td>Setup,draw and control for invaders and mother ship</td></tr>
<tr><td> [[Sparse Invaders Source - Invaders_Bases.txt|'''Invaders_Bases.txt''']]</td><td>Setup, draw and control for the three bases</td></tr>
<tr><td> [[Sparse Invaders Source - Invaders_Bases.txt|'''Invaders_Bases.txt''']]</td><td>Setup, draw and control for the three bases</td></tr>
-
<tr><td>'''Invaders_Bullets.txt'''</td><td>Bullet control.</td></tr>
+
<tr><td> [[Sparse Invaders Source - Invaders_Bullets.txt|'''Invaders_Bullets.txt''']]</td><td>Bullet control.</td></tr>
<tr><td>'''Invaders_Hiscore.txt'''</td><td>Hiscore calculations and display</td></tr>
<tr><td>'''Invaders_Hiscore.txt'''</td><td>Hiscore calculations and display</td></tr>
<tr><td>'''Invaders_Player.txt'''</td><td>Player control</td></tr>
<tr><td>'''Invaders_Player.txt'''</td><td>Player control</td></tr>

Revision as of 14:12, 10 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 * \/ \/ \/ \/ \/

Sparse Invaders v1.0 Source

  • THE SOURCE * /\ /\ /\ /\ /\

Source Description

SourceDescription
Main.txtStarting point, main setup and control loop for game
BlockDrawer.txtBasic Block drawer
Keyboard.txtKeyboard handler
Screen.txtScreen drawing functionality
Sound.txtSound initialization and generation
Timer.txtTimer interrupt
SpriteController.txtSprite Controller (Over complex)
Invaders_Baddies.txtSetup,draw and control for invaders and mother ship
Invaders_Bases.txtSetup, draw and control for the three bases
Invaders_Bullets.txtBullet control.
Invaders_Hiscore.txtHiscore calculations and display
Invaders_Player.txtPlayer 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


Shell Source v1.0 Source


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.