Jack's PHP Editor
Save & Run
my games
all students
game.php
index.php
user.php
+ New file
Games:
frogger
+ New game
<?php // Jack's "game.php" — a Simplicity2D game page! // Use the "Add Cube" / "Add Circle" buttons above the editor to drop in // more shapes, or copy the pattern below yourself. Every shape gets an // update() function that runs 60 times a second — that's how it moves. error_reporting(E_ALL & ~E_DEPRECATED); ?> <!doctype html> <html> <head> <meta charset="utf-8"> <title>Jack — game.php</title> <style>html, body { margin: 0; padding: 0; overflow: hidden; background: #1e293b; }</style> </head> <body> <canvas id="game"></canvas> <script type="module"> import Simplicity2D from '/vendor/simplicity2d/simplicity2d.min.js'; import { Rectangle, Circle } from '/vendor/simplicity2d/shapes.js'; class MyScene extends Simplicity2D.Scene {} const scene = new MyScene(); const game = Simplicity2D.game; game.init('game'); game.addScene('main', scene); game.setScene('main'); // ---- Add your shapes below (or use the buttons above the editor) ---- const cube1 = new Rectangle(100, 100, 60, 60, '#4f8cff'); scene.addEntity(cube1); // Runs every frame — try editing this! cube1.update = function () { this.setX(this.getX() + 1); }; // ----------------------------------------------------------------------- game.start(); </script> </body> </html>
students/jack/game.php
open in new tab