soulwire / Coffee-Physics

A simple, lightweight physics engine written in CoffeeScript
MIT License
1.06k stars 89 forks source link

Collision Behaviour Index Out of bounds bug #5

Closed grahamjenson closed 12 years ago

grahamjenson commented 12 years ago

For some reason the index passed into Collision behaviour was the length of the array causing an error. This is due to CoffeeScript [3..2] equalling an array [3,2]. To solve this I used arrayslicing, see code below.

     # Check pool for collisions.

- for i in [index..@pool.length - 1]

- o = @pool[i]

PS. Great library.

soulwire commented 12 years ago

Thanks for the ticket, should be fixed now :)