Thoughts on collision?
3 months ago
United States

Room 3 seems to have some buggy collision that isnt consistent with when it happens. Any thoughts on why and how it can become consistent?

California, USA

ill test it out

how i discovered it was random and it seems to be a short time window when you can go through it and only about 60% of the time it works for me

United States

I took a look at the code for the game, here's what I came up with

Basically a part of the collision code says if the players outline (black) touches a black line, move up by 2, then it says if the players outline touches a brown line, move down by 2. I think the black line code prevents the player from going through the ground (which in most of the levels are black). As for the brown lines I'm assuming that the color brown is used for ceilings.

In room 3 its quite noticeable that the first line is split into a thicker brown line and a thin black line on top, brown for the lower section of the area, and the black thin line for ground the player can land on when getting to the middle section.

I'm still not exactly sure what causes a non-black color of the sprite to touch the but it might have something to do with the sprites orientation and y speed (how fast the player sprite moves upwards).

I drew a crude diagram on what I think is going on

While typing this out I think I might have found out why its so inconsistent, heres a quote from the scratch forums by user nXIII, "...after each iteration of a control structure (like <forever> or <repeat ()>) Scratch stops executing the current script and goes on to the next one (this is called yielding)..."

United States

I just realized I didn't do a great job on explaining why i think yielding causes it to be inconsistent, its most likely controlled by the time you take to go through rooms 1-3 and then when you touch the line in room 3, im guessing because of the large size of the collision script in jetpack, scratch cycles through each <if ____ then> block, so theres certain times where you can phase upwards and when you cant phase upwards

Utah, USA

Changing directions just before hitting the ceiling seems to makes that glitch more consistent, possibly because the sprite is changing costumes. It still doesn't seem completely consistent so it might be precise or I'm just imagining things.

United States

Ive seen that in my testing as well.

United States

My only thought on that is that changing directions right before touching the ceiling adds the tiniest of time for scratch to yield to the right bit of code, it's very much possible to create an external program to show the exact time it would take to get the right scratch yield, I'll see what I can do in making level 3 more consistent, maybe if we get the consistency down we can find more time saves in the other rooms (related to collision).

California, USA

for me i have some step ups allowing me to hit it 15 times in a row, but they are hard to explain

United States

Well the answer to getting the collision right is simple

Do a set of actions that will get the exact time of the right scratch yield.

If the steps easy to do multiple times and save the most time its consistent.

Статистика игры
Подписчики
3
Времена
15
Игроки
5
Последние запуски
Последние темы
Опубликовано 3 months ago
games:thread_reply_count
Опубликовано 3 months ago
games:thread_reply_count
Модераторы