View Single Post
  #7  
Old 12-04-2008, 12:13 PM
Pelikano Pelikano is offline
Registered User
Pelikano's Avatar
Join Date: Oct 2008
Posts: 1,133
Pelikano has a little shameless behaviour in the past
Quote:
Originally Posted by xXziroXx View Post
PHP Code:
for (temp.i = 0; temp.i < 2; temp.i++) {
  for (
temp.obj: i ? npcs : players) {
    if (
this.x in |obj.x, obj.x + 3| && this.y in |obj.y, obj.y+ 3|) {
      
//hit stuff
    
}
  }
} 
There, now you have a loop for both players and NPC's.
Why would I need a loop for the player and for the Projectile?
o_O
Reply With Quote