dev1 – moron test icon data structures

On Tuesday you worked on an abstraction of the text icon and Font Awesome icon properties. Now it’s time to create a data structure for each scene’s set of icons that you worked on last week.

Each icon in a scene will be represented by an object with a set of key value pairs. All the icon objects created for a scene will then be stored in a single array. It’s going to be useful to place the icon objects in an array in a consistent manor to make writing future ‘tests’ a little easier. So order the objects based on the icon positions left to right.

For example:

The icons data structure for the above layout should be something like:

var ghosts = [
    {/*pink*/}, 
    {/*orange*/}, 
    {/*cyan*/}, 
    {/*red*/}
]

Problem Set

Create array of icon objects for each scene. Save these in a JS file in version 2 of the moron test:

  • moron-test/v2/img/two-images-to-be-used-later
    moron-test/v2/style.css
    moron-test/v2/index.html (boilerplate of game keep original)
    moron-test/v2/scene-number.html (have as many copies as scenes your tasked with rebuilding)
  • moron-test/v2/moron.js (Should have an array of icon objects for each scene. Save as a variable each array and name it iconsXX where ‘XX’ is the two digit scene number.

Join the Conversation

1 Comment

Leave a comment

Your email address will not be published. Required fields are marked *

css.php