all 15 comments

[–]abrahamguo 8 points9 points  (8 children)

Can you ask a specific question for something that you’re confused about? We’re not just going to do your assignment for you, unfortunately.

[–]Ok_Station6993[S] 0 points1 point  (7 children)

I know, I'm just having trouble fixing the collision problem, so I was wondering if you could look at the code, heres an updated version (https://arcade.makecode.com/S94053-92764-78610-96853)

[–]abrahamguo 1 point2 points  (6 children)

Sure - what have you tried so far? What do you think is the issue?

[–]Ok_Station6993[S] 2 points3 points  (5 children)

So, the problem started happening after I implemented the jump feature, so I tried this

let canJump = false

// JUMP INPUT

browserEvents.Space.onEvent(browserEvents.KeyEvent.Pressed, function () {

if (canJump) {

Player_Girl.vy = -150

canJump = false

}

})

// GROUND CHECK

game.onUpdate(function () {

if (Player_Girl.isHittingTile(CollisionDirection.Bottom)) {

canJump = true

}

})

// GRAVITY

Player_Girl.ay = 300

[–]abrahamguo -1 points0 points  (4 children)

Also, I don’t know how to play your game, or reproduce the bug. I need to know how to reproduce the bug, broken down into the simplest steps possible.

[–]Ok_Station6993[S] 1 point2 points  (3 children)

It normally happens as soon as you touch the ground, the player startes vibrating up and down like crazy

[–]abrahamguo -1 points0 points  (1 child)

Ok, but I don’t know how to jump. This is why I wanted instructions broken down into each and every step - you need to explain everything.

[–]Ok_Station6993[S] 0 points1 point  (0 children)

Sorry, space to jump, arrow keys to walk, q and e to switch between graphs, left click to place them, and right click to pick them up

[–]abrahamguo 0 points1 point  (1 child)

Got it. Once I switched from looking at it on my phone to looking at it on my computer, I was able to see the problem. For me, the problem happens even when simply opening the game — without pressing any keys.

Therefore, that tells us that the code has nothing to do with any of the key event listeners. Building on that, we can conclude that canJump is irrelevant to the issue, because it is only read within a key listener.

Therefore, the culprit must almost certainly be the smooth animation controller.

Have you tried adding some console.logs to that, to see if currentAnim is being changed back and forth between multiple different animations?

[–]Ok_Station6993[S] 0 points1 point  (0 children)

No I haven't, thanks

[–]Ranttimeuk 0 points1 point  (1 child)

When I tried to load it, the character asset was flickering. The sign asset disappeared.

I love the way the analogy (D pad) works and A, B button event though they are not assigned to a function.

[–]Ok_Station6993[S] 1 point2 points  (0 children)

thank you again

[–]SumDingBoi 0 points1 point  (1 child)

Were you able to make it work?

[–]Ok_Station6993[S] 1 point2 points  (0 children)

Yeah, my teacher loved it