Re: 2 questions in BGT
There goes a map example.
class Map {
uint8[][] tiles;//Using less memory.
uint size_x,size_y;
Map(uint size_x,uint size_y,uint8 base_tile) {
this.size_x=size_x;
this.size_y=size_y;
tile.resize(size_x);
for(uint x=0;x<size_x;x++) tile[x].resize(size_y);
//For now, familliar
set_tile(0,size_x,0,size_y,base_tile);
}
bool set_tile(uint min_x,uint max_x,uint min_y,uint max_y,uint8 type) {
for(uint x=min_x;x<=max_x;x++) {
for(uint y=min_y;y<=max_y;y++) tile[x][y]=type;
}
}
Map@[] maps;
void add_map(uint size_x,uint size_y,uint8 base_tile) {
Map m(size_x,size_y,base_tile);
maps.insert_last(m);
}
And for altering the players map change the pointer on it's class to the new map. Create some kind of exit that when you press enter on it you will be transported to a new map, changing the pointer of the player's current map to the new one. But don't forget to ch
ange sources on the sound pool if you re using it to handle your sounds.
For language packs, split a string by lines with splited=string_split(the_string,"\n",true); and make a for loop on it spliting each element by equal and replacing whats on the message string by the element's result after the equal sign, on that case the first element of the splited string.
_______________________________________________ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector