problem switching direction when I create mult enemies in libgdx(box2d) Programming Software Development by hwoarang69 …left senor than move enmey right. I am creating 3 enemies and I am storeing them in arraylist. -------- # Problem…if a enemy switch direction than all of enemies switch directions together. I know why this …// create & store in array list Enemies e1 = new Enemy1(body); Enemies e2 = new Enemy1(body); //problem here… Adding multiple enemies to a platform scroller? Programming Software Development by nola_Coder … problems when trying to drop multiple enemies across the map. I basically made 7 additional enemies and gave them different starting positions… Making data structures for enemies. Programming Software Development by valestrom … no idea how to use it. (File containing values for enemies) Monsterreader: [CODE]#include <iosteam> using namespace std; struct… Re: Making data structures for enemies. Programming Software Development by mrnutty … takeDamage(int damageToTake){ health -= damageToTake; } } //..and so on for other enemies //..and go on from there [/code] Re: Making data structures for enemies. Programming Software Development by valestrom … takeDamage(int damageToTake){ health -= damageToTake; } } //..and so on for other enemies //..and go on from there [/code][/QUOTE] This looks great… Bounding box collision detection with an array of enemies... Programming Software Development by mxa92 … } else { pacmanPos.Y ++; } }[/code] However, I have an array of enemies (munchies) and trying to stop them spawning on top of… Re: Bounding box collision detection with an array of enemies... Programming Software Development by gusano79 [QUOTE=mxa92;1698735]I have an array of enemies (munchies) and trying to stop them spawning on top of … Re: problem switching direction when I create mult enemies in libgdx(box2d) Programming Software Development by JamesCherrill Maybe `wallSwitch` needs to be an attribute (instance variable) of the Enemy class, so each Enemy has it's own value for that variable? Re: problem switching direction when I create mult enemies in libgdx(box2d) Programming Software Development by hwoarang69 order which i am create them. .. = new contectListern(); // has begincontect() & endcontect() .... .. new enemy(); //create enmeies contectListener class class contectListener{ public void beginContact(Contact contact) { ... // Enemy switch direction if (fa.getUserData() != null &… Re: problem switching direction when I create mult enemies in libgdx(box2d) Programming Software Development by hwoarang69 ![cb639e8559f1930831c55d1aaee2aaa3](/attachments/small/3/cb639e8559f1930831c55d1aaee2aaa3.png "align-left") I have upload a image to show. what is the problem. on left side of image, tell what is going on and on last frame both enemy stop. on right side of image, explian those thing are. the enemy(1) is not switching direction. -… Re: problem switching direction when I create mult enemies in libgdx(box2d) Programming Software Development by JamesCherrill It's hard to see what's going on from those fragments, especially because you seem to have reversed the Java conventions for capitalising names. So in line 6 Enemy.wallSwitch = true; what exactly is Enemy and where is it set? It looks like a class name, but the class seems to be named enemy (as if it's a variable) In your move method why do you… Re: Adding multiple enemies to a platform scroller? Programming Software Development by daviddoria This might go better in the Game Development subforum: [url]http://www.daniweb.com/forums/forum71.html[/url] Dave Re: Bounding box collision detection with an array of enemies... Programming Software Development by mxa92 I've just tried that, and I have tried a variation of that in previous attempts; it just seems to keep the munchies constantly re-spawning at the top of the screen as if they're constantly colliding with one another... =S Re: Bounding box collision detection with an array of enemies... Programming Software Development by gusano79 [QUOTE=mxa92;1699087]I've just tried that, and I have tried a variation of that in previous attempts; it just seems to keep the munchies constantly re-spawning at the top of the screen as if they're constantly colliding with one another... =S[/QUOTE] Can you post the new code? Re: Bounding box collision detection with an array of enemies... Programming Software Development by skatamatic [QUOTE=gusano79;1698972]If you want to check for collisions between munchies, one way to do it is to use two loops, along these lines: [CODE]for(int i = 0; i < noOfMunchies - 1; i++) { for(int j = i; j < noOfMunchies; j++) { // Check for collision between munchies i and j here. } }[/CODE] This is a very simple,… Re: Bounding box collision detection with an array of enemies... Programming Software Development by mxa92 [QUOTE=skatamatic;1700511]Just a side note, make sure you don't check for a collision with itself. (ie if i != j then do the check).[/QUOTE] Ah, that got it! Thank you, and thank you gusano79 for the help :) [code]// Munchie colliding with the munchies for (int i = 0; i < noOfMunchies - 1; i++) {… Re: Bounding box collision detection with an array of enemies... Programming Software Development by gusano79 Oh right. Also, instead of this: [CODE]for (int i = 0; i < noOfMunchies - 1; i++) { for (int j = i; j < noOfMunchies; j++) { if (i != j) { [COLOR="Green"]// ...[/COLOR] } } }[/CODE] You can do this: [CODE]for (int i = 0; i < noOfMunchies - 1; i++) { for (int j… Re: Word Association Game Community Center Geeks' Lounge by anupam_smart enemies--> We are not? Help adding a second enemy in pygame Programming Software Development by gmill198 …0, 0)) for count in range(len(enemies)): enemies[count].x += + enemyspeed enemies[count].render() if enemies[len(enemies)-1].x > 590: enemyspeed = …-3 for count in range(len(enemies)): enemies[count].y += 5 if enemies[0].x < 10: enemyspeed = 3 for… XNA Error : No overload for method '' takes '0' arguments Programming Software Development by Robert955 …None, 0); foreach (GameObject enemy in enemies) { if (enemy.alive) { …sprite.Height); foreach (GameObject enemy in enemies) { Rectangle enemyRect = new Rectangle( … C# scrolling game help Programming Game Development by Onion13 … //function handles collision with enemies, player shooting and hitting enemies //enemies hitting player, player touches…} } } void EnemymoveBullet() {//This handles the enemies shooting at player e1laser.Left -= 100; if … Need help Python pygame making pause unpause function Programming Software Development by Traj …#Choose a number of enemies number_of_enemies = 6 #Create and empty list of enemies enemies = [] #Add enemies to the list for….xcor() < -280: #Move all enemies down for e in enemies: y = e.ycor() y -= 40 e… PyGame spcae invaders Programming Software Development by pymatio …time_passed_seconds): down = False for enemy in self.enemies: if(enemy.checkIfOutOfScreen()): down = True break…: enemy.move() for enemy in self.enemies: for bullet in enemy.bullets: bullet.move… Problems with rand() Programming Software Development by totalwar235 …string E_Name; //string E_Name2; srand(time(NULL)); int Enemies = rand() % 8; if((Enemies == 0)||(Enemies == 1)) { E_Number = 1; E_Health = 15;…0; E_DMG = (rand() % 3); E_Name="Zealot"; } if((Enemies == 6)||(Enemies == 7)) { E_Number = 1; E_Health = 35; E_Exp = 1; … HELP : else, if problem Programming Software Development by C++_Beginner …std::string; int main() { const int GOLD = 1200; int ADVENTURERS, ENEMIES, SURVIVORS; string LEADER; // Player Info cout << "Welcome… << "Enter the number of enemies: " ; cin >> ENEMIES; SURVIVORS = ADVENTURERS - ENEMIES; //Telling the story cout << &… XNA - per-pixel collision problem Programming Software Development by Robert955 …None, 0); foreach (GameObject enemy in enemies) { if (enemy.alive) { …sprite.Height); foreach (GameObject enemy in enemies) { Rectangle enemyRect = new Rectangle( … Re: C# scrolling game help Programming Game Development by Onion13 … bouncing all over the screen, show how many enemies the player has killed private void finaletimer_Tick(object sender…(); lblkilled.Text = "" + kills;//shows how many enemies player killed AutoMovePlayer(); } } When the boss dies the player scrolls… Issue with smaller browsers Digital Media UI / UX Design by Hell Bomb …right into Nexon Game code, allowing you to see your enemies and allies anywhere on the map.">-Nexon Chams…;> <div><a title="Prediction lags enemies around you enabeling you to shoot them with easy and… looking advantage or zip around the map gunning down your enemies before they know what hit them.">-Speed Hack… How can I get multiple object at runtime Programming Software Development by vishalonne … an array of all enemies public EnemyShip[] getEnemies() { EnemyShip[] enemies = { enemy1, enemy2, enemy3 }; return enemies; } // You can…int readNumEnemies() { return promptInt("Enter the number of enemies: "); } public EnemyShip createEnemy(int number) { … Tic-Tac-Toe MiniMax AI Alogorithm Programming Software Development by Medalgod … 0; int numberOfFriendlyPositions = 0; //count how many enemies && friendlies are in the 3 cells. … 0; int numberOfFriendlyPositions = 0; //count how many enemies && friendlies are in the 3 cells.…