Friday, May 9, 2014

Simple Platformer Day 4

Day 4: 
Thanks to Herbie Piland for the fantastic teaching session in lists.


Figured out the first bit of the spawning pick-up puzzle: picking randomized yet pre-determined positions.

yay!  Just a console message now but so happy :)


Next up: 
  • Figure out how to spawn objects using that coordinate.
  • Bonus: randomly pick from 3 objects.
  • Make pick-up disappear on collision with player.
Learned stuff:

For loop:
for (int i = Random.Range(3,6); i>0; i--) {}

Write to debug log:
Debug.Log("hello");

List of Vector2 coordinates:
protected List<Vector2> coordinatePool = new List<Vector2>(new Vector2[]{new Vector2(5.0f,5.0f),new Vector2(10.0f,10.0f)};

Making templist to keep original list intact:
List<Vector2> tempCoordinatePool = new List<Vector2>(coordinatePool);

Picking a random item from the list:
int randomNumber = Random.Range(0,tempCoordinatePool.Count);
Vector2 spawnCoordinate = tempCoordinatePool[randomNumber];


Removing said item from list to prevent duplicate:
tempCoordinatePool.RemoveAt(randomNumber);

Wednesday, May 7, 2014

Simple Platformer 1 Day 03




Day 3

  • Converted gamecontrol script to C#
  • Figured out how to create a multi-dimensional array for potential flower spawning
  • Could not get a random number generator to work
  • Could not figure out how to pull coordinates from the array

Next
  • Extensively look into random number generator and array
  • Figure out how to spawn objects in predetermined coordinates
  • If I cannot figure out randomized coordinate-picking in 2 days, will instead go for randomly picking on/off switch at the start of the level on pre-determined pickup locations

Tuesday, May 6, 2014

Simple Platformer 1 Day 02

Day 2:
  • Created ground check using layer masks and improved jump function
  • Created background
  • Created invisible blocking boxes
  • Created art for pick-up but no functionality yet
  • Bonus: learned how to make character flip to face walking direction
Next Steps:
  • Figure out how to make flowers spawn randomly
  • Make flowers disappear when walked over by player
  • Kill floor - bottom collision box kills player and restarts game

Monday, May 5, 2014

Learning Project 1: Simple Platformer 1

Target Feature list:
  • Player that can move left, right, and jump (once before landing)
  • Simple platforms that collide with player
  • Scene boundries
  • A background layer
  • Score board
  • 1 pickup item that adds 1 to score
  • 1 enemy that moves on a pre-determined path, kills player on contact
  • restart button that appears after player dies
BTL features:
  • 1 new pickup item that grands double-jump
  • Win condition and win screen
  • Player shoots a projectile that kills enemies
  • 1 new enemy that chases the player
  • Trap tile that kills the player
  • Player health bar
  • 1 new pickup item that restores player health
  • High score board


Day 1:

Made 1 platform that collides with player.
Made 1 player that can be controlled to move left, right, and jump - currently unlimited.

Day 1 Lunch:

Downloaded sample project bundle http://u3d.as/content/m2h/c-game-examples/1sG
Converted player control script to C#.

Plans for Day 2:

Figure out how to limit the player to jump only once before landing.
Make a background image
Make scene boundries
Make a pickup item that spawns randomly