Perlin Noise Terrain Generation

Terrain Gen Demo on GitHub

What this small project does is generate terrain patterns in Unity using 2D Perlin Noise. The script that I wrote for this demo is very reusable, but does have to be put on a terrain object for it to work, or at least something with a Terrain Data component. The main part of this script is the method where I loop through the TerrainData component’s height map, and set each value equal to a Mathf.PerlinNoise value.

perlinnoiseterrain
Perlin Noise Terrain

The fields for this script are simple:

A private TerrainData object

A public Vector3 value that is used to apply the size of the terrain that you want

A public int so that you can adjust the Terrain heightmap Resolution

2 public float that are limited to a range of between 0.0 and 1.0. I use tha [Range(0,1)] modifier here so that it is a nice slider in the Unity Editor, making it easier on me and others in the future.

Here is what the inspector looks like for this component

terraingeninspector
Component’s Inspector

This was a class assignment for my IGME 202.04 class(Interactive Media Development), with Professor Erin Casciolli, and I did get a 100% on it.

Ship Shooter 0.11

Ship Shooter on GitHub

So I have fixed a couple issues with this Ship Shooter game, and come with a couple more.

  1. The player has health now and can take a couple hits, but I am still working on making a pretty little health bar .
  2. The buttons can kinda scale for different resolutions, but it still does not work exactly how I want it to so there is more to come on that front.

I am going to be taking a break from this project for a little while until I can set some other things straight.

Things that I want to add:

  1. Scrolling background
  2. UI health bars
  3. Enemy distribution, spawn waves instead of just all at once.

Ship Shooter 0.1

Ship Shooter on GitHub

This game is a small and simple Unity game that I have made over the past holiday weekend, and into the week a little bit. The player controls a space ship, and shoots at the on coming aliens. Any aliens that the player misses, go on to hit a collider behind the player that I am using as the “Earth”. If the health of the earth gets to zero, the game is over. The player also loses if they get hit by an alien at all. For right now I am just using box colliders on all of the sprites, but I plan on making a more exact collider for each asset in time.

I am going back and forth with how I want to do the alien spawning, however. I have tried just having the amount of aliens increase with the players score, but there comes a point when there are just too many aliens coming at the player, and it becomes pretty much impossible.

There are a lot of other things that I want to add to this game, and I have learned a lot so far, which is really exciting. I love learning new stuff and better ways to do things.

I have also gotten a lot better with Photoshop, which is what I have been using to make the assets for this game. So far I have made everything myself when it comes to the assets.

Here are couple issues that I am aware of right now and working forward to fix:

  1. The aliens kill each other if they hit each other. I did this on purpose for now. I want to come up with a way to change the fact that they will hit each other at all, but for now, it is what it is.
  2. When you die, and are using a controller you can only select “Restart”, not “Menu”. I’m not really sure why this is happening as of right now, since you can select all the buttons at the main menu. It must have something to do with the button being at an angle to the other one.
  3. At certain resolutions, the buttons on the main menu all blur together on top of each other. This must be one of the settings that I haven’t checked out yet.
  4. The options button does nothing for now, later on I plan on having it be able to adjust volume, resolution, etc.

Here are a couple things that I want to add to this game soon

  1. Change how the scoring is going to be done by adding a timer, and you have to defend the Earth for a certain amount of time while keeping the health of the earth above a certain amount. I think that I can make a script for this so that I can make multiple levels easily.
  2. Fix the menu system, and make sure that the buttons scale properly at different resolutions. Right now it seems that the smaller the resolution that you play at, the more condensed the buttons are.
  3. Make a way to tell the player the controls in a fun and cool way.
  4. Also, make better controls for the keyboard and mouse. I say this because the first person other then me that played this said almost immediately “You need better controls”
  5. I’m thinking keep WASD for movement, but get rid of the mouse click to shoot. I will probably just switch that to the space bar. However I do like the mouse being involved, so maybe I will keep the controls but add the space bar for a special attack later down the line. I haven’t decided yet.
  6. Make a power up for the player to use that increases the speed of the gun for a certain amount of time. Also maybe some kind of bomb like in Geometry Wars or something.
  7. Make more then one kind of enemy, like ones that shoot back at you and at Earth
  8. Give the player health instead of a one hit one kill

Copyright Benjamin Hoffman 2016