ToDo List/Game

ToDo List/Game

Place a description in the Items field and put a time (in minutes) for how long the task will take and click Add Item. When complete, click the Complete button and that will strengthen your character.


Desktop Version      Mobile Version

Player must try to collect the diamond. They can click/touch the screen to create blocks to get to the diamond. Enemies can destroy any created blocks on touch.
Created Blocks can be removed by clicking/touching them again.


Unity Game Tutorial

Tuesday, May 7, 2013

Random Level Generator

I added a random level generator to the game. It generates 12 blocks between 120 and 480 on the x axis and between 60 and 330 on the y axis. The code is as below...

for (var  i = 0; i < 12;  i++)
    var x = Math.floor((Math.random()*10)+3) *40;
    var y = Math.floor((Math.random()*9)+2) *30;

    rects.push(rect(x, y, 20, 20));

The first 8 levels are randomly generated then the last 2 are pre generated.

No comments:

Post a Comment