Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Algearoid.step01.alg #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/Algearoid.step01.alg
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,34 @@
set font = game.createFont("emulogic", 12, game.color.WHITE);

// creation du stage
// stage creation
set stage = game.createStage(0, 0);

//creation d'un layer pour le jeu
// creation d'un layer pour le jeu
// game layer creation
set gameLayer = stage.createLayer();
// creation d'un layer pour les informations de debug
// creation d'un layer pour les informations de debug (fixe)
// debugging and informations layer (fixed)
set debugLayer = stage.createLayer();

debugLayer
.createButton(font, "black", "debug", stage.getWidth() - 115, stage.getHeight() - 70)
.onTap ({ game.setDebug(!game.getDebug()); });

// creation de l'actor qui represéntera le vaisseau du joueur
// star ship player actor
set player = gameLayer.createActor("player");

// le vaisseau aura des interaction avec d'autres objets
player.typeDynamic().hitSquare(0);
// space ship will interact with other objects.
player.typeDynamic().hitSquare();

// On le place au centre pour démarrer
// Player should be on the center of the screen
player.move(stage.getWidth()/2, stage.getHeight()/2);

// gestion des actions du clavier
// keyboard actions management
stage.onKeyPulse((ch) {
// si on utilise la flèche gauche
if (ch == game.key.LEFT) {
Expand Down