[9] Lunar Lander WIP [4/9]
- Conlan Walker

- Nov 18, 2021
- 2 min read
Updated: Jan 3, 2022
I learnt quite a bit this week. Due to this, most 'work' isn't very quantifiable, and is locked inside my head. Firstly, over the weekend prior, I learnt some JavaScript. I did this for a few reasons, though I primarily focused on the prospect of easier usage of Construct, figuring I'd be able to write faster, more low level stuff with it.
While I still believe the latter part of the previous sentence, I can't say the same for the former. In order to work with Construct's JS ecosystem, I'll have to deal with the nightmare of committing to memory a jumble of nested child objects/methods:

Through Monday and Tuesday, I struggled with trying to understand all of this, before opting to go back to visual scripting (for now) on Wednesday, hoping to produce something to show for portfolio review.
I actually did some things with HTML canvas elements, mostly involving vector graphics, as shown here:
Using a standalone canvas enabled me to structure objects in a way that made sense to me, and allowed for easier usage, despite not using an engine. This might not come as much of a surprise, but I had an easier time with arrays and for loops in JS than I did with Construct.
As for some actual stuff involving the Moon, I've made a rough concept of how I'd keep track of the collision polygon's in relation to the Moon's angle.
In short, I'd find the two closest values in a lookup table on each side of the Moon, given its angle. I would use an array with a length of 4, which I'll call the range buffer:

The number in the middle denotes the Moon's current angle with the top and bottom two values being dedicated to those two closest indices on each side. They would shift left and right to accommodate the array's set length of 4.
If the Moon's angle changes within its current range, nothing happens to the active polygon.
If it changes enough such that it falls between a range in the range buffer, while residing outside of the range it once was, the buffer is shifted respective to the change.
If its new angle goes outside of the buffer entirely, a separate routine is called to recalculate a completely new buffer.
And that's basically it for this week.

![[158] Most Important Brick in the Least Important Wall](https://static.wixstatic.com/media/df100d_f70be6ae4318455fbbc605cd1069c6ee~mv2.jpg/v1/fill/w_980,h_410,al_c,q_85,usm_0.66_1.00_0.01,enc_avif,quality_auto/df100d_f70be6ae4318455fbbc605cd1069c6ee~mv2.jpg)
![[157] Mail Order Sacrifice](https://static.wixstatic.com/media/df100d_e284fa6c51b04524bab9d3cf9f1f6441~mv2.png/v1/fill/w_980,h_382,al_c,q_90,usm_0.66_1.00_0.01,enc_avif,quality_auto/df100d_e284fa6c51b04524bab9d3cf9f1f6441~mv2.png)
![[156] Moat of Babble](https://static.wixstatic.com/media/df100d_091e451794b14aecb494a16c15c966c3~mv2.png/v1/fill/w_980,h_705,al_c,q_90,usm_0.66_1.00_0.01,enc_avif,quality_auto/df100d_091e451794b14aecb494a16c15c966c3~mv2.png)
Comments