At 5/14/08 02:17 AM, ElDebugger wrote:
LCurtis, my post wasn't for you. It was for the original author of the post. If you have something to say about my suggestion, you can PM me directly and I will deal with you there.
Hello and welcome to a public forum :D. Your post was clearly at the OP. However, a forum is used for discussion. You made a post and I discussed. I wont bother PMing you about the topic since that would defeat the purpose of the topic.
I know that putting AS on a movieclip is a bad practice
And yet you suggest it anyway. We are here to help people and you dont do them any justice steering them down the wrong paths.
but for a situation where AI is needed, I opt for embedding it into the object that uses the AI.
I agree, an object orient solution would be best here. However you instructed him to do it in the wrong way. And more to the point, he asked about for loops and arrays.
sounds a lot easier to deal with than to setup an array
Welcome also to programming. Things often sound easier to start with but end up more trouble than they are worth.
that has to check each duplicated MC, despite whatever emotional attachment using arrays dictates to a person (LCurtis)
Passive aggressive attacks help no one D:
There is no "irony" in the statement above my original one. The author of the post did not specify the design of his game and how the parts interact, without mentioning code. A basic idea behind the workings of each game object helps as a good starting point to suggest an approach for coding the game. LCurtis thought that doing so implies that the author is simply asking for a reader to code said game idea to "copy and paste" (I never mentioned offering such code).
Please dont put words in my mouth. I said usually when people give a description of how they want their code to perform someone (with good intentions) jumps in and posts the required code (more or less) because they are eager to show their skills (usually people new to AS). I didnt mean to insinuate that you would do this but someone probably would.
LCurtis is angry and in the mood for some red meat this evening. I am so delighted to hear it!
I'm not angry. I would waste emotions on an online forum :D
Personally, I think the OP should either create a system for dealing with each object and running tests on it or design a class that specifically handles its own movement. However I prefer the former since each movieclip will need a reference to the other movieclips that it wishes to hitTest against. This is were the single array and double for loops shine.
Every frame you run a doubled up for loop like I posted above that checks for collision between each MC.
Since ElDebugger is feeling randy tonight, maybe he would like to post psuedo code of how he would implement his system?
PS you are allowed to respond to me directly instead of in the third person!