• Alright, I just beat Batman Arkham City for the 15th time, and it inspired me to make a Batman series

    Heres a frame from it.

    8
  • Replying to comment by: InfuriatorWhat should I change

    The eye gradient looks a bit intense, and his nose is too ellipse-y
    Other than that, you good.

    0
    View
  • Replying to comment by: guyTomorrow at 10 am sound good?

    @soupboiv2

    0
    View
  • Replying to comment by: Kuro anims
    17264_0-42866400-1586571860_that-guy_0000.png

    All he\’s gonna do to stop Xeduhar is hurt his feelings

    0
    View
  • Replying to comment by: SoupmannSo uh. Here are some. Two Of them aren’t really finished y

    Yo, these are pretty cool
    Submit em

    0
    View
  • Replying to comment by: AbsoluteSpaghettiYou were going to set up snake?

    maybe I was

    0
    View
  • Replying to comment by: Soupmann@thatguy-2 wanna play some Minecraft on the SN server?

    Tomorrow at 10 am sound good?

    0
    View
  • Replying to comment by: guy html, body { height: 100%; margin: 0; }

    Fuck.

    2
    View
  • html, body {
    height: 100%;
    margin: 0;
    }
    body {
    background: black;
    display: flex;
    align-items: center;
    justify-content: center;
    }
    canvas {
    border: 1px solid white;
    }
    #p1
    {
    color:red;
    position:absolute;
    left:100px;
    top:10px;
    }
    #p2
    {
    color:red;
    position:absolute;
    left:100px;
    top:30px;
    }
    #score
    {
    color:yellow;
    position:absolute;
    left:155px;
    top:10px;
    }
    #high
    {
    color:yellow;
    position:absolute;
    left:195px;
    top:30px;
    }

    SCORE:
    HIGHSCORE:

    var canvas = document.getElementById(\’game\’);
    var context = canvas.getContext(\’2d\’);
    var grid = 16;
    var count = 0;
    var score=0;
    var max=0;

    var snake = {
    x: 160,
    y: 160,

    // snake velocity. moves one grid length every frame in either the x or y direction
    dx: grid,
    dy: 0,

    // keep track of all grids the snake body occupies
    cells: [],

    // length of the snake. grows when eating an apple
    maxCells: 4
    };
    var apple = {
    x: 320,
    y: 320
    };

    // get random whole numbers in a specific range
    // @see https://stackoverflow.com/a/1527820/2124254
    function getRandomInt(min, max) {
    return Math.floor(Math.random() * (max – min)) + min;
    }
    // game loop
    function loop() {
    requestAnimationFrame(loop);
    // slow game loop to 15 fps instead of 60 (60/15 = 4)
    if (++count < 4) {
    return;
    }
    count = 0;
    context.clearRect(0,0,canvas.width,canvas.height);
    // move snake by it\'s velocity
    snake.x += snake.dx;
    snake.y += snake.dy;
    // wrap snake position horizontally on edge of screen
    if (snake.x = canvas.width) {
    snake.x = 0;
    }

    // wrap snake position vertically on edge of screen
    if (snake.y = canvas.height) {
    snake.y = 0;
    }
    // keep track of where snake has been. front of the array is always the head
    snake.cells.unshift({x: snake.x, y: snake.y});
    // remove cells as we move away from them
    if (snake.cells.length > snake.maxCells) {
    snake.cells.pop();
    }
    // draw apple
    context.fillStyle = \’red\’;
    context.fillRect(apple.x, apple.y, grid-1, grid-1);
    // draw snake one cell at a time
    context.fillStyle = \’green\’;
    snake.cells.forEach(function(cell, index) {

    // drawing 1 px smaller than the grid creates a grid effect in the snake body so you can see how long it is
    context.fillRect(cell.x, cell.y, grid-1, grid-1);
    // snake ate apple
    if (cell.x === apple.x && cell.y === apple.y) {
    snake.maxCells++;
    score+=10;
    //max=score;
    document.getElementById(\’score\’).innerHTML=score;

    // canvas is 400×400 which is 25×25 grids
    apple.x = getRandomInt(0, 25) * grid;
    apple.y = getRandomInt(0, 25) * grid;
    }
    // check collision with all cells after this one (modified bubble sort)
    for (var i = index + 1; i max)
    {
    max=score;
    }
    snake.x = 160;
    snake.y = 160;
    snake.cells = [];
    snake.maxCells = 4;
    snake.dx = grid;
    snake.dy = 0;
    score=0;
    apple.x = getRandomInt(0, 25) * grid;
    apple.y = getRandomInt(0, 25) * grid;
    document.getElementById(\’high\’).innerHTML=max;
    }
    }
    }

    );

    }
    // listen to keyboard events to move the snake
    document.addEventListener(\’keydown\’, function(e) {
    // prevent snake from backtracking on itself by checking that it\’s
    // not already moving on the same axis (pressing left while moving
    // left won\’t do anything, and pressing right while moving left
    // shouldn\’t let you collide with your own body)

    // left arrow key
    if (e.which === 37 && snake.dx === 0) {
    snake.dx = -grid;
    snake.dy = 0;
    }
    // up arrow key
    else if (e.which === 38 && snake.dy === 0) {
    snake.dy = -grid;
    snake.dx = 0;
    }
    // right arrow key
    else if (e.which === 39 && snake.dx === 0) {
    snake.dx = grid;
    snake.dy = 0;
    }
    // down arrow key
    else if (e.which === 40 && snake.dy === 0) {
    snake.dy = grid;
    snake.dx = 0;
    }
    });
    // start the game
    requestAnimationFrame(loop);

    2
  • I wonder if I can make a game using HTML in the activity section of the site

    6
  • Replying to comment by: katzethat was literally like my first official pack on the site l

    ¯\\_(ツ)_/¯

    1
    View
  • Replying to comment by: Kuro animsI made the group for people who speak Spanish on stick nodes

    Me no the hablo el burrito
    Me the hablo el englisho

    0
    View
  • Replying to comment by: Tastylemon16While tracing the Administrator badge I found a typo. ‘Admi

    Administator Tots
    Yum

    1
    View
  • Replying to comment by: InfuriatorPoster for batman series coming soon! 🙂
    22117

    Joker doesn\’t look so good…

    0
    View
  • Replying to comment by: Ralph (Developer)spider-verse has nothing on you

    Great idea!
    Spider Guy!

    0
    View
  • Load More