Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void updateParticles() {
- for (Particle p : particles) {
- p.update();
- // Check if the current particle's y does not yet exist as an index
- // of the array
- // and create a list of Particle at that index, if need be.
- if (checkList[(int) p.getPosy()] == null) {
- checkList[(int) p.getPosy()] = new ArrayList<Particle>();
- }
- // Add the current particle to the array of lists at the index of y.
- checkList[(int) p.getPosy()].add(p);
- checkForColision(p);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment