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.

Newcomers AppGameKit Corner / Is There Any Easy Way To Initialize A 2 Dimensional Array??

Author
Message
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 8th May 2017 04:23
Hi,

The documentation does not show an easy way to setup values of a 2 dimensional array?
We are using 2-D array for the game's playfield and map systems.

Here is what we tried but it won't compile:


Any help would be appreciated, thank you!
JeZxLee
16BitSoft Inc.
Video Game Design Studio
http://www.16BitSoft.com
Open-Source AppGameKit2 Project!
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 8th May 2017 06:10 Edited at: 8th May 2017 06:11
Like this

I have requested the ability to initialize multi dimensional arrays and arrays of types. If you do too it might help.

You may even want to separate that data out to a text file and load it into the array from there
JLMoondog
Moderator
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location: Paradox
Posted: 8th May 2017 07:58 Edited at: 8th May 2017 07:58
I was just about to suggest having a level text file loaded in and build a loadmap() function. Trust me, when you start to reach 1000+ levels, you'll be thanking us.

Just ask if you need an example, and I can post a revision of my own personal 2d map array loader.

Login to post a reply

Server time is: 2024-11-22 03:24:26
Your offset time is: 2024-11-22 03:24:26