<html> <head> <title> Hello </title> </head> <body> <h1> Hello World! </h1> </body> </html> <html> <head> <title> Pong </title> <script src="https://simplycoding.org/files/simplyjs/simply.js"></script> <script> function start(){ sjs.open(); var ball = new sjs.Image("https://simplycoding.org/files/Game Design/Pong/Images/golfball.png"); ball.type = "ball"; ball.setSize(55,55); ball.center(); ball.friction = 0; ball.bounce(); ball.pushUp(4); ball.pushLeft(3); var paddle = new sjs.Image("https://simplycoding.org/files/Game Design/Pong/Images/paddle.png"); paddle.type = "paddle"; paddle.setSize(100,20); paddle.centerH(); var paddle2 = new sjs.Image("https://simplycoding.org/files/Game Design/Pong/Images/paddle2.png"); paddle2.type = "paddle"; paddle2.setSize(100,20); paddle2.center().bottom(); var soundEffect = new Audio('https://simplycoding.org/files/Game Design/Pong/Music/pop.mp3'); var soundMusic = new Audio('https://simplycoding.org/files/Game Design/Platform/Music/ova.mp3'); soundMusic.play(); var score = 0; var score_txt = new sjs.Text("Current Score: 0", 21, "orange"); sjs.onHit("ball","paddle", function(ball,paddle){ score = score + 1; score_txt.setText("Current Score: "+score); soundEffect.play(); sjs.bounceOff(ball,paddle); }); sjs.keyDown(LEFT_KEY, function(){ paddle.pushLeft(); paddle2.pushLeft(); }); sjs.keyDown(RIGHT_KEY, function(){ paddle.pushRight(); paddle2.pushRight(); }); sjs.onHit("ball",["top_screen","bottom_screen"], function(){ var text = new sjs.Text("WHY?",28,"blue"); text.center().offset(0,-50); var startBtn = new sjs.Button("Retry", function(){ location.reload(); }); startBtn.center(); }); } </script> </head> <body onload="start()"> <h1>Pong </h1> <div id="target" style="margin:auto;background:black;"></div> </body> </html>