Sign in to follow this  
Jazonxyz

Help making a Tile Based Scrolling Map

Recommended Posts

Jazonxyz    138
Im trying to make a tile-based scrolling map but my compiler wont compile it Here is the source-code of the area with the bugs: Test.Tiles[250] = { 16, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 17, 23, 26, 26, 26, 26, 27, 26, 26, 26, 31, 28, 28, 28, 28, 32, 21, 23, 26, 24, 26, 26, 26, 26, 26, 26, 29, 54, 53, 55, 27, 29, 21, 23, 26, 26, 26, 26, 26, 26, 15, 26, 29, 48, 43, 47, 24, 29, 21, 23, 26, 26, 26, 26, 24, 26, 6, 26, 34, 40, 15, 26, 41, 33, 21, 23, 26, 24, 26, 26, 26, 26, 6, 26, 26, 26, 6, 26, 26, 26, 21, 23, 26, 26, 26, 27, 26, 26, 6, 26, 26, 26, 6, 26, 26, 26, 21, 23, 26, 26, 26, 26, 26, 24, 10, 5, 5, 5, 3, 26, 27, 26, 21, 23, 26, 27, 26, 26, 26, 26, 6, 26, 26, 26, 26, 27, 26, 26, 21, 23, 26, 14, 5, 5, 5, 5, 3, 26, 26, 26, 26, 26, 26, 26, 21, 23, 26, 26, 26, 27, 26, 26, 26, 26, 26, 27, 26, 26, 27, 26, 21, 19, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 18 }; My compiler gets an error in the first and last line of this code. How can I fix it?

Share this post


Link to post
Share on other sites
blaze02    100
Need more info, I think you are trying to create a 250 element array. If you want an array of int's, try:
int NewTiles = {
16, 20, 20....
...
...
};


Basically, the array needs a type and "Test.Tiles" is not a type.

If you need more help, post some more info. What types are everything, what are the compiler errors you are getting, etc.

Edit: oops, NewTiles[250]

[Edited by - blaze02 on May 5, 2007 3:02:56 PM]

Share this post


Link to post
Share on other sites
Sc4Freak    643
This is unrelated to DirectX. This should probably be moved to Game Programming.

Anyway, you can't initialise data like that. If Test is a structure, and Tiles is a 250-element array in Test, then the [250] isn't needed. Second, you can't initialise data like that. IIRC you can only do that when you declare and define at the same time.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this