13 years ago

Introduction


Welcome to a programming tutorial blog that I hope is a little different from any other you’ve come across. Instead of just telling you about software design and games programming, it makes you get involved. There’s plenty of work for you to do since the blog will be full of exercises.

Learn by Doing

The only way to become a programming expert is to practice. No one ever learned any skill by just reading about it! Hence, this blog is not one where you can just sit back in a passive way and read from beginning to end whilst sitting in your favourite chair. Rather it is designed as a teaching package in which you will do most of the work.

The tasks embedded throughout the blog are included to test your understanding of what has gone before and as a method of helping you retain the knowledge you have gained. It is therefore important that you tackle each task as you come to it. Also, many of the programming exercises are referred to, or expanded, in later tutorials so it is important that you are familar with the code concerned.

What You Need


You’ll obviously need a PC, and a copy of DarkBASIC Pro.

You don’t need any experience of programming, but knowing your bits from your bytes and understanding binary and hexadecimal number systems would be useful.

DarkBASIC Pro is a free program that may be downloaded from: http://www.thegamecreators.com/?m=view_product&id=2000

How to Get the Most out of these Tutorials


Experience has shown that readers derive most benefit from this type of material by approaching its study in an organised way. The following strategy for study is highly recommended:

  1. Read a tutorial or section without taking notes or worrying too much about topics that are not immediately clear to you. This will give you an overview of the contents of that tutorial/section.

  2. Re-read the chapter. This time take things slowly; make notes and summaries of the material you are reading (even if you understand the material, making notes helps to retain the facts in your long-term memory); re-read any parts you are unclear about.

  3. Embedded in the material are a series of activities. Do each task as you reach it (on the second reading). These activities are designed to test your knowledge and understanding of what has gone before. Do not be tempted to skip over them, promise to come back to them later, or to make only a half-hearted attempt at tackling them.

  4. As you progress through these tutorials, go back and re-read earlier blogs, since you will often get something new from them as your knowledge increases.

Language Syntax Diagrams


The text contains many syntax diagrams which give a visual representation of the format of various statements allowed in DarkBASIC Professional. These diagrams make no attempt to be complete, but merely act as a guide to the format most likely to be used. The acompanying text and example should highlight the more complex options available. Below is a typical diagram:

5d0c791e7e928.png

Each tile in the diagram holds a token of the statement. Raised tiles represent fixed terms in the statement, which must be entered exactly as shown. Sunken tiles represent tokens whose exact value is decided by you, the programmer, but again these values must conform to some standard rule.

Items enclosed in brackets may be omitted if not required. In this example we can see the ELSE and all the terms that follow may be omitted.

Where one or more tokens in a diagram may be repeated indefinitely, this is shown using the arrowed line. This example shows that any number of statements can be used so long as a colon appears between each statement.

Occasionally, a single line of code will have to be printed over two or more lines because of width restrictions; these lines are signified by a >>>> symbol. Enter these lines without a break when testing any of the programs in which they are used. For example, the code

*sprite crosshairs, (joystick x()+1000)xpixels#,**

*>>>>(joystick y()+1000)ypixels#,1**


should be entered as a single line.



0 comments

Loading...

Next up

This Satuday we invite to watch another #speedpainting of our artist Daniel Faiad.

How great is this scene of #Pecaminosa?

#ScreenShotSaturday | #IndieDev | #DigitalArt

Werehog transformation process. #sonicunleashed

Family band complete!

Rockin the Guitar, an Axe like Guitar I made for my Uni project

Today I tackled drawing different variations of facial expressions for one of the main characters in Eden. What do you think of it? :) Eden: https://gamejolt.com/games/Eden/592698

Very ambitious construction going on in Planet Zoo on Plays today. We're tryin'. LIVE: www.twitch.tv/dreamhackplays

My D&D art for my family so far (WIP if you couldn't tell)

Only true badasses may pass! #conceptart #art #gamedesign

Distrust - HUMERUS (with dirty shade) Papyrus isn`t small. It's possible that I didn't draw him well, but he crouched down and bent towards us. I'm still bad at moments like this