Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Top ladder problem

Author
Message
Behdadsoft
14
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 16th Aug 2014 13:07
Hi.

I make a character that can move up ladder. but there is a little Problem, that when character move up ladder after Reach to top ladder if try move up more, character jump at top ladder.

here is my code:

Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 16th Aug 2014 16:37
Hmmmm, not sure you want to use the physics gravity like that - I mean what will happen to the other sprites!

I would do a point check for the ladder where the player is and also at their feet, then nerf the Y velocity of the sprite if the player is on the ladder. So you'd need a state variable for if the player is on the ladder, then if the point checks fail, the state is set to 0.

I am the one who knocks...
Behdadsoft
14
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 16th Aug 2014 18:57
I add a up variable to chect player is up or not. but don't work good. this code:

Behdadsoft
14
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 17th Aug 2014 15:44
can anyone help me?
3d point in space
14
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 17th Aug 2014 18:28 Edited at: 17th Aug 2014 18:37
I done it in c++ a long time ago and you are using VB. This is what I did.

When my character jumped it looked to see if it was in the range of the latter. If it was in that range it called a function that made the checked how long ago you pressed the jump button on a latter. The timer function will look 1 second before it try's to find latters again. This way your character can get of the latter. I believe that you can make a if statement that checks how long ago you pressed the jump button.

instead of a timer you could make a variable that increments every loop. Call the variable lasttimepressedjumponlatter when you are on the latter reset this variable to 0 then use a if statement to check in the variable is less then 300. If the variable is grater than 300 than check to see if you contact a latter.

I believe there is a timer function that allows you to see how long ago you pressed a button.

Developer of Space Chips, pianobasic, zipzapzoom, and vet pinball apps. Developed the tiled map engine seen on the showcase. Veteran for the military.
Behdadsoft
14
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 17th Aug 2014 19:47
AGK have bug because in other engine I used this way and work very well but in AppGameKit every thing is different and not work good.

Login to post a reply

Server time is: 2024-03-28 16:07:13
Your offset time is: 2024-03-28 16:07:13