Hi Johnno,
You sound overwhelmed, relax I don't think Terry is going to get involved with external libraries but aren't you the one who keeps asking for tutorials? Terry would be great.
Target frame is only the show # image we want to display at the end of the dice roll, the face number for the roll.
Collision and bounce we've not done yet but it's the same as any particle code, you've been there before. You even posted great collision code for rectangles that I saved for future reference.
TYPE is no mystery, instead of ballX() ballY() ballColor() 3 arrays for each character of ball, such that ballX(10), ballY(10) ballColor(10) describe ball 10.
With Type you can do a setup like this:
Type ballType
x as integer
y as integer
kolor as _unsigned long '< best type for colors
end type
Dim ball(nBalls) as BallType
This sets up an array that includes all the type definitions for one object, instead of 3 separate but related arrays, you have this one that groups them together.
Now ball 10 looks like this:
ball(10).x
ball(10).y
ball(10).kolor
Type just adds a .thing and embeds a () for the index number of the array. It is just the same as ballX(10) ballY(10) ballKolor(10), instead of needing 3 arrays you just use one to cover all the ball characteristics
In QB64, everything has a type (well in any PL everything has a type but some PL's leave it under the hood (SmallBASIC, SdlBasic..) more than others Naalaa and QB64 gives like 16 options for type of one variable.)
Here is my cheat sheet for Types, don't leave home without it:
Append: This is better and more complete of course but not quite at your fingertips (I typed my Type sheet out on Printer).
http://qb64.org/wiki/Variable_TypesI left out Memory stuff and forgot to mention fixed string types on my cheat sheet.
So in summary, all the variables have a Type and a TYPE definition groups several variables of different types (or the same) into an object or record. These can be dimensioned singly or in arrays like other variable types.
Lecture over, quiz on Friday. ;)
PS For a crash course on learning type, put OPTION _EXPLICIT at the top of your code then you will learn your number one bug is getting a variable DIM 'd but it will save you from those pesky less easy to find bugs caused by misspelling. It will also be quizzing you automatically about what type you want or at least have you thinking what type you really need.