I decided to develop a place where visitors will be able to add creatures into “The Nest”.
It will probably not be a game where the player can do much besides adding a creature with different properties. No action or interesting quests. More like having a Tamagotchi, if you remember those “digital pets”, and just see how long it will survive depending on what´s going on in the world.
I am going to post updates here about the progress in this project, starting with the first three weeks.
20150723: SQL & Commands
Created input for commands. These commands are sent through AJAX-requests to a PHP-page and based on what the user writes, different SQL-query-commands will be sent to the SQL-database. Feedback will be echoed/printed on the PHP-page as a response to the AJAX-request and that data is then shown in consol.log (browser-log)
So, if I type: -list
My JavaScript will request “page.php?command=list” with a AJAX-call and put the response in a variable once the page has loaded. While the requested PHP-page is loading, it will try “Select * from table” and echo the result.
My JavaScript-variable will then have the result “{id:5,type:1}” from the PHP-page and print it in the browser log.

20150726: World & Creatures
After playing around with the commands, I added a column named “type”.
Every row with value 1 in “type”, will act as a creature.
The world will have value 7.
Depending on this value, every row/object will act differently in the program and be displayed differently too.
I also moved the feedback from consol.log (browser-log) to an element on the page.
20150727: Selecting & Toolbar
Added support for selecting using pointer.
Multi-selecting by holding Shift or Ctrl.
Added a toolbar.
The list-response is changed into JSON-format for easier handling. (removed string-functions for searching specific characters like { : , } and let a built-in JSON-parser do the work)
20150728: Drag & Drop
Added support for moving objects with pointer when user holds down the pointer button.
(onmousedown-function will set timer, onmouseup-function will move object if timer>0.5s)
20150801: World circle, Collisions & Buildings
The world is now displayed and functioning as a circle.
Added a function for collision detection
Added a new type of objects: Buildings
20150802: Save
Added support for saving current state in world.
20150804: Cells
Added a new type of objects: Cells.
20150807: Editor
Added a small editor for updating values on a selected object.
20150808: Designing & Moving inside cells
I created a world-image and a building-image.
Then I took a head from an old room to display creatures with something else than a circle. (Will change it later)
Creatures can move inside cells and travel between cells if they meet each other from above or below.
These cells will function as “homes” or hallways inside buildings.
20150809: Drag & Drop improvement
Selected object will have a transparent copy of itself at the pointers location until the user releases the button. The moving function snaps to a gird and won´t place objects on top of each other (unless It´s a creature that´s put in a cell). If the new position isn´t valid, the color will turn red instead of orange on the transparent copy.
When moving a building, everything inside it will follow. The moving function will also take the offset from the selected objects center, so it won´t be placed right under the pointer position when dropped.