Help With Magnitude

tim13211tim13211 Member Posts: 87
edited November -1 in Working with GS (Mac)
Im new to magnitude and vectortoangle but I have a ball flying around on the screen and currently I have it set up so that every 5 seconds a enemy spawns at a random location. When the ball hits the enemy the lives decrease by 1. The problem is that sometimes the enemy is spawned on top of the ball. This is unfair and make the game very difficult. What can I set up that allows the enemy to spawn about 100pixels away from the ball?

Comments

  • DrGlickertDrGlickert Member Posts: 1,135
    You could have a constain attribute on the ball's X and Y position (let me know if you don't know how to do this). Then create a rule in the enemy spawner; Every 5 seconds AND magnitude > 100 from Ball's X/Y then spawn enemy.
  • steve86steve86 Member Posts: 806
    DrGlickert said:
    You could have a constain attribute on the ball's X and Y position (let me know if you don't know how to do this). Then create a rule in the enemy spawner; Every 5 seconds AND magnitude > 100 from Ball's X/Y then spawn enemy.

    The problem with this method Dr. is that when magnitud < 100 you would have to wait 10 seconds for the enemy to appear.. and that could affect gameplay.
  • AppsRacKAppsRacK Member Posts: 346
    You could just add a random x & y (put a limit so it wont go outside the scene)to your main actors constrain position sO it wont miss a spawn time.
  • mlaftamlafta Member Posts: 147
    Create another rule for the mag < 100 so that if rule one is not applied then rule two would.
Sign In or Register to comment.