[11] Lunar Lander WIP [6/9]
- Conlan Walker

- Dec 9, 2021
- 2 min read
Updated: Jan 3, 2022
This week made me feel anxiety for the first time in at least a month, not only because I wasn't able to get much done, but also because the setbacks revolved around a single, simple problem that should have taken an hour or two. I am yet again talking about the 'find closest image point to lander' function.
At no point was I able to find out why the function would return values in a seemingly arbitrary fashion. I have a hunch that it had something to do with the way I was going about the comparisons, but I haven't proven this hypothesis in any significant way.
After three days of scratching my head, I finally asked Shawn when he had some time to create a prototype to demonstrate a possible solution, which looks like this:
Its behavior seemed to align with what I was looking for, so when looking through the event sheet, I noticed an event condition that I didn't know existed:

Using this, and in the event that I have a sprite affixed to each image point, I could bypass the most frustrating part of this whole ordeal.
So I tried implementing it within the game's structure, which looks like this:
(Pinning image point sprites at start of layout:)

(The actual thing that uses the new event condition:)

When I first tested it, the function seemed to work as intended, giving consistent and correct answers without error. A problem really only made itself known after I started fiddling with, and rotating the Moon:
(I know the video is 16x9 even though the game's 4x3, I'm just too lazy to change it)
You'll notice that, even though the framerate starts at 60, it will continuously drop over time.
To be honest, I also don't know why this is happening, and I don't really want to be bothered to know it until next week.
I will now take some painkillers to cure my newly acquired migraine.
That's 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