-
" So Enemy[] or Enemy[,] is just an array that can hold objects of type Enemy " So i was correct on that part. as i said : " Instead, a new array is made where an object (an instance of the class Enemy) can be stored in. So It doesn't load anything that goes into the constructor of the class Enemy, [it just creates an array that only
-
...Now im confused again. Let me ask it differently. Enemy[,] and Enemy(); Are these calling on the same Class. Or is Enemy[,] just a new Array that got nothing to do with the class Enemy? As you said its just a name, so instead of Enemy[,] I could also use EnemyGrid[,]? and it would still work? Also i understand how new objects are being made, but
-
Uhm i think you still misunderstand my question, LoL=P.( Could be my fault though =) ) So let me get this straight: I understand it loads the Enemy objects into the grid in the forloop. But now looking at " Enemy[,] " it doesn't call the constructor of the class Enemy. Instead a new array is made where an object (an instance of the class
-
Sorry i think i asked the question wrong. As we are using the class Enemy to make a new grid, shouldnt this grid on its own be loading his own batch of sprites since we are saying; enemies = new Enemy[ etc etc]; In the constructor of the Enemy class we load the sprites, am i correct? It creates a new Enemy object on that spot? OR is Enemy[,] entirely
-
Ok i get that part now. But then, shouldnt this grid load the enemy sprites as well? Since we use the class "Enemy" ? Aaand thanks again.
-
Thanks for your reply, Actually now i'm more confused as i still don't understand where [,] comes from. Is it a C# standard? But isn't "Enemy" a class on its own? How is it possible for an existing class to be turned into an 2D array?.. Few lines further it says enemies[y,x] = enemy. I understand that y and x are int's comming
-
Hi there, I'm new here, apparently... I'm currently working my way up in the AlienAttack game to make the grid for the enemies. Now i have been doing some programming before but in AS3. It doesn't look too different, so its great getting to know C# with such book.(even though i know its not meant to teach one the whole syntax, ins and outs