Jump to content
  • Advertisement
Sign in to follow this  

Help making a Tile Based Scrolling Map

This topic is 4036 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
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
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!