Git Product home page Git Product logo

dantzlerwolfe.github.io's Introduction

Hi! I'm John. Welcome to Domtastic.

I started this project to help me understand chapter 15 of Marijn Haverbeke's Eloquent Javascript by adapting his code to a simple projectile game I've called DOMTASTIC. The goal is to achieve, through customization, an understanding of the underlying techniques used in the chapter, including encapsulation, use of higher-order functions and basic asynchronous programming.

##Playing the Game## Go to dantzlerwolfe.github.io. This game is a browser game and was not designed responsively. Also, please use chrome or firefox. It will not work without javascript. So to get the best (and maybe only) experience, please use a laptop/desktop with a JS enabled browser.

##Unique/Heavily Modified Elements## While I often used Haverbeke's code as a conceptual (and sometimes actual) starting point, you will notice that most of Domtastic's components are completely unique or are heavily customized variants of Haverbeke's sample code. Here is a list of the most unique or heavily customized sections of the program:

  1. Simple Projectile Motion: I added constant acceleration equations to handle simple motion of objects in freefall (See math/physics section of the main script). This was good enough to handle the limited physics required by the game environment. The Launcher.prototype.fire() method uses the global impulse() method to launch projectiles. Those projectiles, in turn obey our constant acceleration equations after the launch process is over.
  2. Obstacle Handling: Instead of setting collision behaviors based on a fixed boundary (which Haverbeke does for collisions with the static grid), I've made each collision an object to object interaction. The user can define the result of a given collision by modifying an object's interact method. One consequence of this approach is that an object must have a lot of information about the path it has taken to a given collision. To handle this, Domtastic uses an object's "leading corner" as its reference point. The yTest and dZone methods provide outcomes for various approach vectors, and those outcomes in turn affect the way the Level.interactWith method handles the collisions. While this is my favorite part of the program, it also could use extensive conceptual improvement. For those who are interested, there is a taxonomy of weird bounces on Domtastic's Trello Board. In order to really see the odd collisions that do occur, it's best to comment out the sections of the code that shrink and destroy projectiles so that projectiles bounce around indefinitely inside of a level.
  3. The Message Board: What's an old school game without some classic text feedback? The messageboard is a sprawling family of event listeners that deliver near-clever quips in response to various achievements or disasters. In addition, the messageboard (for better or worse) is partially managed by the pauseToggler method on the Level object.
  4. Interactions and Effects: While not as code-intensive, the special interactions (like the shrinking projectiles or exploding targets) were a lot of fun to conceptualize and code. I hope to improve on a great number of things from this category in future iterations.

Feedback and suggestions are very welcome. This was an exploratory project. I learned a lot, but there is still a long way to go before I can feel at ease with javascript.

##Styling## I used bootstrap's online customization form. Here's the configuration gist. Click here for further customization. From my perspective, the most pressing visual design issues are the non-responsive design, choppy animations and some problems with the color scheme. From a game design perspective, I'd like to add a keystroke interface and improve the overall game mechanics.

##Sound Credits:## All of the sounds came from freesound.org. I normalized volumes and made simple modifications using twistedwave.com.

  1. Game Winning Theme, zagi2, Hard Bassline Groove
  2. Earth Theme, cormi, Night in the Forest
  3. Mars Theme, noirenex, Sci-Fi Alarm
  4. Jupiter Theme, ERH, Sci-Fi Menace
  5. Launcher Effect, Setuniman, boing OH_16m
  6. Small Explosion, juskiddink, Distant Explosion
  7. Large Explosion, ryansnook, Big Explosion
  8. Projectile Bounce, martian, Chorused Bounces
  9. Projectile Vanish, ljudman, TV
  10. Alien Taunt, james ducket, Feeble Efforts

##To Do List## There is a big to do list for this game. It can be found on trello. I plan to keep it there until there's good reason not to. A lot of the coding and debugging I did is described there. The notes are not necessarily written for clarity but served more as placeholders for me so that I could easily hit the ground running after time off from the project.

dantzlerwolfe.github.io's People

Contributors

dantzlerwolfe avatar

Watchers

James Cloos avatar  avatar

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.