Skip to content
Snippets Groups Projects
Select Git revision
  • 04411fed28a4ded7ae9773586e1b644d0ada8e19
  • master default protected
2 results

change-passward.js

Blame
  • Wall.java 786 B
    import bagel.Image;
    
    import java.util.ArrayList;
    
    /**
     * Wall Code for SWEN20003 Project 1, Semester 2, 2022
     * <p>
     * Manage walls info.
     * Draw walls.
     * Determine the overlap between player and wall.
     *
     * @JIAXI3
     */
    public class Wall {
        private final Image Img = new Image("res/wall.png");
        private final ArrayList Pos = new ArrayList();
    
        public void Wall() {
        }
    
        public void Update() {
            /*Gets all the wall locations of the ArrayList for drawing*/
            for (int i = 0; i < Pos.size(); i++) {
                bagel.util.Point p = (bagel.util.Point) Pos.get(i);
                Img.drawFromTopLeft(p.x, p.y);
            }
        }
    
        public void Add(int x, int y) {
    
            /*Add the wall position to arraylist*/
            Pos.add(new bagel.util.Point(x, y));
        }
    }