Landscape Generator is An open Source web application that generates landscape drawings randomly, then gives you the ability to edit it and export it as SVG or PNG.

Overview

Landscape Generator

img

## About

Landscape Generator is An open Source web application that generates landscape drawings randomly, then gives you the ability to edit it and export it as SVG or PNG.

Usage

Web development

You can download this repository and integrate the script LandscapeGenerator.js in your html .

<script src="LandscapeGenerator.js"></script>

Or use the minified version situated under Minified folder

<script src="LandscapeGenerator.min.js"></script>

then use the following function in your main javascript file

const LG = generateLandscape(SVGelement, width, height, options);

The function return LandscapeGenerator object.

SVGelement : (dom element) (require) the dom element where the svg will be displayed it must be a svg element.

width: (number) (optional) the width of the svg , by default take the width of the parent element.

height: (number) (optional) the height of the svg, by default take the height of the parent element.

options: (object) (optional) modify the default properties of the generation, these properties are detailed further down.

After the previous function you can use this function to generate again a new landscape :

LG.generate()

You can also change the default values with the function set() example :

LG.set({
    option1 : newValue,
    option2 : newValue
})

then when you will generate again it will take the new values.

Game Development

You can use the web application in the itch.io page 👉 Landscape Generator itch.io

img

exported images can be used as background for 2d games (platform, arcade...). If desired, they are generated in such a way that they can be used as vertically repeating textures (disable sun and sunshine).

You can also export the whole scene as separate layers (useful for the parallax effect).

You can also edit the generated scene with the left panel.

Values and parameters of generation

You can change variable of the generation with both set() function and the right panel of the web application

Boolean Variables :

All the following booleans if they are true the they will be generated in the scene, and if they are false they will not

  • fogBool

  • sunBool

  • sunshineBool

  • mountainsBool

  • plainsBool

Random Variables :

When the generation starts, all variables take a random value between a minimum and maximum.

Variable in Editor Variable in javascript
Mountain Width mountainWidth
Mountain Height mountainHeight
Horizon Y horizonY
Mountains Range Number mountainsRangeNumber
Mountain Space mountainSpace
Sun Position X sunPositionX
Sun Position Y sunPositionY
Sun Radius sunRadius
Birds Number birdsNumber
Plains Number plainsNumber
Plains Height plainsHeight

If you want to change the look of your landscape you have to change the min and max variable.

The format of variable name are the same 👉 minVariableName < variableName < maxVariableName (in the editor Variable Name start with capitals and are separated by space)

example change min and max variable with set() function

LG.set({
    minMountainWidth : 100,
    maMountainnWidth : 300,
    minBirdsNumber: 0,
    maxBirdsNumber: 10
})

Note : if you want to have a fix value for a variable you just have to set the same number for the max and the min

Variables and their representation in the scene :

img

Contribution

All contributions are welcome, take a look at the todolist

TodoList

LandscapeGenerator.js :
  • Add cloud

  • Add trees (different kinds)

  • Add other kind of mountain triangle where the peak is rounded

LandscapeEdition.js :
  • Load and export presets in json file for generation

Support the project

If you find the project interesting and useful I would be really grateful if you support me on : itch.io .

External libraries

The landscapeGenerator.js has no dependencies, the web application uses some external libraries :

You might also like...

Bot that randomly posts 23,463 personalized license plate applications the California DMV received from 2015-2016 to Twitter every so often.

ca-dmv Bot that randomly posts 23,463 personalized license plate applications the California DMV received from 2015-2016 to Twitter every so often. Wa

Dec 31, 2022

To-Do List is a simple web based application that gives users an opportunity to note and organize their daily tasks. This app is built with JavaScript, HTML/CSS.

Project Name To-Do App Live Demo About Project In this feature, I built a to do list app which helps to list the tasks to be done at a particular time

Aug 18, 2022

This is a simple web application of a To-do List in which you can add, remove and edit all your tasks and also you can mark each task as completed and delete all completed ones.

To-Do List A simple web application of a to do list Built With HTML, CSS, JS, ES6 & Webpack Getting Started In this repository I created To-Do List SP

Apr 11, 2022

A script that combines a folder of SVG files into a single sprites file and generates type definitions for safe usage.

remix-sprites-example A script that combines a folder of .svg files into a single sprites.svg file and type definitions for safe usage. Technical Over

Nov 9, 2022

This Application provides basic authentication features like you can register and create account and then login and access your profile.

  This Application provides basic authentication features like you can register and create account and then login and access your profile.

Authentication API This Application provides basic authentication features like you can register and create account and then login and access your pro

Jan 17, 2022

This project is a web application that allows the user to select a location on a map, display the selected region, and capture an image of that region. The captured image is then applied as a texture to a 3D cuboid using BabylonJS.

Map-Babylon Client repo commit details https://github.com/hashmat-noorani/mapbox-babylon-client Server repo commit details https://github.com/hashmat

Mar 21, 2023

Types generator will help user to create TS types from JSON. Just paste your single object JSON the Types generator will auto-generate the interfaces for you. You can give a name for the root object

Types generator will help user to create TS types from JSON. Just paste your single object JSON the Types generator will auto-generate the interfaces for you. You can give a name for the root object

Types generator Types generator is a utility tool that will help User to create TS Interfaces from JSON. All you have to do is paste your single objec

Dec 6, 2022

🍎Transform an SVG icon into multiple themes, and generate React icons,Vue icons,svg icons

🍎Transform an SVG icon into multiple themes, and generate React icons,Vue icons,svg icons

IconPark English | 简体中文 Introduction IconPark gives access to more than 2000 high-quality icons, and introduces an interface for customizing your icon

Jan 5, 2023
Platello is a web application that randomly generates food and drink recipes based on the user's preferences.

Platello Overview Platello is a web application that randomly generates food and drink recipes based on the user's preferences. Upon loading the page,

null 4 Nov 15, 2022
Simple Cropper is a jQuery plugin which gives you ability to add cropping functionality to your web application

Simple Cropper is a jQuery plugin which gives you ability to add cropping functionality to your web application. It uses html5 canvas to create cropped images and css3, so it only works on latest browsers.

null 1 Feb 15, 2022
LiveTabs is a Javascript library that allows you to create and manage tabs on the fly. This library gives the ability to your application to act like browser tabs, making dynamic tabs.

LiveTabs Table of content Description Goals Technologies Setup Description LiveTabs is a Javascript library that allows you to create and manage tabs

Hossein Khalili 3 May 3, 2022
Todo List is a simple web-based application that gives users the ability to organize their work and life daily tasks. Built with JavaScript, HTML/CSS.

Javascript Project Todo List Using Javascript to create a simple Todo List project. Populating the todo list and then removing from the list. Built Wi

Ghazanfar Ali 9 Sep 28, 2022
A generative engine that takes various png layers on a sprite sheet format, combines them and then converts them into a .gif file

Welcome to the Generative GIF Engine v2.0.4 ?? [8 minute read] This python and node app generates layered-based gifs to create NFT gif art! It is fast

Jalagar 112 Jan 2, 2023
A generative engine that takes various png layers on a sprite sheet format, combines them and then converts them into a .gif file

Welcome to the Generative Animated Engine v3.0.1 ?? [8 minute read] This repo used to be called jalagar/Generative_Gif_Engine but because it now suppo

Jalagar 47 May 24, 2022
👨🏼‍🎨 It is a virtual blackboard, where you can make 🖌 drawings through 🖱 the mouse. You have the option to choose 🎨 colors and line thickness.

????‍?? Lets Draw ?? ÍNDICE 1. Lets-Draw 2. Realization of the Project 3. Technologies used 4. Authors 1. Lets-Draw ????‍?? It is a virtual blackboard

Rosamaria Rodriguez 2 Mar 7, 2022
Pim 4 Jun 21, 2022
Fallback for SVG images by automatically creating PNG versions on-the-fly

SVGMagic - Cross browser SVG This repository is no longer actively mainted. It has proven to be very usefull back in 2013, but these days SVGs are sup

Dirk Groenen 596 Jul 27, 2022