SlideShare uma empresa Scribd logo
1 de 15
Game Modeling
• Requirement: A game has two teams. Each
  team has soldiers that move in the game area
  and fire at soldiers of opposite team. Each
  team can install watch towers that watches
  over a given area. If enemy solider steps in the
  area that is watched, the soldier at watch
  tower fires at them. Create a software model
  of this game.
Objects
The objects in the system are
• Team
• Soldiers
• Watchtower
• Grid
Team
A team comprises of soldiers and watchtowers.

public class Team {


        private Soldier[] live_soldiers;
        private WatchTower[] wt;
        private String name;

        public Team(Soldier[] s, WatchTower[] wt) {
                 //assign
        }

}
Soldier

A soldier is modeled as an independent thread
that moves as per the directions of player. It
supports operations for moving left, right up and
down the game area. Game area is modeled as
composed of several square grids. A soldier can
move from one grid to another grid. It is assumed
that each grid is of size 10 pixels. Once a solider is
on a grid, the grid object is notified of the same.
Grids (plural) is a helper class for accessing the
grid(singular) object.
Soldier
public class Soldier implements Runnable {

    boolean is_shot;
    int x; // current x coordinate
    int y; // current
    Team t;
    public Soldier(Team t) {
             this.t=t;
    }

    public void run() {
            while (!is_shot) {
                        // move along grids in random/predefined fashion
            }
    }

//other methods on next slide
}
Soldier
public void fire(int x, int y) {
     }

     public void left(int grids) {
             int target_x = x - grids;
             for (int i = x - 1; i >= target_x; i--) {
                              move(i, y);
                              Grid g = Grids.getGrid(i, y);
                              g.notify();
             }
     }

     public void right(int pixels) {

// similar to left

     }

     public void up(int pixels) {

// similar to left
      }
Soldier
public void down(int pixels) {
//similar to left

    }

    public void move(int x, int y) {
            this.x = x;
            this.y = y;
            Graphics.paintSoldier(x * 10, y * 10, 10); // assuming paint soldier
                        // takes bottom left screen pixel coordinate and number of screen pixels
                        // side. Graphic library paints the soldier in that square area by suitably
                        //coloring the pixels.
    }

    public void gotHit() {
            is_shot = true;
    }
Watch Tower
    Watch tower watches over a square area surrounding it.
    Any soldier walking into the square area is shot at by soldier at watchtower.

public class WatchTower {

    int x;
    int y;
    // number of grids for this square area where watch tower watches.
    int side;
    boolean in;
    Team t;

    public WatchTower(int x, int y, int side, Team t) {
           //assign
    }
    // other methods in next slide.
}
Watch Tower
    When watchtower is notified by Grid of an enemy soldier, it calls notfy In, When soldier walks out,
    it calls notify out. When notify in is called, watchtower creates its on thread for firing so that calling
    thread is not blocked.

public void notifyIn(final int x, final int y) {
            in = true;
            Thread t = new Thread() {
                         public void run() {
                                       while (in) {
                                                      fire(x, y);
                                       }

                          }
             };
    }

    public void notifyOut(int x, int y) {
            in = false;
    }
Watch Tower
public void fire(int x, int y) {

   }

   public void registerWatchtowerWithGrids() {
       Grid[] gA = Grids.getGrid(x, y, side);
       for (int i = 0; i < gA.length; i++) {
               Grid g = gA[i];
               g.registerWatchTower(this);
       }
   }
Grid
Game area is divided into square grids.
Grids observe if a soldier is over its square and notify monitoring
   watchtowers.

   public class Grid {

   // coordinate for pixel
   int x;
   int y;
   List<WatchTower> l = new ArrayList<WatchTower>();

   public void grid(int x, int y) {

   }
Grid
public void registerWatchTower(WatchTower w) {
              l.add(w);
     }

    public void NotifyIn() {
            for (int i = 0; i < l.size(); i++) {
                             WatchTower w = l.get(i);
                                              w.notifyIn(x, y);
            }

    }

    public void NotifyOut() {
            for (int i = 0; i < l.size(); i++) {
                             WatchTower w = l.get(i);
                             w.notifyOut(x, y);
            }

    }
Grids
Assuming area to rectangular, let x be number
of grids length wise and y be number of grids
breadth wise.
Another assumption is that each grid side has
10 screen pixels. So application grid (1,1) will
have (10,10) as pixel coordinate at its bottom-
left.
Grids
public class Grids {
    static Grid[][] gA ;
    static {
             int x,y;
             x=y=100;
             gA = new Grid[x][y];

            for(int i=0;i<x;i++) {
                          for(int j=0;j<y;j++){
                                        Grid g = new Grid(i,j);
                                        gA[i][j]=g;
                          }

            }

    }
Grids
public static Grid getGrid(int i, int y) {
      //implementation
  }

  public static Grid[] getGrid(int x, int y, int side)
  {
     //implementation
  }

Mais conteúdo relacionado

Mais procurados

Derivatives Lesson Oct 14
Derivatives Lesson  Oct 14Derivatives Lesson  Oct 14
Derivatives Lesson Oct 14
ingroy
 
Lesson 8: Basic Differentiation Rules
Lesson 8: Basic Differentiation RulesLesson 8: Basic Differentiation Rules
Lesson 8: Basic Differentiation Rules
Matthew Leingang
 
Cursor implementation
Cursor implementationCursor implementation
Cursor implementation
vicky201
 
Lesson 28: The Fundamental Theorem of Calculus
Lesson 28: The Fundamental Theorem of CalculusLesson 28: The Fundamental Theorem of Calculus
Lesson 28: The Fundamental Theorem of Calculus
Matthew Leingang
 

Mais procurados (20)

Basics of Computer graphics lab
Basics of Computer graphics labBasics of Computer graphics lab
Basics of Computer graphics lab
 
25 Years of C++ History Flashed in Front of My Eyes
25 Years of C++ History Flashed in Front of My Eyes25 Years of C++ History Flashed in Front of My Eyes
25 Years of C++ History Flashed in Front of My Eyes
 
Lesson 8: Basic Differentiation Rules
Lesson 8: Basic Differentiation RulesLesson 8: Basic Differentiation Rules
Lesson 8: Basic Differentiation Rules
 
Derivatives Lesson Oct 14
Derivatives Lesson  Oct 14Derivatives Lesson  Oct 14
Derivatives Lesson Oct 14
 
Lesson 8: Basic Differentiation Rules
Lesson 8: Basic Differentiation RulesLesson 8: Basic Differentiation Rules
Lesson 8: Basic Differentiation Rules
 
Graphics practical lab manual
Graphics practical lab manualGraphics practical lab manual
Graphics practical lab manual
 
Lesson 8: Basic Differentiation Rules
Lesson 8: Basic Differentiation RulesLesson 8: Basic Differentiation Rules
Lesson 8: Basic Differentiation Rules
 
Program implementation and testing
Program implementation and testingProgram implementation and testing
Program implementation and testing
 
Lesson 8: Basic Differentiation Rules
Lesson 8: Basic Differentiation RulesLesson 8: Basic Differentiation Rules
Lesson 8: Basic Differentiation Rules
 
Ch01 basic concepts_nosoluiton
Ch01 basic concepts_nosoluitonCh01 basic concepts_nosoluiton
Ch01 basic concepts_nosoluiton
 
Lesson 30: The Definite Integral
Lesson 30: The  Definite  IntegralLesson 30: The  Definite  Integral
Lesson 30: The Definite Integral
 
Kristhyan kurtlazartezubia evidencia1-metodosnumericos
Kristhyan kurtlazartezubia evidencia1-metodosnumericosKristhyan kurtlazartezubia evidencia1-metodosnumericos
Kristhyan kurtlazartezubia evidencia1-metodosnumericos
 
Cursor implementation
Cursor implementationCursor implementation
Cursor implementation
 
COMPUTER GRAPHICS LAB MANUAL
COMPUTER GRAPHICS LAB MANUALCOMPUTER GRAPHICS LAB MANUAL
COMPUTER GRAPHICS LAB MANUAL
 
SA09 Realtime education
SA09 Realtime educationSA09 Realtime education
SA09 Realtime education
 
Lesson 28: The Fundamental Theorem of Calculus
Lesson 28: The Fundamental Theorem of CalculusLesson 28: The Fundamental Theorem of Calculus
Lesson 28: The Fundamental Theorem of Calculus
 
Standar kompetensi kelas x sk2
Standar kompetensi kelas x sk2Standar kompetensi kelas x sk2
Standar kompetensi kelas x sk2
 
Computer graphics
Computer graphics   Computer graphics
Computer graphics
 
Adobe AIR: Stage3D and AGAL
Adobe AIR: Stage3D and AGALAdobe AIR: Stage3D and AGAL
Adobe AIR: Stage3D and AGAL
 
Gate-Cs 2006
Gate-Cs 2006Gate-Cs 2006
Gate-Cs 2006
 

Semelhante a Game modeling

import java.util.Scanner;public class Main {    public static in.pdf
import java.util.Scanner;public class Main {    public static in.pdfimport java.util.Scanner;public class Main {    public static in.pdf
import java.util.Scanner;public class Main {    public static in.pdf
anwarsadath111
 
need help with code I wrote. This code is a maze gui, and i need hel.pdf
need help with code I wrote. This code is a maze gui, and i need hel.pdfneed help with code I wrote. This code is a maze gui, and i need hel.pdf
need help with code I wrote. This code is a maze gui, and i need hel.pdf
arcotstarsports
 
Lec 30.31 - inheritance
Lec 30.31 -  inheritanceLec 30.31 -  inheritance
Lec 30.31 - inheritance
Princess Sam
 
Java applet handouts
Java applet handoutsJava applet handouts
Java applet handouts
iamkim
 
import java.awt.;import java.awt.event.MouseAdaptor;import java.pdf
import java.awt.;import java.awt.event.MouseAdaptor;import java.pdfimport java.awt.;import java.awt.event.MouseAdaptor;import java.pdf
import java.awt.;import java.awt.event.MouseAdaptor;import java.pdf
anyacarpets
 
SaveI need help with this maze gui that I wrote in java, I am tryi.pdf
SaveI need help with this maze gui that I wrote in java, I am tryi.pdfSaveI need help with this maze gui that I wrote in java, I am tryi.pdf
SaveI need help with this maze gui that I wrote in java, I am tryi.pdf
arihantstoneart
 
Import java.awt.; Import acm.program.; Import acm.graphics.;.pdf
Import java.awt.; Import acm.program.; Import acm.graphics.;.pdfImport java.awt.; Import acm.program.; Import acm.graphics.;.pdf
Import java.awt.; Import acm.program.; Import acm.graphics.;.pdf
apexcomputer54
 
Introduction to Computer Graphics using OpenGLCan someone tell me .pdf
Introduction to Computer Graphics using OpenGLCan someone tell me .pdfIntroduction to Computer Graphics using OpenGLCan someone tell me .pdf
Introduction to Computer Graphics using OpenGLCan someone tell me .pdf
fathimafancyjeweller
 
Pointer Events in Canvas
Pointer Events in CanvasPointer Events in Canvas
Pointer Events in Canvas
deanhudson
 
MIDP: Form Custom and Image Items
MIDP: Form Custom and Image ItemsMIDP: Form Custom and Image Items
MIDP: Form Custom and Image Items
Jussi Pohjolainen
 

Semelhante a Game modeling (20)

import java.util.Scanner;public class Main {    public static in.pdf
import java.util.Scanner;public class Main {    public static in.pdfimport java.util.Scanner;public class Main {    public static in.pdf
import java.util.Scanner;public class Main {    public static in.pdf
 
need help with code I wrote. This code is a maze gui, and i need hel.pdf
need help with code I wrote. This code is a maze gui, and i need hel.pdfneed help with code I wrote. This code is a maze gui, and i need hel.pdf
need help with code I wrote. This code is a maze gui, and i need hel.pdf
 
Lec 30.31 - inheritance
Lec 30.31 -  inheritanceLec 30.31 -  inheritance
Lec 30.31 - inheritance
 
Unity programming 1
Unity programming 1Unity programming 1
Unity programming 1
 
662305 LAB12
662305 LAB12662305 LAB12
662305 LAB12
 
Java applet handouts
Java applet handoutsJava applet handouts
Java applet handouts
 
Design pattern - part 3
Design pattern - part 3Design pattern - part 3
Design pattern - part 3
 
Mobile Game and Application with J2ME
Mobile Gameand Application with J2MEMobile Gameand Application with J2ME
Mobile Game and Application with J2ME
 
Mobile Game and Application with J2ME - Collision Detection
Mobile Gameand Application withJ2ME  - Collision DetectionMobile Gameand Application withJ2ME  - Collision Detection
Mobile Game and Application with J2ME - Collision Detection
 
import java.awt.;import java.awt.event.MouseAdaptor;import java.pdf
import java.awt.;import java.awt.event.MouseAdaptor;import java.pdfimport java.awt.;import java.awt.event.MouseAdaptor;import java.pdf
import java.awt.;import java.awt.event.MouseAdaptor;import java.pdf
 
CG OpenGL Shadows + Light + Texture -course 10
CG OpenGL Shadows + Light + Texture -course 10CG OpenGL Shadows + Light + Texture -course 10
CG OpenGL Shadows + Light + Texture -course 10
 
SaveI need help with this maze gui that I wrote in java, I am tryi.pdf
SaveI need help with this maze gui that I wrote in java, I am tryi.pdfSaveI need help with this maze gui that I wrote in java, I am tryi.pdf
SaveI need help with this maze gui that I wrote in java, I am tryi.pdf
 
Flink Forward Berlin 2017: David Rodriguez - The Approximate Filter, Join, an...
Flink Forward Berlin 2017: David Rodriguez - The Approximate Filter, Join, an...Flink Forward Berlin 2017: David Rodriguez - The Approximate Filter, Join, an...
Flink Forward Berlin 2017: David Rodriguez - The Approximate Filter, Join, an...
 
Ocr code
Ocr codeOcr code
Ocr code
 
Import java.awt.; Import acm.program.; Import acm.graphics.;.pdf
Import java.awt.; Import acm.program.; Import acm.graphics.;.pdfImport java.awt.; Import acm.program.; Import acm.graphics.;.pdf
Import java.awt.; Import acm.program.; Import acm.graphics.;.pdf
 
662305 11
662305 11662305 11
662305 11
 
Introduction to Computer Graphics using OpenGLCan someone tell me .pdf
Introduction to Computer Graphics using OpenGLCan someone tell me .pdfIntroduction to Computer Graphics using OpenGLCan someone tell me .pdf
Introduction to Computer Graphics using OpenGLCan someone tell me .pdf
 
Applets
AppletsApplets
Applets
 
Pointer Events in Canvas
Pointer Events in CanvasPointer Events in Canvas
Pointer Events in Canvas
 
MIDP: Form Custom and Image Items
MIDP: Form Custom and Image ItemsMIDP: Form Custom and Image Items
MIDP: Form Custom and Image Items
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

Game modeling

  • 1. Game Modeling • Requirement: A game has two teams. Each team has soldiers that move in the game area and fire at soldiers of opposite team. Each team can install watch towers that watches over a given area. If enemy solider steps in the area that is watched, the soldier at watch tower fires at them. Create a software model of this game.
  • 2. Objects The objects in the system are • Team • Soldiers • Watchtower • Grid
  • 3. Team A team comprises of soldiers and watchtowers. public class Team { private Soldier[] live_soldiers; private WatchTower[] wt; private String name; public Team(Soldier[] s, WatchTower[] wt) { //assign } }
  • 4. Soldier A soldier is modeled as an independent thread that moves as per the directions of player. It supports operations for moving left, right up and down the game area. Game area is modeled as composed of several square grids. A soldier can move from one grid to another grid. It is assumed that each grid is of size 10 pixels. Once a solider is on a grid, the grid object is notified of the same. Grids (plural) is a helper class for accessing the grid(singular) object.
  • 5. Soldier public class Soldier implements Runnable { boolean is_shot; int x; // current x coordinate int y; // current Team t; public Soldier(Team t) { this.t=t; } public void run() { while (!is_shot) { // move along grids in random/predefined fashion } } //other methods on next slide }
  • 6. Soldier public void fire(int x, int y) { } public void left(int grids) { int target_x = x - grids; for (int i = x - 1; i >= target_x; i--) { move(i, y); Grid g = Grids.getGrid(i, y); g.notify(); } } public void right(int pixels) { // similar to left } public void up(int pixels) { // similar to left }
  • 7. Soldier public void down(int pixels) { //similar to left } public void move(int x, int y) { this.x = x; this.y = y; Graphics.paintSoldier(x * 10, y * 10, 10); // assuming paint soldier // takes bottom left screen pixel coordinate and number of screen pixels // side. Graphic library paints the soldier in that square area by suitably //coloring the pixels. } public void gotHit() { is_shot = true; }
  • 8. Watch Tower Watch tower watches over a square area surrounding it. Any soldier walking into the square area is shot at by soldier at watchtower. public class WatchTower { int x; int y; // number of grids for this square area where watch tower watches. int side; boolean in; Team t; public WatchTower(int x, int y, int side, Team t) { //assign } // other methods in next slide. }
  • 9. Watch Tower When watchtower is notified by Grid of an enemy soldier, it calls notfy In, When soldier walks out, it calls notify out. When notify in is called, watchtower creates its on thread for firing so that calling thread is not blocked. public void notifyIn(final int x, final int y) { in = true; Thread t = new Thread() { public void run() { while (in) { fire(x, y); } } }; } public void notifyOut(int x, int y) { in = false; }
  • 10. Watch Tower public void fire(int x, int y) { } public void registerWatchtowerWithGrids() { Grid[] gA = Grids.getGrid(x, y, side); for (int i = 0; i < gA.length; i++) { Grid g = gA[i]; g.registerWatchTower(this); } }
  • 11. Grid Game area is divided into square grids. Grids observe if a soldier is over its square and notify monitoring watchtowers. public class Grid { // coordinate for pixel int x; int y; List<WatchTower> l = new ArrayList<WatchTower>(); public void grid(int x, int y) { }
  • 12. Grid public void registerWatchTower(WatchTower w) { l.add(w); } public void NotifyIn() { for (int i = 0; i < l.size(); i++) { WatchTower w = l.get(i); w.notifyIn(x, y); } } public void NotifyOut() { for (int i = 0; i < l.size(); i++) { WatchTower w = l.get(i); w.notifyOut(x, y); } }
  • 13. Grids Assuming area to rectangular, let x be number of grids length wise and y be number of grids breadth wise. Another assumption is that each grid side has 10 screen pixels. So application grid (1,1) will have (10,10) as pixel coordinate at its bottom- left.
  • 14. Grids public class Grids { static Grid[][] gA ; static { int x,y; x=y=100; gA = new Grid[x][y]; for(int i=0;i<x;i++) { for(int j=0;j<y;j++){ Grid g = new Grid(i,j); gA[i][j]=g; } } }
  • 15. Grids public static Grid getGrid(int i, int y) { //implementation } public static Grid[] getGrid(int x, int y, int side) { //implementation }