read array

Blitz3D Forums/Blitz3D Programming/read array

Rook Zimbabwe(Posted 2004) [#1]
HI all...

OK I am a little cornfused!

I created an array called ova(80,30)
I filled it with 0's to make sure all was filled

Thirty times I randomly created a location and filled that location in the array with 1's

Now I want to read the array and place an image on the screen where the 1's are.

How do I read the array. The DIM statement text is no help. In Qbasic I think I used to just READ ova(x,y) but the READ commands here do not mention arrays.

What am I dong wrong?
-RZ


Gabriel(Posted 2004) [#2]
You just reference it. Eg:

If ova(x,y)=1 then DrawImage image,x,y


or whatever.

By the way, just flicking through your code, I can see that you're not always going to place exactly thirty 1's in the array of zeroes. You're not checking to see if there is already a one in the slot before making it one. In some cases, you will store a 1 there, then come back and make it one again, and you'll have only 29 on screen.


SoggyP(Posted 2004) [#3]
Hi Folks,

Is this game really about what I think it is?

Later,

Jes


Rook Zimbabwe(Posted 2004) [#4]
Nope... just preoccupied with getting the wife in the family way...

10 sin
20 there is no hell... it is a lie fostered on the people to force them to be religous
30 live free and DON'T tell other people how to live!

-RZ