Commit 1d7a70cd authored by Prieur Maxime's avatar Prieur Maxime 🎵

Themes on arena

parent 6cddf2b0
{
"cells": [
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[[0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]]\n"
]
}
],
"source": [
"import numpy as np\n",
"import PIL\n",
"from PIL import Image\n",
"# Open the image form working directory\n",
"image = Image.open('./bonus/x2.png')\n",
"# summarize some details about the image\n",
"data = np.asarray(image)\n",
"print(data[0])\n"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[[0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 2]\n",
" [0 0 0 4]\n",
" [0 0 0 2]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 2]\n",
" [0 0 0 4]\n",
" [0 0 0 3]\n",
" [0 0 0 1]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]\n",
" [0 0 0 0]]\n"
]
}
],
"source": [
"image1 = Image.open('./morty/morty_down.png')\n",
"# summarize some details about the image\n",
"data = np.asarray(image1)\n",
"print(data[0])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
......@@ -20,6 +20,14 @@ public class Sprite {
public static Sprite brick = new Sprite(50,SpriteSheet.brick, 50,50);
public static Sprite wall = new Sprite(50,SpriteSheet.wall, 50,50);
public static Sprite volcano_ground = new Sprite(50,SpriteSheet.volcano_ground, 50,50);
public static Sprite volcano_brick = new Sprite(50,SpriteSheet.volcano_brick, 50,50);
public static Sprite volcano_wall = new Sprite(50,SpriteSheet.volcano_wall, 50,50);
public static Sprite beach_ground = new Sprite(50,SpriteSheet.beach_ground, 50,50);
public static Sprite beach_brick = new Sprite(50,SpriteSheet.beach_brick, 50,50);
public static Sprite beach_wall = new Sprite(50,SpriteSheet.beach_wall, 50,50);
/*
|--------------------------------------------------------------------------
| Player Sprites
......
......@@ -16,6 +16,15 @@ public class SpriteSheet {
public static SpriteSheet ground = new SpriteSheet("/textures/grass00.png",50);
public static SpriteSheet brick = new SpriteSheet("/textures/brick.png",50);
public static SpriteSheet wall = new SpriteSheet("/textures/wall.png",50);
public static SpriteSheet volcano_ground = new SpriteSheet("/textures/volcano_ground.png",50);
public static SpriteSheet volcano_brick = new SpriteSheet("/textures/volcano_brick.png",50);
public static SpriteSheet volcano_wall = new SpriteSheet("/textures/volcano_wall.png",50);
public static SpriteSheet beach_ground = new SpriteSheet("/textures/beach_ground.png",50);
public static SpriteSheet beach_brick = new SpriteSheet("/textures/beach_brick.png",50);
public static SpriteSheet beach_wall = new SpriteSheet("/textures/beach_wall.png",50);
public static SpriteSheet bomb0 = new SpriteSheet("/textures/bomb/bomb0.png",50);
public static SpriteSheet bomb1 = new SpriteSheet("/textures/bomb/bomb1.png",50);
public static SpriteSheet bomb2 = new SpriteSheet("/textures/bomb/bomb2.png",50);
......
......@@ -67,34 +67,65 @@ public class FileLevel extends Level {
int pos = x + y * getWidth();
int x_pixel = Coordinates.caseToPixel(x);
int y_pixel = Coordinates.caseToPixel(y);
LayeredEntity layer;
switch(c) {
case '#':
_board.addEntitie(pos, new WallTile(x_pixel, y_pixel, Sprite.wall));
if (_level == 2)
_board.addEntitie(pos, new WallTile(x_pixel, y_pixel, Sprite.volcano_wall));
else if (_level == 3)
_board.addEntitie(pos, new WallTile(x_pixel, y_pixel, Sprite.beach_wall));
else
_board.addEntitie(pos, new WallTile(x_pixel, y_pixel, Sprite.wall));
break;
case 'b':
LayeredEntity layer = new LayeredEntity(x_pixel,y_pixel,
new GrassTile(x_pixel, y_pixel, Sprite.ground),
new BrickTile(x_pixel, y_pixel, Sprite.brick));
if (_level == 2)
layer = new LayeredEntity(x_pixel,y_pixel,
new GrassTile(x_pixel, y_pixel, Sprite.volcano_ground),
new BrickTile(x_pixel, y_pixel, Sprite.volcano_brick));
else if (_level == 3)
layer = new LayeredEntity(x_pixel,y_pixel,
new GrassTile(x_pixel, y_pixel, Sprite.beach_ground),
new BrickTile(x_pixel, y_pixel, Sprite.beach_brick));
else
layer = new LayeredEntity(x_pixel,y_pixel,
new GrassTile(x_pixel, y_pixel, Sprite.ground),
new BrickTile(x_pixel, y_pixel, Sprite.brick));
if(_board.isPowerupUsed(x_pixel, y_pixel, _level) == false)
layer.addBeforeTop(new PowerupBombs(x_pixel, y_pixel, _level, Sprite.powerup_bombs));
_board.addEntitie(pos, layer);
break;
case 's':
layer = new LayeredEntity(x_pixel, y_pixel,
new GrassTile(x_pixel, y_pixel, Sprite.ground),
new BrickTile(x_pixel, y_pixel, Sprite.brick));
if (_level == 2)
layer = new LayeredEntity(x_pixel,y_pixel,
new GrassTile(x_pixel, y_pixel, Sprite.volcano_ground),
new BrickTile(x_pixel, y_pixel, Sprite.volcano_brick));
else if (_level == 3)
layer = new LayeredEntity(x_pixel,y_pixel,
new GrassTile(x_pixel, y_pixel, Sprite.beach_ground),
new BrickTile(x_pixel, y_pixel, Sprite.beach_brick));
else
layer = new LayeredEntity(x_pixel,y_pixel,
new GrassTile(x_pixel, y_pixel, Sprite.ground),
new BrickTile(x_pixel, y_pixel, Sprite.brick));
if(_board.isPowerupUsed(x_pixel, y_pixel, _level) == false) {
layer.addBeforeTop(new PowerupSpeed(x_pixel, y_pixel, _level, Sprite.powerup_speed));
}
_board.addEntitie(pos, layer);
break;
case 'f':
layer = new LayeredEntity(x_pixel, y_pixel,
new GrassTile(x_pixel, y_pixel, Sprite.ground),
new BrickTile(x_pixel, y_pixel, Sprite.brick));
if (_level == 2)
layer = new LayeredEntity(x_pixel,y_pixel,
new GrassTile(x_pixel, y_pixel, Sprite.volcano_ground),
new BrickTile(x_pixel, y_pixel, Sprite.volcano_brick));
else if (_level == 3)
layer = new LayeredEntity(x_pixel,y_pixel,
new GrassTile(x_pixel, y_pixel, Sprite.beach_ground),
new BrickTile(x_pixel, y_pixel, Sprite.beach_brick));
else
layer = new LayeredEntity(x_pixel,y_pixel,
new GrassTile(x_pixel, y_pixel, Sprite.ground),
new BrickTile(x_pixel, y_pixel, Sprite.brick));
if(_board.isPowerupUsed(x_pixel, y_pixel, _level) == false) {
layer.addBeforeTop(new PowerupFlames(x_pixel, y_pixel, _level, Sprite.powerup_flames));
......@@ -102,24 +133,53 @@ public class FileLevel extends Level {
_board.addEntitie(pos, layer);
break;
case '*':
_board.addEntitie(pos, new LayeredEntity(x_pixel, y_pixel,
new GrassTile(x_pixel, y_pixel, Sprite.ground),
new BrickTile(x_pixel, y_pixel, Sprite.brick)) );
case '*':
if (_level == 2)
_board.addEntitie(pos, new LayeredEntity(x_pixel,y_pixel,
new GrassTile(x_pixel, y_pixel, Sprite.volcano_ground),
new BrickTile(x_pixel, y_pixel, Sprite.volcano_brick)));
else if (_level == 3)
_board.addEntitie(pos, new LayeredEntity(x_pixel,y_pixel,
new GrassTile(x_pixel, y_pixel, Sprite.beach_ground),
new BrickTile(x_pixel, y_pixel, Sprite.beach_brick)));
else
_board.addEntitie(pos, new LayeredEntity(x_pixel,y_pixel,
new GrassTile(x_pixel, y_pixel, Sprite.ground),
new BrickTile(x_pixel, y_pixel, Sprite.brick)));
break;
case ' ':
_board.addEntitie(pos, new GrassTile(x_pixel, y_pixel, Sprite.ground) );
case ' ':
if (_level == 2)
_board.addEntitie(pos, new GrassTile(x_pixel, y_pixel, Sprite.volcano_ground));
else if (_level == 3)
_board.addEntitie(pos, new GrassTile(x_pixel, y_pixel, Sprite.beach_ground));
else
_board.addEntitie(pos, new GrassTile(x_pixel, y_pixel, Sprite.ground) );
break;
case 'p':
_board.addMob( new Player(0,x_pixel, y_pixel, _board) );
_board.addEntitie(pos, new GrassTile(x_pixel, y_pixel, Sprite.ground) );
if (_level == 2)
_board.addEntitie(pos, new GrassTile(x_pixel, y_pixel, Sprite.volcano_ground));
else if (_level == 3)
_board.addEntitie(pos, new GrassTile(x_pixel, y_pixel, Sprite.beach_ground));
else
_board.addEntitie(pos, new GrassTile(x_pixel, y_pixel, Sprite.ground) );
break;
case 'r':
_board.addMob( new Player(1,x_pixel, y_pixel, _board) );
_board.addEntitie(pos, new GrassTile(x_pixel, y_pixel, Sprite.ground) );
if (_level == 2)
_board.addEntitie(pos, new GrassTile(x_pixel, y_pixel, Sprite.volcano_ground));
else if (_level == 3)
_board.addEntitie(pos, new GrassTile(x_pixel, y_pixel, Sprite.beach_ground));
else
_board.addEntitie(pos, new GrassTile(x_pixel, y_pixel, Sprite.ground) );
break;
default:
_board.addEntitie(pos, new GrassTile(x_pixel, y_pixel, Sprite.ground) );
if (_level == 2)
_board.addEntitie(pos, new GrassTile(x_pixel, y_pixel, Sprite.volcano_ground));
else if (_level == 3)
_board.addEntitie(pos, new GrassTile(x_pixel, y_pixel, Sprite.beach_ground));
else
_board.addEntitie(pos, new GrassTile(x_pixel, y_pixel, Sprite.ground) );
break;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment