Attention ! Gitlab fournissant maintenant nativement des certificats Let’s Encrypt aux domaines personnalisés des Gitlab Pages, nous avons coupé notre service qui le faisait automatiquement pour vous.

Il est impératif, pour que votre domaine personnalisé continue à avoir un certificat Let’s Encrypt à jour, d’activer la fonctionnalité native dans les paramètres de votre projet. Cette activation remplacera votre certificat actuel par un nouveau certificat Let’s Encrypt géré par Gitlab.

Voir les détails sur https://docs.framasoft.org/fr/gitlab/gitlab-pages-le.html

Commit ebe57bb9 authored by Guillaume C.'s avatar Guillaume C.

Pong v0.9

parents
class ComportementsBehavior extends Sup.Behavior {
awake() {
}
update() {
}
}
Sup.registerBehavior(ComportementsBehavior);
class CmpJ1 extends Sup.Behavior { // Comportement du J1
awake() {
}
update() {
let velJ1= this.actor.arcadeBody2D.getVelocity(); // Récupère la vélocité du palet J1
velJ1.y = 0;
if(Sup.Input.isKeyDown("SHIFT")){
velJ1.y=10;
}
if(Sup.Input.isKeyDown("CONTROL")){
velJ1.y=-10;
}
this.actor.arcadeBody2D.setVelocity(velJ1); // équivaut au Return velJ1
}
}
Sup.registerBehavior(CmpJ1);
/*class CmpBalle extends Sup.Behavior {
awake() {
}
update() {
}
}
Sup.registerBehavior(CmpBalle);*/
class ComportementsBehavior extends Sup.Behavior {
awake() {
}
update() {
}
}
Sup.registerBehavior(ComportementsBehavior);
class CmpJ1 extends Sup.Behavior {
awake() {
}
update() {
let velJ1= this.actor.arcadeBody2D.getVelocity(); // Récupère la vélocité du palet J1
velJ1.y = 0;
}
}
Sup.registerBehavior(CmpJ1);
/*class CmpBalle extends Sup.Behavior {
awake() {
}
update() {
}
}
Sup.registerBehavior(CmpBalle);*/
class ComportementsBehavior extends Sup.Behavior {
awake() {
}
update() {
}
}
Sup.registerBehavior(ComportementsBehavior);
class CmpJ1 extends Sup.Behavior { // Comportement du J1
awake() {
}
update() {
let velJ1= this.actor.arcadeBody2D.getVelocity(); // Récupère la vélocité du palet J1
velJ1.y = 0;
if(Sup.Input.isKeyDown("SHIFT")){
velJ1.y=10;
}
if(Sup.Input.isKeyDown("CONTROL")){
velJ1.y=-10;
}
this.actor.arcadeBody2D.setVelocity(velJ1); // équivaut au Return velJ1
}
}
Sup.registerBehavior(CmpJ1);
/*class CmpBalle extends Sup.Behavior {
awake() {
}
update() {
}
}
Sup.registerBehavior(CmpBalle);*/
class ComportementsBehavior extends Sup.Behavior {
awake() {
}
update() {
}
}
Sup.registerBehavior(ComportementsBehavior);
class CmpJ1 extends Sup.Behavior {
awake() {
}
update() {
let velJ1= this.actor.arcadeBody2D.getVelocity(); // Récupère la vélocité du palet J1
velJ1.y = 0;
}
}
Sup.registerBehavior(CmpJ1);
/*class CmpBalle extends Sup.Behavior {
awake() {
}
update() {
}
}
Sup.registerBehavior(CmpBalle);*/
{
"formatVersion": 2,
"isBitmap": false,
"filtering": "pixelated",
"pixelsPerUnit": 1,
"size": 32,
"color": "ffffff",
"opacity": null,
"gridWidth": 16,
"gridHeight": 16,
"charset": null,
"charsetOffset": 32
}
\ No newline at end of file
{
"formatVersion": 1,
"nodes": [
{
"id": "0",
"name": "Camera",
"children": [],
"components": [
{
"type": "Camera",
"config": {
"mode": "orthographic",
"fov": 45,
"orthographicScale": 720,
"viewport": {
"x": 0,
"y": 0,
"width": 1,
"height": 1
},
"depth": 0,
"nearClippingPlane": 0.1,
"farClippingPlane": 1000,
"formatVersion": 1
},
"id": "0"
}
],
"position": {
"x": 640,
"y": 360,
"z": 5
},
"orientation": {
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"scale": {
"x": 1,
"y": 1,
"z": 1
},
"visible": true,
"layer": 0,
"prefab": null
},
{
"id": "1",
"name": "Balle",
"children": [],
"components": [
{
"type": "SpriteRenderer",
"config": {
"spriteAssetId": "6",
"animationId": null,
"horizontalFlip": false,
"verticalFlip": false,
"castShadow": false,
"receiveShadow": false,
"color": "ffffff",
"overrideOpacity": false,
"opacity": null,
"materialType": "basic",
"shaderAssetId": null,
"formatVersion": 1
},
"id": "0"
},
{
"type": "ArcadeBody2D",
"config": {
"type": "box",
"movable": true,
"width": 20,
"height": 20,
"offset": {
"x": 0,
"y": 0
},
"tileMapAssetId": null,
"tileSetPropertyName": null,
"layersIndex": null,
"formatVersion": 2,
"bounce": {
"x": 0,
"y": 0
}
},
"id": "1"
},
{
"type": "Behavior",
"config": {
"behaviorName": "CmpBalle",
"propertyValues": {}
},
"id": "2"
}
],
"position": {
"x": 640,
"y": 360,
"z": 0
},
"orientation": {
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"scale": {
"x": 1,
"y": 1,
"z": 1
},
"visible": true,
"layer": 0,
"prefab": null
},
{
"id": "2",
"name": "J1",
"children": [],
"components": [
{
"type": "SpriteRenderer",
"config": {
"spriteAssetId": "5",
"animationId": null,
"horizontalFlip": false,
"verticalFlip": false,
"castShadow": false,
"receiveShadow": false,
"color": "ffffff",
"overrideOpacity": false,
"opacity": null,
"materialType": "basic",
"shaderAssetId": null,
"formatVersion": 1
},
"id": "0"
},
{
"type": "ArcadeBody2D",
"config": {
"type": "box",
"movable": true,
"width": 20,
"height": 100,
"offset": {
"x": 0,
"y": 0
},
"tileMapAssetId": null,
"tileSetPropertyName": null,
"layersIndex": null,
"formatVersion": 2,
"bounce": {
"x": 0,
"y": 0
}
},
"id": "1"
},
{
"type": "Behavior",
"config": {
"behaviorName": "CmpJ1",
"propertyValues": {}
},
"id": "2"
}
],
"position": {
"x": 100,
"y": 360,
"z": 0
},
"orientation": {
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"scale": {
"x": 1,
"y": 1,
"z": 1
},
"visible": true,
"layer": 0,
"prefab": null
},
{
"id": "3",
"name": "J2",
"children": [],
"components": [
{
"type": "SpriteRenderer",
"config": {
"spriteAssetId": "5",
"animationId": null,
"horizontalFlip": false,
"verticalFlip": false,
"castShadow": false,
"receiveShadow": false,
"color": "ffffff",
"overrideOpacity": false,
"opacity": null,
"materialType": "basic",
"shaderAssetId": null,
"formatVersion": 1
},
"id": "0"
},
{
"type": "ArcadeBody2D",
"config": {
"type": "box",
"movable": true,
"width": 20,
"height": 100,
"offset": {
"x": 0,
"y": 0
},
"tileMapAssetId": null,
"tileSetPropertyName": null,
"layersIndex": null,
"formatVersion": 2,
"bounce": {
"x": 0,
"y": 0
}
},
"id": "1"
},
{
"type": "Behavior",
"config": {
"behaviorName": "CmpJ2",
"propertyValues": {}
},
"id": "2"
}
],
"position": {
"x": 1180,
"y": 360,
"z": 0
},
"orientation": {
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"scale": {
"x": 1,
"y": 1,
"z": 1
},
"visible": true,
"layer": 0,
"prefab": null
},
{
"id": "4",
"name": "Score",
"children": [],
"components": [
{
"type": "TextRenderer",
"config": {
"formatVersion": 2,
"fontAssetId": "7",
"text": "Text",
"alignment": "center",
"verticalAlignment": "center",
"size": null,
"color": null,
"overrideOpacity": false,
"opacity": null
},
"id": "0"
},
{
"type": "Behavior",
"config": {
"behaviorName": "CmpScore",
"propertyValues": {}
},
"id": "1"
}
],
"position": {
"x": 640,
"y": 690,
"z": 0
},
"orientation": {
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"scale": {
"x": 1,
"y": 1,
"z": 1
},
"visible": true,
"layer": 0,
"prefab": null
}
]
}
\ No newline at end of file
class ComportementsBehavior extends Sup.Behavior {
awake() {
}
update() {
}
}
Sup.registerBehavior(ComportementsBehavior);
const VITBALLE = 3; // Vitesse de base de la balle
let scoreJ1 = 0;
let scoreJ2 = 0;
let ecran = Sup.Input.getScreenSize();
let activeJ1 =false;
function Tactile(num : number) {
//Sup.log("tactile " + this.actor.getY());
let ydoigtJ = Sup.Input.getTouchPosition(num).y;
let proportion= ((Sup.Input.getTouchPosition(num).y +1)/2);
let nvposy = proportion*ecran.y;
return nvposy;
}
class CmpJ1 extends Sup.Behavior { // Comportement du J1
awake() {
//Sup.log("awake " + this.actor.getY());
}
update() {
//Sup.log("update " + this.actor.getY());
let velJ1= this.actor.arcadeBody2D.getVelocity(); // Récupère la vélocité du palet J1
velJ1.y = 0;
if(Sup.Input.isKeyDown("SHIFT") && this.actor.getY() < 670){
velJ1.y=10;
}
////////////////////////////////Tactile
if(Sup.Input.wasTouchStarted(0)){
activeJ1 = true;
}else if (Sup.Input.wasTouchEnded(0)){
activeJ1 =false;
}
//Sup.log("start :"+ Sup.Input.wasTouchStarted(0)+ " end : " + Sup.Input.wasTouchEnded(0));
if ( activeJ1 && (Sup.Input.getTouchPosition(0).x <= 0 ) ) {
let posyJ1 = Tactile(0);
this.actor.setY(posyJ1);
}
/////////////////////////////////
if(Sup.Input.isKeyDown("CONTROL") && this.actor.getY() > 50){
velJ1.y=-10;
}
//Sup.log("3 " + posyJ1);
this.actor.arcadeBody2D.setVelocity(velJ1);
this.actor.arcadeBody2D.warpPosition(this.actor.getX(),this.actor.getY());// équivaut au Return velJ1
} // ne pas oublier de l'appliquer à l'objet
}
Sup.registerBehavior(CmpJ1);
class CmpJ2 extends Sup.Behavior { // Comportement du J2
awake() {
}
update() {
let velJ2= this.actor.arcadeBody2D.getVelocity(); // Récupère la vélocité du palet J2
velJ2.y = 0;
if(Sup.Input.isKeyDown("UP") && this.actor.getY() < 670){
velJ2.y=10;
}
if(Sup.Input.isKeyDown("DOWN") && this.actor.getY() > 50){
velJ2.y=-10;
}
////////////////////////////////Tactile
if ((Sup.Input.wasTouchStarted(1) || !Sup.Input.wasTouchEnded(1)) && (Sup.Input.getTouchPosition(1).x > 0 ) ) {
let posyJ2 = Tactile(1);
this.actor.setY(posyJ2);
}
/////////////////////////////////
this.actor.arcadeBody2D.setVelocity(velJ2); // équivaut au Return velJ2
} // ne pas oublier de l'appliquer à l'objet
}
Sup.registerBehavior(CmpJ2);
class CmpBalle extends Sup.Behavior { // Comportement de la balle
vitesse = VITBALLE; // vitesse de la balle
sx = 1; // Sens de la balle à l'horizontal
sy = 1; // Sens de la balle à la verticale
awake() {
}
update() {
let velBalle = this.actor.arcadeBody2D.getVelocity();
if(Sup.ArcadePhysics2D.collides(this.actor.arcadeBody2D,Sup.ArcadePhysics2D.getAllBodies())){ // cogne une raquette
this.sx = this.sx * -1;
this.vitesse = this.vitesse + 1;
}
if(this.actor.getY() > 710 || this.actor.getY() < 10 ){ // cogne un mur
this.sy = this.sy * -1;
}
if(this.actor.getX() > 1280){
this.actor.arcadeBody2D.warpPosition(new Sup.Math.Vector3(640,360,0)); // Quand gain de point, remise balle au centre
this.vitesse = VITBALLE;
this.sx = this.sx * -1;
scoreJ1 = scoreJ1 + 1;
}
if(this.actor.getX() < 0){
this.actor.arcadeBody2D.warpPosition(new Sup.Math.Vector3(640,360,0)); // Quand gain de point, remise balle au centre
this.vitesse = VITBALLE;
this.sx = this.sx * -1;
scoreJ2 = scoreJ2 + 1;
}
velBalle.x = this.vitesse * this.sx;
velBalle.y = this.vitesse * this.sy;
this.actor.arcadeBody2D.setVelocity(velBalle);
}
}
Sup.registerBehavior(CmpBalle);
class CmpScore extends Sup.Behavior {
awake() {
}
update() {
this.actor.textRenderer.setText(scoreJ1 + " : " + scoreJ2);
}
}
Sup.registerBehavior(CmpScore);
{
"formatVersion": 3,
"maps": [
"map"
],
"filtering": "pixelated",
"wrapping": "clampToEdge",
"pixelsPerUnit": 1,
"framesPerSecond": 10,
"opacity": null,
"alphaTest": 0.1,
"frameOrder": "rows",
"grid": {
"width": 20,
"height": 20
},
"origin": {
"x": 0.5,
"y": 0.5
},
"animations": [],
"mapSlots": {
"map": "map",
"light": null,
"specular": null,
"alpha": null,
"normal": null
}
}
\ No newline at end of file
{
"formatVersion": 3,
"maps": [
"map"
],
"filtering": "pixelated",
"wrapping": "clampToEdge",
"pixelsPerUnit": 1,
"framesPerSecond": 10,
"opacity": null,
"alphaTest": 0.1,
"frameOrder": "rows",
"grid": {
"width": 20,
"height": 100
},
"origin": {
"x": 0.5,
"y": 0.5
},
"animations": [],
"mapSlots": {
"map": "map",
"light": null,
"specular": null,
"alpha": null,
"normal": null
}
}
\ No newline at end of file
{
"nextEntryId": 8,
"nodes": [
{
"id": "0",