Oo, exciting stuff - Can't wait for this! - Free or Purchase, I'll be at the front of the queue to be able to develop in OSX rather than having to switch to XP via parallels (back and forth, back and forth, repeat.....)
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuQuote
Some sort of mesh Batching command would be a great addition in GLBasic
Quote
the limit of allocated memory is 600 kB?
// our missile type - a simple x, y coordinate
TYPE oneMissile
x%
y%
ENDTYPE
// next we create two global variables so we can use them throughout our program (in functions for example).
// defineMissile is simply so we can define each missile easily
// allMissiles is an array of each missile we create
GLOBAL defineMissile as oneMissile
GLOBAL allMissiles[] as oneMissile
// this creates 100 missiles at random x,y locations
FOR counter = 1 to 100
defineMissile.x = rnd(640)
defineMissile.y = rnd(480)
DIMPUSH allMissiles[], defineMissile // puts the contents of what we defined into our array
NEXT
// now we'll remove any missile from our allMissiles array where x > 500 or y > 300
// FOREACH loops through every element in our allMissiles array. We don't need to know how many items there are.
FOREACH singleMissile IN allMissiles[]
IF singleMissile.x > 500 OR singleMissile.y > 300
DELETE singleMissile
ENDIF
NEXT
// now we'll remove some more missiles at random
// NOTE we use FOREACH because it's A) easy and
// B) most importantly you don't have to keep track of how many missiles you're dealing with.
FOREACH singleMissile IN allMissiles[]
IF rnd(100) > 50
DELETE singleMissile
ENDIF
NEXT