Giter Site home page Giter Site logo

johnrobertmcc / cappy-s-grand-adventure Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 22.8 MB

A multi-level, side-scroller game with original design

Home Page: https://johnrobertmcc.github.io/Cappy-s-Grand-Adventure/

HTML 14.14% JavaScript 77.28% CSS 8.58%
javascript piskel

cappy-s-grand-adventure's Introduction

Cappy-s-Grand-Adventure

Cappy's Grand Adventure is a side-scroller game writtten in vanilla javascript and implemented with original design


Javascript

This game was written soloely with vanilla Javascript, without the addition of any libraries

Features

Original Design

The core of any game, original design with sprites made in PiskellApp and backgrounds made in Inkscape

alt-text

Dynamic motion

Cappy can run, jump, and even sit through keyboard Event Listeners. As demoed below, the code for these movements is kept clean and concise through toggling the frame of the spritesheet based on conditionals. This allows for a more varied range of movements and an easier way to continuously build:

function makeHimWalk(){
    if( player.frameX < 3 && player.frameY === 0 && player.moving){
        player.frameX ++;
    } else if( player.frameX < 3 && player.frameY === 1 && player.moving){
        player.frameX ++;
    } else if(player.frameX < 3 && player.frameY === 2 ){
        player.frameX ++;
    }else if(player.frameX < 3 && player.frameY === 3 ){
        player.frameX ++;
    } 
    else {
        player.frameX = 0 && player.frameY === 0;
    };
}

function makeHimJump() {
    if(player.frameX < 3 && player.frameY === 4){
        player.frameX ++
    }else if(player.jumping === true && player.y > 600) {
        player.frameX ++;
    }else if(player.moving === false && player.y <= 601){
        player.jumping === false
    }
}
Scrolling background

Run through the streets of New York as a simple lad who wants nothing but to kill some rats

alt-text

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.