Code Monkey home page Code Monkey logo

thelakehouse's Introduction

🏞️🏠TheLakeHouse🏠🏞️

Cute Pixel-Art Nature-Simulation. Herbivores search for Apples, Predators hunt for Prey! Written in P5JS using the P5.Play-Library and the Planck Physics Engine.

TheLakeHouse

Copyright & Attribution

Animals & Tile-Set: chien_bleu. License according to chien_bleu: "Feel free to use any of those however you want!"

Kudos to chien_bleu! Pixel-Art is as much about the Retro-Flair as it is about Minimalism. And chien_bleu's work is minimalism at it's finest! Every Animal is made with a bare-bones, no-nonsense approach and yet they all are immediately recognizeable. Chapeau!🎩

About the Project

The Code is written in P5JS. It makes use of the P5.Play-Library. The P5.Play-Library opens up some cool possibilities, because it gives us an easy way to use the Planck Physics Engine! This is the Physics Engine used by other popular games, like Angry Birds!

Initialization

  • Generate the Background Grass-Tiles🌱
  • Generate the Lake🏞️
  • Randomly scatters a few Stones🪨
  • Randomly generate the Trees🌳
  • Randomly chooses the Predators🐺 out of a Pool of 5 (Bear🐻, Dog🐶, Fox🦊, Wolf🐺, Snake🐍) and places them randomly on the Map
  • Randomly chooses the Herbivores🐰 out of a Pool of 6 (Mouse🐁, Rabbit🐰, White Rabbit🐰, Stag🦌, Raccoon🦝, Squirrel🐿️) and places them randomly on the Map
  • Randomly scatters Apples🍎 as Food for the Herbivores🐰
  • Randomly chooses the Water-Animals out of a Pool of 7 (Frog🐸, Turtle🐢, Mallard🦆, White-Black Duck🦆, Brown Duck🦆, White Duck🦆, Grey Duck🦆) and places them on a random spot on the Lake
  • Builds the Lake-House🏠 at the Lake
  • Drops a Chest🎁 next to the Lake-House

Trees🌳

  • The Trees get generated semi-randomly. There is a check so they don't stand on top of each other
  • They also won't get placed in the Lake
  • Trees have a small Collider, so that the Animals have to walk around them

Stones🪨

  • Stones are placed randomly on the Grass
  • Stones don't have Colliders, they are Decorations only

Food🍎

  • The Food (Apples🍎) gets randomly placed on the Grass
  • Once Food is eaten, new Food will spawn in a random place, to replace the eaten Food
  • Food has a small Collider. Predators ignore Apples🍎 for Food. They can collide with the Apples and cast them away!

Prey-Animals🐰

  • There are 6 different Prey-Animals: A Mouse🐁, a Rabbit🐰, a White Rabbit🐰, a Stag🦌, a Raccoon🦝 and a Squirrel🐿️
  • All Prey-Animals will search for Food (Apples)
  • Each Prey-Animal will go to a different Apple 🍎, to avoid cluttering the Animals
  • Once a Prey-Animal has eaten an Apple, it gets a temporary Speed-Boost!
  • If a Predator-Animal gets too close, the Prey-Animal will stop searching for Food and start avoiding the Predator-Animal
  • If a Predator-Animal catches a Prey-Animal, it dies and a new Prey-Animal is spawned to replace the one that died

Predator-Animals🐺

  • There are 4 different Predator-Animals: A Snake🐍, a Bear🐻, a Fox🦊, a Wolf🐺 and a Dog🐶
  • All Predator-Animals hunt Prey-Animals
  • Each Predator-Animal will hunt a different Prey-Animal, to avoid cluttering the Predator-Animals
  • When a Predator-Animal catches and eats a Prey-Animal, it too gets a temporary Speed-Boost!
  • This means some Predator-Animals can become Apex Predators and go on long continuous Feeding-Frenzies!

Water-Animals

  • My favorite Part of this Project! 💙
  • Water-Animals don't do much, but they look the cutest, the Pixel-Art by chien_bleu absolutely shines here!
  • There are 7 different Water-Animals: A Frog🐸, a Turtle🐢, a Mallard🦆, a White-Black Duck, a Brown Duck, a White Duck and Grey Duck
  • They Spawn in a random Place on the Lake
  • Water-Animals don't do much, they just swim around on the Lake

TheLakeHouse

thelakehouse's People

Contributors

johnnyawesome avatar

Stargazers

 avatar  avatar

Watchers

 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.