package com.company;
import java.util.Scanner;
import javax.swing.JOptionPane;
class Postac {
String imie;
int moc;
int x;
int y;
public Postac(String Imie, int Moc, int X, int Y) {
this.imie = Imie;
this.moc = Moc;
this.x = X;
this.y = Y;
};
public void setPozycja(int x, int y) {
this.x = x;
this.y = y;
}
int getX() {
return x;
}
int getY() {
return y;
}
}
class Hero extends Postac {
public Hero(String Imie, int Moc, int X, int Y) {
super(Imie, Moc, X, Y);
}
public void ruch(String Ruch) {
if (Ruch == "G") {
this.x = x - 1;
}
if (Ruch == "D") {
this.x = x + 1;
}
if (Ruch == "P") {
this.y = y + 1;
}
if (Ruch == "L") {
this.y = y - 1;
}
}
}
class Enemy extends Postac {
public Enemy(String Imie, int Moc, int X, int Y) {
super(Imie, Moc, X, Y);
}
}
class Mapa {
final int szerokoscPlanszy = 20;
final int wysokoscPlanszy = 20;
char[][] map = new char[szerokoscPlanszy][wysokoscPlanszy];
boolean jestok = true;
public void sprawdz(int x, int y) {
if (x < 0 || x > this.szerokoscPlanszy || y < 0 || y > this.wysokoscPlanszy) {
System.out.print("\n GAME OVER ");
this.jestok = false;
}
}
void pokaz(int xx, int yy) {
for (int a = 0; a < this.szerokoscPlanszy; a++) {
System.out.print(a);
for (int b = 0; b < this.wysokoscPlanszy; b++) {
if (a == 0)
System.out.print(b + " ");
else if (a == xx && b == yy) {
System.out.print("G" + " ");
} else {
System.out.print(
// map[a][b] +
" ");
}
}
System.out.print("\n");
}
}
}
public class Main {
public static void main(String[] args) {
Hero bohater = new Hero("Michal", 20, 10, 10);
Mapa map = new Mapa();
Scanner input = new Scanner(System.in);
map.pokaz(bohater.getX(), bohater.getY());
// if (map.jestok = false) {
// System.out.print("KONIEC GRY");
// } else {
// System.out.print("Wprowadz litere ruchu(G,D,L,P) i enter: ");
//
// // String steruj= input.nextLine();
//
//// bohater.ruch("D");
//
// map.pokaz(bohater.getX(), bohater.getY());
//
// }
}
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}