Code Monkey home page Code Monkey logo

spider-man's Introduction

Spider-Man

  • A Mini-figure Spiderman game with more villains to fight in HTML5, CSS3 and Javascript



Special Notes

What is needed to Play Spider-Man

  • A Laptop, Computer or a Desktop with a keyboard
  • Specially a Keyboard
  • A web browser
  • File extractor (normally you can extract with the system software or you can use WinRar and etc.)

Used langs

  • Javascript
  • HTML5
  • CSS3

Preview
Spider-Man

More about the game

Villains in the game

  • Thugs
  • Venom
  • Green Goblin
  • Sandman
  • Dr.Octopus
  • Mysterio


Running Spider-Man

Running online

Running offline

  • Download source.code.zip from here
  • Extract the folder
  • Run index.html file in the browser

  • Sure, open an issue, point out errors, and what not. Wanna fix something yourselves, you're welcome to open a pull request and I appreciate it.

Browser support

Chrome Firefox IE Opera Safari
Latest ✔ Latest ✔ Latest ✔ Latest ✔ Latest ✔

If you enjoysed this game, don't forget to give a star🌟 and fork to make your own Spider-Man game

spider-man's People

Contributors

rededge967 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

spider-man's Issues

NPC not turning around in the direction of the player

Hello, nice game !
I just noticed the non-player characters aren't turning around if you pass them and aren't jumping with you, to make the game more cooler, you may consider these parts :

  1. Easy difficulty -> the game as it is now.
  2. Medium -> add the NPC turn around firing you from your back while escaping him.
  3. Hard -> add the NPC jump with you.
  4. Realistic -> add NPC can fire multiple things or take 2 of your life points if you hit his bullet.

Some hints :

  • How to know your location with respect to the NPC ?
    => Assuming you are at point 0 and the NPC at point 10 game units, then :
/**
* Positions the NPC to face the player and
* controls the NPC melee attack.
*/
void attackLoop(tpf) {
    const var distance = npc.getNPCLocation() - player.getPlayerLocation();
    if (distance < 0) {
         npc.faceToScreenLeft();
    } else if (distance > 0) {
         npc.faceToScreenRight();
    } else {
         npc.activateMeleeAttack();
    }
}

void update(tpf) {
    attackLoop(tpf);
}

What this basically does, is it gets the linear distance (not 3d distance), if the distance is zero then npc activates melee attack, distance is less than zero then that means the player is before the npc so position npc facing the left of the screen, and vice versa in case of the distance bigger than zero, you can optimize this more using the math stdlib of js.

Note : i didn't look at the sources, if you are using Vector2 or threejs then you better use the distance formula = sqrt (pow(x2 - x1, 2) + pow(y2 - y1, 2));.

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.