Tutorial 1 Part 1
Right, we'll start with the basics. In this tutorial we will create a project which will put a sprite on the screen. Very simple!
Start by downloading this
zip file (21kb).
Create a new directory on your hard drive and extract the two files into this
directory.
Start up DXC and select "New project workspace" from the file menu. Create the project in the same directory as the one you created above. You will now have a new project with a blank editor and empty banks window.
Right-click on the banks window and select Create New -> Image (BMP).
Select "background.bmp" and click "Open". The background image will now be added to the banks window. You should see a thumbnail and some information about the image.
Right-click on the banks window again and create another new image. Select "walking man.bmp". The sprite sheet should be added to the banks window.
Right-click on the banks window and this time select Create New -> Sequence (SEQ). The Sequence editor will appear which we will use to create an animation sequence. Click on the sprite sheet on the left and enter these numbers into the fields on the right: Sprite X = 64 (the width of each frame), Sprite Y = 64 (the height of each frame), Sprite Count = 30 (there are 30 frames in total), X Count = 10 (there are 10 frames on each line in the sprite sheet). Select "Test" to see the animation.
You should now have 3 banks in your program. Now enter the code below or copy and paste this
text file into the editor. The best way to do this is to right-click on this link, select "Save Target As", download the text file and then open it in Notepad.
Global KEYPRESS$
DefProc INIT_DISPLAY()
DefProc CREATE_SPRITES()
INIT_DISPLAY() 2
CREATE_SPRITES()
Repeat 3
KEYPRESS$ = Inkey$()
Update Display
Until KEYPRESS$ > ""
Procedure INIT_DISPLAY() 4
Create Map 640,480,1,1 In Bank 50
Set Tile 0,0,1 Using Bank 50
Create Plane 1 Using Bank 50
Set Bitmap 2 Transparency To 255,255,255
EndProc
Procedure CREATE_SPRITES() 5
Create Sprite 1,288,208 Using Bank 3
Sprite On 1
Sprites On
EndProc
EndProg
|