This site requires JavaScript, please enable it in your browser!
Greenfoot back
danBuonocore

danBuonocore

Stepinac, New Rochelle

danBuonocore's scenarios

play Drag play Maze

danBuonocore's collections

This user has no collections

Recent Comments | Show All

danBuonocore

2012/3/20

Thank you for the suggestions. I completely forgot about the grid size (thanks for the tip), as I do not use Greenfoot that often (just for my computer science class). I was thinking about doing the getIntersectingObjects() method like you said, but (correct me if I'm wrong), testing for the int in the array is much faster. I agree that a double int array would be much more efficient. The reason why I left it as a single array is because this is adapted code I took from an Actionscript Class I wrote several years ago. It was used to create enemies in a side-scrolling shooter game. In order to create the scrolling effect, I iterated through each line in the array at certain time intervals. With a fixed width and varying height (for vertical scroll) it was more efficient to just use a single array. The example my teacher used in class utilized a double array and, therefore, I decided to leave the code as is to delineate another approach. Thanks for the criticisms and if we have to edit our code for the next class I'll definitely take your suggestions(:
you actually sat there and reached level 100....