Discuss Scratch

richgar04
Scratcher
17 posts

Hitboxes...............................

My hitbox wont stay on the ground no matter what!! It keeps falling into the void!
Vaibhs11
Scratcher
1000+ posts

Hitboxes...............................

can you share and link the project?
richgar04
Scratcher
17 posts

Hitboxes...............................

Vaibhs11 wrote:

can you share and link the project?
https://scratch.mit.edu/projects/599216611/
Vaibhs11
Scratcher
1000+ posts

Hitboxes...............................

It's okay for me.
Well, if turbo is on, then it'll pass through the walls

Last edited by Vaibhs11 (Nov. 28, 2021 02:53:54)

richgar04
Scratcher
17 posts

Hitboxes...............................

Vaibhs11 wrote:

It's okay for me.
Well, if turbo is on, then it'll pass through the walls
It happens after the tutorial, It would go underneath the ground.
Vaibhs11
Scratcher
1000+ posts

Hitboxes...............................

richgar04 wrote:

Vaibhs11 wrote:

It's okay for me.
Well, if turbo is on, then it'll pass through the walls
It happens after the tutorial, It would go underneath the ground.
tutorial? If it is the first level, I can't pass the level.
richgar04
Scratcher
17 posts

Hitboxes...............................

Vaibhs11 wrote:

richgar04 wrote:

Vaibhs11 wrote:

It's okay for me.
Well, if turbo is on, then it'll pass through the walls
It happens after the tutorial, It would go underneath the ground.
tutorial? If it is the first level, I can't pass the level.
After the dialouge it will be the tutorial, You use space to shoot and arrows to move
Vaibhs11
Scratcher
1000+ posts

Hitboxes...............................

richgar04 wrote:

Vaibhs11 wrote:

richgar04 wrote:

Vaibhs11 wrote:

It's okay for me.
Well, if turbo is on, then it'll pass through the walls
It happens after the tutorial, It would go underneath the ground.
tutorial? If it is the first level, I can't pass the level.
After the dialouge it will be the tutorial, You use space to shoot and arrows to move
I think the problem is, in the hitbox sprite, there is a huge waste of ifs and change y by 1's.
Replace that chunk with
defineplatformlevelrun without screen leveliftouchingplatform?thenrepeatuntilnottouchingplatform?changeyby1
Thingied
Scratcher
1000+ posts

Hitboxes...............................

Each problem will be in their individual sections.

1. Collision Failing After Tutorial
Because the hitbox doesn't show after the second cutscene ends, the hitbox of the hitbox (lol) is removed because it's hidden. The fix is to move the show block to the moveable broadcast like this:

What this does is make it show whenever it is called, which is usually after a cutscene.

2. X Collision Problems
@Vaibhs11 pointed this out so I might as well address it here.

Because the variable that stores the x velocity (I'll say Xv for short) is changed after the sprite moves, it isn't accurate to how much it has actually moved after. You kind of solved it by increasing how much it goes back but it's not full proof. The least confusing fix is to just move the friction block up so that the change in position is accurate to the actual variable after moving.

This is optional but will make the code cleaner:


Last edited by Thingied (Nov. 28, 2021 03:19:50)

Powered by DjangoBB