![]() |
creating array variables like the built-in ones
What if we could make variables that are set up like players[].x/y/dir/hearts/soon? This would make so many things so much easier. Instead of looping through all of the npcs or players looking for something that must be in common for player-made bombs or such. We could just loop through the correct array variable. It could used with the putnpc command, and work the same as in java. You would put the variables of an npc in the .txt file and you could access them through filename[index].variable. For instance, a new bomb;
newbomb.txt- NPC Code: the x and y would be automatic, since they are set when you put the npc. then lets say that you want to do something with the bomb, no problem! Just access the bomb's variables; newbombscount newbombs[index].x newbombs[index].y newbombs[index].fuse newbombs[index].radius and go to town! |
Basically custom classes, right? I wish we could have them too (coding a 3D engine without them gets complicated >_<).
|
All times are GMT +2. The time now is 08:25 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.