package com.codegym.games.snake;
import com.codegym.engine.cell.*;//nejma adhika ta3 all contents of the package!
//ken n7eb na3mlou wa7di maghir codegym , kifech na3ml li packages?
//Color w Game classes mawjoudin deja zouz fi engine : com.codegym.engine.cell
//kifech najm nekhdem jeu mela maghir engine ta3 codegym ?
public class SnakeGame extends Game {
public static final int WIDTH=15;
public static final int HEIGHT=15;
@Override
public void initialize(){
setScreenSize(HEIGHT,WIDTH);
createGame();//I tried to delete the createGame() and call here directly the
//drawScene() and it worked. Ma3mlnech akeka 5ater createGame() bch ta3ml
//7ajet okhra zeda
}
private void drawScene(){
for (int x = 0; x < WIDTH; x++) {
for (int y = 0; y < HEIGHT; y++) {
setCellColor(x, y, Color.GRAY);
}
}
}
private void createGame(){
drawScene();
Apple apple = new Apple(7,7);
apple.draw(this);//"this" here refers to the class
//fama method te5ou class fi parameter ?
}
}