@mwilki7/

Canvas Basketball

HTML, CSS, JS

Play some hoops on HTML 5 Canvas

fork
loading
Files
  • index.html
  • materials
  • sound
  • src
  • style.css

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.9917910590191255","path":"index.html","file":{"path":"index.html","content":{"asEncoding":{"base64":"PCFET0NUWVBFIGh0bWw+CjxodG1sPgogICAgPG1ldGEgbmFtZT0idmlld3BvcnQiIGNvbnRlbnQ9IndpZHRoPWRldmljZS13aWR0aCwgaW5pdGlhbC1zY2FsZT0wLjUsbWF4aW11bS1zY2FsZT0xLjAsIHVzZXItc2NhbGFibGU9MCI+CjxoZWFkPgogICAgPGxpbmsgcmVsPSJzdHlsZXNoZWV0IiBocmVmPSJodHRwczovL3d3dy53M3NjaG9vbHMuY29tL3czY3NzLzQvdzMuY3NzIj4KICAgIDxzY3JpcHQgc3JjPSJodHRwczovL2FqYXguZ29vZ2xlYXBpcy5jb20vYWpheC9saWJzL2pxdWVyeS8zLjMuMS9qcXVlcnkubWluLmpzIj48L3NjcmlwdD4KICAgICAgICA8dGl0bGU+Q2FudmFzIEJhc2tldGJhbGw8L3RpdGxlPgoKICAgIDxzdHlsZT4KICAgICAgICBib2R5LCBodG1sCiAgICAgICAgewogICAgICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiBkYXJrc2xhdGVncmF5OwogICAgICAgIH0KCiAgICA8L3N0eWxlPgo8L2hlYWQ+Cgo8Ym9keT4KICAgIDxzY3JpcHQgc3JjPSJzcmMvbWVudWFjdGlvbi5qcyIgICAgID48L3NjcmlwdD4KICAgIDxzY3JpcHQgc3JjPSJzcmMvbWVudWl0ZW0uanMiICAgICAgID48L3NjcmlwdD4gCiAgICA8c2NyaXB0IHNyYz0ic3JjL21lbnUuanMiICAgICAgICAgICA+PC9zY3JpcHQ+LQogICAgPHNjcmlwdCBzcmM9InNyYy9iYXNrZXRiYWxsX2Z1bmMuanMiPjwvc2NyaXB0PgogICAgPHNjcmlwdCBzcmM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nZ2xld2FsbHMoKSI+UFJFU1MgVyBGT1IgV0FMTFM8L2J1dHRvbj4KICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgPC9kaXY+CiAgICA8L2Rpdj4KICAgIDxkaXYgY2xhc3M9InczLXJvdy1wYWRkaW5nIj4KICAgICAgICA8ZGl2IGNsYXNzPSJ3My10aGlyZCI+CiAgICAgICAgICAgIDxkaXYgaWQ9ImRpdkNlbnRlciIgc3R5bGU9InBhZGRpbmc6IDVweDsiPgogICAgICAgICAgICAgICAgPGNhbnZhcyBpZD0ibXlDYW52YXMiIGNyb3NzT3JpZ2luPSJhbm9ueW1vdXMiIHN0eWxlPSJkaXNwbGF5OiBmbGV4O21hcmdpbjogMCBhdXRvO2JvcmRlcjogM3B4IHNvbGlkIGJsYWNrOyIgd2lkdGg9IjYwMCIgaGVpZ2h0PSI2MDAiPgogICAgICAgICAgICBDYW52YXMgbm90IHN1cHBvcnRlZCBieSB5b3VyIGJyb3dzZXIKICAgICAgICAgICAgICAgIDwvY2FudmFzPgogICAgICAgICAgICAgICAgPGJ1dHRvbiBpZD0iYnV0dG9uIiBvbmNsaWNrPSJyZXNldCgpIiBvbnRvdWNoc3RhcnQ9InJlc2V0KCkiPkNsZWFyIGJhbGxzPC9idXR0b24+CiAgICAgICAgICAgICAgICA8ZGl2IHN0eWxlPSJjb2xvcjp3aGl0ZTsiPgogICAgICAgICAgICAgICAgQ2FudmFzIEJhc2tldGJhbGwgYnkgTWljaGFlbCwgUHJlc3MgUyB0byBzaG9vdCwgU3BhY2UgdG8ganVtcAogICAgICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgICAgIDwvZGl2PgogICAgICAgIDwvZGl2PgogICAgPC9kaXY+CjwvYm9keT4KCjwvaHRtbD4="},"asBuffer":null},"loaded":true}}
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<!DOCTYPE html>
<html>
    <meta name="viewport" content="width=device-width, initial-scale=0.5,maximum-scale=1.0, user-scalable=0">
<head>
    <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
        <title>Canvas Basketball</title>

    <style>
        body, html
        {
            background-color: darkslategray;
        }

    </style>
</head>

<body>
    <script src="src/menuaction.js"     ></script>
    <script src="src/menuitem.js"       ></script> 
    <script src="src/menu.js"           ></script>-
    <script src="src/basketball_func.js"></script>
    <script src="src/entity.js"         ></script>
    <script src="src/player.js"         ></script>
    <script src="src/attractor.js"      ></script>
    <script src="src/puck.js"           ></script>
    <script src="src/wall.js"           ></script>
    <script src="src/trigger.js"        ></script>
    <script src="src/goal.js"           ></script>
    <script src="src/scoreboard.js"     ></script>
    <script src="src/portal.js"         ></script>
    <script src="src/particle.js"       ></script>

    <div class="w3-row-padding">
        <div class="w3-third">
            <div style="width: 50%;" id="divLeft" align="center">
                <button id="button" onclick="togglefastshooty()" ontouchstart="togglefastshooty()">PRESS F FOR FAST SHOOTY</button>
            <button id="button2" onclick="togglewalls()" ontouchstart="togglewalls()">PRESS W FOR WALLS</button>
            </div>
        </div>
    </div>
    <div class="w3-row-padding">
        <div class="w3-third">
            <div id="divCenter" style="padding: 5px;">
                <canvas id="myCanvas" crossOrigin="anonymous" style="display: flex;margin: 0 auto;border: 3px solid black;" width="600" height="600">
            Canvas not supported by your browser
                </canvas>
                <button id="button" onclick="reset()" ontouchstart="reset()">Clear balls</button>
                <div style="color:white;">
                Canvas Basketball by Michael, Press S to shoot, Space to jump
                </div>
            </div>
        </div>
    </div>
</body>

</html>
result
console