Skip to content
Snippets Groups Projects
Commit 09dc4a22 authored by Dos Reis Cedric's avatar Dos Reis Cedric
Browse files

final2

parent aafcd568
Branches
No related tags found
No related merge requests found
Cedric Dos Reis
IHM
Décembre 2019
IHM - Labo 5
# lab5 - IHM
......
Cedric Dos Reis
Décembre 2019
IHM - Labo 5
# Pac Man - restfull API module
## Installation
......@@ -68,7 +74,7 @@ http://localhost:5000/
or
127.0.0.1:5000
......
"""
Cedric Dos Reis
Décembre 2019
IHM - Labo 5
"""
from flask import Flask, render_template
import os
import mapManager
......
"""
Cedric Dos Reis
Décembre 2019
IHM - Labo 5
"""
from PIL import Image
import os
......
Cedric Dos Reis
Décembre 2019
IHM - Labo 5
# Maps
A map is represented by a 21x21 pixel image in `.png`.
Each pixel may represent a different element depending on its color in RGB
......
/*
Cedric Dos Reis
Décembre 2019
IHM - Labo 5
*/
class Enemy {
constructor(obj) {
this.object = obj;
......
/*
Cedric Dos Reis
Décembre 2019
IHM - Labo 5
*/
const DIRECTION = {
UP: 'UP',
DOWN: 'DOWN',
......
/*
Cedric Dos Reis
Décembre 2019
IHM - Labo 5
*/
function convert2Dto1D(x, y, sz){
return (y * sz) + x;
}
......@@ -114,7 +119,7 @@ class MapGenerator {
food.name = "sfood" + foods.length;
food.position.x = convertCoordToPos(x,SIZE);
food.position.y = convertCoordToPos(y,SIZE);
scene.add(food);
foods.push(food);
......
/*
Cedric Dos Reis
Décembre 2019
IHM - Labo 5
*/
class Player {
constructor(obj) {
this.object = obj;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment