|
-
Feb 10th, 2012, 02:37 PM
#1
Thread Starter
Junior Member
Moving through arrays, selecting certain rows and columns.
Hello, it's me again!
I'm slowly making progress on my terrible game!
If you havn't seen any of my previous posts here is the low-down:
100 tiles are created automatically on form load, names tile1 to tile 100
Array is loaded from a textfile of 10,10 (not stored as a 10,10 just parsed from line to line, which I feel needs to be changed asap)
Each tile is then given a corresponding graphic (e.g. grass, water, lava) and soon hopefully I will add interaction with certain tiles
There is also a simple hero that moves about from tile to tile (not in the array, just physically placed on top of each tile)
Now. If at all possible, I wish to be able to write bigger arrays, like as big as need be and when the character moves to the right, the tiles in the far left column will disappear and a new set will move in from the right
There will always be 100 tiles on the screen.
example, the ones in bold are visible to the player, the others would be visible if the player moved in their direction!
Code:
1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,3,3,3,1,1,1
Here is my current code...
I'm thinking I might need to put it in the character movement part of the code with the key listeners...
http://pastebin.com/ACC99X2N
Thankyou for reading
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|