Giter Site home page Giter Site logo

chessmasterhong / impact-atmosphere Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 0.0 1.41 MB

Atmospheric weather, day/night cycle, and seasonal cycle simulator for ImpactJS

Home Page: http://chessmasterhong.bitbucket.org/projects/impact-atmosphere

License: MIT License

JavaScript 95.55% HTML 4.45%

impact-atmosphere's Introduction

Impact Atmospheric System Plugin

A plugin for the Impact game engine that simulates an atmospheric weather system, day/night cycless, and seasonal cycles based on configurable date, time, and geographical coordinates.

Features

  • General
    • Configurable time speed multiplier to cycle through day and night faster or slower
    • Configurable update rate to update plugin more or less frequently
    • Configurable initial plugin date and time
    • Configurable geographical coordinates
    • Configurable brightness/darkness of nights (for those who like brighter/darker nights)
  • Day/Night Cycle System
    • Variable length of day and night based on day of year and geographical coordinates
    • Dynamic ambient brightness during sunrise and sunset
  • Seasonal Cycle System
    • Variable solstice (Summer/Estival, Winter/Hibernal) and equinox (Spring/Vernal, Autumn/Autumnal) based on year
    • Current season detection based on current date and time relative to year
  • Weather System
    • Weather conditions (clear, rain, snow, lightning, fog)
    • Configurable maximum particles (snow particles, raindrops)
    • Configurable frequency of lightning

Demonstration

Visit http://chessmasterhong.bitbucket.org/projects/impact-atmosphere for a working live demonstration of the plugin. The version of the demo at this link may not reflect the latest changes of the plugin.

If you would rather set it up yourself, located in the demo directory is a pre-configured setup of the plugin. I also use this as my development testing grounds, so it should be up-to-date. All you need is the Impact game engine source code (sorry, batteries not included).

Installation and Setup

  1. Download and place the file atmosphere.js in your lib/plugins/ directory.

  2. Add 'plugins.atmosphere' to the .requires( ... ) section of your main game.

  3. In the init method of your main game, add one (and only one) of the following:

    a. To use all default settings:

     // Start from current date and time, updating every 60 seconds, running at 1x real time
     this.atmosphere = new ig.Atmosphere();
    

    b. To specify a custom date and time, but leave the other arguments to default:

     // Start from April 14, 2014 5:23:37 PM, updating every 60 seconds, running at 1x real time
     this.atmosphere = new ig.Atmosphere(new Date(2014, 3, 14, 17, 23, 37));
    

    c. To specify a custom date and time and update rate, but leave the other arguments to default:

     // Start from April 14, 2014 5:23:37 PM, updating every 15 seconds, running at 1x real time
     this.atmosphere = new ig.Atmosphere(new Date(2014, 3, 14, 17, 23, 37), 15);
    

    d. To specify a custom date and time, update rate, and timescale:

     // Start from April 14, 2014 5:23:37 PM, updating every 15 seconds, running at 6x real time
     this.atmosphere = new ig.Atmosphere(new Date(2014, 3, 14, 17, 23, 37), 15, 6);
    
  4. In the update method of your main game, add the following:

     this.atmosphere.update();
    
  5. In the draw method of your main game, add the following after this.parent():

     this.atmosphere.draw();
    
  6. That's it! Start up your game and enjoy!

If you are still unclear about the usage, see the main.js file in the demo/lib/game/ directory for additional details.

Bugs and Known Issues

See the Issue Tracker for a list of current bugs and issues.

TODO

See the Issue Tracker for a potential list of stuff to do.

Credits

Based on

Additional resources

Disclaimer

I would like to emphasize that although this plugin utilizes computations from various creditable sources, its implementation is rather naive and has not been thoroughly tested for accuracy or validity. In addition, it may potentially contain computational inconsistencies or errors. The original purpose and intent was to roughly simulate a realistic atmospheric system for a potential game. As a result, I strongly discourage the use of this plugin for sensitive projects or research. Instead, please consult more creditable, well-tested sources for such purposes.

Licence

The plugin's source code is released under the MIT Licence.

This plugin requires the Impact game engine. The game engine is under the terms of a separate commercial licence and is not provided with the plugin.

All artworks are available under their own separate licences. For their licencing details, visit the respective link under the Additional Resources section of the README.

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.