chavi362 / Icy-Tower

An interactive Icy Tower Game built with Java Script, html, and CSS. Let's come to contribute or play!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug: hero drops

chavi362 opened this issue · comments

After you get 12 points or more sometimes the character just drops for no reason so it's hard to get a good score in the game.
In order to solve it, you have to find the problem in tower.js
Maby the problem is something with the moving blocks function but I really don't know..
If you can help me with it, I would be very happy!

@chavi362 Can you assign this issue to me, I can work on it to try resolving this bug.

Thank you so so much!!!
If you need some help please write me!
The problem should be in tower.js

@chavi362 When does this bug happen to you? Because I ran several times and it didn't happen to me.
(I mean - is it at a specific player level, for example?)
Beyond that, I think that documenting functions may also be useful in solving bugs.
Please let me know when the bug occurs.

Hello @HadassaAvimor !
I think at the beginner level it doesn't happen. Happens more at the advanced level and at the higher level. As if after I start playing suddenly the character falls. Basically, there should be a force of gravity that pulls the character down because otherwise you are not disqualified. But sometimes it gets too much.
the gravity function is this:function gravity() {
if (character.onGround == false) {
character.distanceY += game.gravity;
character.distanceY *= game.drag;
} else {
character.distanceY = 0;
}
character.distanceX *= character.onGround ? game.groundDrag : game.drag;
}
andthis declere the variables:const game = {
gravity: 1.0,
drag: 0.999,
groundDrag: 0.9,
}
But, if I do low gravity the game becams very easy. You can press consecutive short presses on the above arrow andto not fall never.
I want that the game will be like the link below . I mean that the game will be challenging but possible. Now the condition it that sometimes it's impossible (also for game expert) not to fall. I think that you'll play more you'll noticed what I mean.
I want us to work on the somersaults later. This is my goal going forward.
I want that right now those who train a lot can be very successful at any level.
I hope that you understood me, if you play the game a little you will see that sometimes you fall for no reason as if you feel that you have no control over the character.
This is a link to a video about the original play: https://www.youtube.com/watch?v=dup-U7jSHzs
Thank you so much!!
Best regard!!!
Chavi

@HadassaAvimor , I must tell you that I don't know exactly why does the problem happen,
So, maybe it has nothing to do with the gravity and it connected to the moving blocks or moovingScreen.
I'm now working on adding comments.

@HadassaAvimor , how are you?
I added comments and arranged the code in tower.js, so, I recommend you to work on the updated version.
Thank you for your work!

@chavi362 The comments are great and explain the code well.
I played the game several times and the bug you describe did not happen to me, but I tried anyway to go through the code and see if there is anything that could explain it, and I could'nt find.
If you say that at the low level the bug does not occur, I think it simply means that the game works great and the more advanced levels are difficult for the game...
In any case, I have no way to fix a bug that I don't even see, sorry...
wish you luck!

Thank you so so much!!

Again, thank you so so much!!!
Sorry for driving you crazy...
May you take another issue?
If you find this project useful or interesting, please consider giving it a star ⭐️!
Thanks
Chavi