HTML and CSS Reference
In-Depth Information
Objective complete - mini debriefing
We have created a loop that coninuously creates iles from the top and the iles keep
moving. The ile types are based on our integers map deined in JavaScript.
Integer map
We use an integer to represent each type of ile. In our code, we used the following
integer-type mappings:
0: empty
1: left runway
2: right runway
10: star in the space
100: obstacle
It is up to the development team to decide which integer values represents each type.
Just make sure that no two types of iles share the same integer. The following igure
shows the mapping of our ile and integer values:
In my experience, I would suggest grouping the integer by types. For example, normal iles
have a single digit; a decoraion ile starts from 10 and obstacle iles start from 100.
There are two benefits of grouping by types:
F When you look at your integer map, you can instantly have a sense of what your map
looks like. Where are the blocks? Where is the runway edge? Are there any broken
iles? You can answer these quesions easily if you have grouped the integer by types.
Have a look at the following map; which map in the following figure do you find
easier to disinguish?
Search WWH ::

Custom Search