Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / how to make a map

Author
Message
Mark532011
8
Years of Service
User Offline
Joined: 27th Jun 2016
Playing: X-Com, WOW-Legion
Posted: 3rd Aug 2016 19:52
one of the options I would like to do is display a map of the world. It isn't a static map so a pre-generated bitmap won't work.

I'm thinking of defining a few small sprites (5x5 pixels) to represent the various landscape items (trees, mountains, grass, etc.) then placing them in a grid and using GetImage to generate the bitmap that can be displayed.
However, for a 100x100 map, I would need to make 10,000 sprites, do the GetImage, then delete them all. I think it will work (I haven't tried it) but it seems like there should be a better way, am I missing a command for something like this?
Mark
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 3rd Aug 2016 21:26
This is a tile-based game
You shouldn't getImage(), it is better to display the onscreen map as tiles.
If a tile isn't on the screen. don't display it.
So as you move right, you remove tiles from the left as they disappear, and add them on the right as they come into view.
Theoretically you can have an infinite world.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Mark532011
8
Years of Service
User Offline
Joined: 27th Jun 2016
Playing: X-Com, WOW-Legion
Posted: 3rd Aug 2016 22:08
So if you were doing something like the attached screenshot which looks to be a 30x21 tileset. You would create 630 sprites and show them on the screen in a static background image behind the player sprite?

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-09-29 17:29:42
Your offset time is: 2024-09-29 17:29:42