html
html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script>
<script>
var s = {
ghost: "https://vignette.wikia.nocookie.net/pokemon/images/0/05/Ghost_Lavender_Town_RBY.png/revision/latest?cb=20180113101034",
witch: "https://orig00.deviantart.net/2ae6/f/2014/309/9/7/tappy_witch_sprite_by_amazingtrout-d852na4.gif",
background: "http://cdn.nitrome.com/images/horror/tile.png"
}
</script>
</head>
<body>
<canvas id="c"></canvas>
<button id="s">Shot</button>
<h4 id="sc">dfg</h4>
</body>
</html>
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
body {
margin:0;
padding:0;
}
#s {
position:absolute;
right:0;
bottom:0;
height:25vw;
width:25vw;
background-color: rgba(0,255,0,0.2);
color: white;
font-weight:bold;
}
#sc {
position:absolute;
top:5px;
left:5px;
color: #fff;
}
Enter to Rename, Shift+Enter to Preview
js
js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
var C, ctx;
const H = window.innerHeight;
const W = window.innerWidth;
var score = 0;
var enemies = [new Enemy(), new Enemy(), new Enemy()];
var player = new Player();
var bull = [];
$(function(){
alert("Game by InvBoy.\nVote this if you like.\nControls: Touch the screen to move. Press 'shot' to shot your magic powers.");
alert("Ready?");
alert("Go!");
main();
});
function main(){
C = document.querySelector("#c");
C.height = H;
C.width = W;
ctx = C.getContext("2d");
$(document).on("scroll", function(e){
e.preventDefault();
$("html, body").animate({
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run