Giter VIP home page Giter VIP logo

tyrian-city's Introduction

tyrian-city

Procedural city with ES6

Development

To get started, you'll need the following global packages:

sudo npm install -g mocha babel gulp

Then install the local project packages:

npm install

You can run tests with:

mocha test

Gulp

Gulp is used for the following:

  • Compiling ES6 to ES5 with Babel.
  • Bundling the application with browserify.
  • Concatenation and minification.
  • Watching for code changes.

Generate a build in public/build with:

gulp clean && gulp build

tyrian-city's People

Contributors

codenameyau avatar

Watchers

James Cloos avatar  avatar

Forkers

rlugojr

tyrian-city's Issues

Random building generator

Given these parameters: length, width, height, and maybe category generate a building. Instead of manually coding the building structure, use an algorithm to generate the structure.

Use browserify

This is an excellent opportunity to use browserify for a fairly large project. It's a setup for testing code using mocha.

Road curve generation algorithm

This will be a fun algorithm. The road should be be dynamic and curve based on its neighbors. Think about how sim city roads work when you lay them down. You do a search on its neighbors.

Flattened merged layer

So far I have two layers, the street layer and the building layer. There should be a built-in layer called the merged layer.

Design core module

This module defines the core TyrianCity logic and city generation algorithm. I'm going to keep this backend completely modular from the frontend and rendering process. That means Playground will be used in the renderer module.

Create gulpfile pipeline

The gulp task runner should support:

  • ES6 compilation
  • Standard pipeline

Investigate whether the closure compiler might be useful.

Canvas minimap for 2D renderer

Since the 3D renderer module will be completely separated from the data abstraction, you can create a minimap as the 2D renderer. It will be fun.

Gulp watch tasks

Continuation of #32.
Create a watch for the stylesheets, js lib and source files. Use gulp-watch to handle errors.

Tests for core module

Write tests using pubtest to make sure everything works properly before passing the module into the rendering engine.

Install babel

Create a package.json. The goal is to move front-end tests to the backend.

Plan fundamental classes

Here's what I brainstormed:

  • Unit: used for easy scaling.
  • Cell: used for groundwork.
  • Layer: 2D array of cells.
  • Zone: Abstract class for zoning such as streets or buildings.

Add relationship between CityMap and CityLayer

The interface for CityMap should encapsulate CityLayer. That way a programmer only needs to work with the CityMap. Create an object property on CityMap called layers. The keys will be the layer name and the value will be the layer.

Find more time

This project has been on hiatus for the past two weeks. Please find more time to work on this project.

Here are some suggestions:

Avoid using the computer while eating. I usually end up watching like 2-3 episodes of whatever and feel like napping afterwards. If I can finish eating in 10 minutes by being away from a computer, I could potentially gain 5-10 hours every week.

Uberman programming. Try to sleep at 10PM and wake up at 2AM (4 hours). Then program for a few hours and go back to sleep, say around 5PM. You get double the amount of new neural connections made from biphasic sleep. Plus it's uninterrupted time during peak programming efficiency.

Street direction

I'm currently working on the street generator and street direction is something that popped up. For this instance of the street generator, I'm going to ignore street direction. Nonetheless, I'm keeping this issue open for the future.

Streets should be generated in the x1, y1, x2, y2 positions that were defined.

Create module for Zone

Land is split between infrastructure and zone. Zones determine the type of land that occupies a cell.

These are the zones that should be available.

  • commercial
  • residential
  • industrial

These are the infrastructure.

  • park
  • street

Create the following classes

CityZone
  - type
  - cell

Road generation fundamental: straight

Create a straight path.

straight -> (x1, y1, x2, y2)

Fills the layer with all street zones. Find a way to make to make this work regardless of direction. That means x1 can be greater or less than x2.

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.