Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411423 Posts in 69363 Topics- by 58416 Members - Latest Member: JamesAGreen

April 18, 2024, 11:56:50 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)C++ 2D videogame problem with ladder
Pages: [1]
Print
Author Topic: C++ 2D videogame problem with ladder  (Read 1350 times)
[405
TIGBaby
*


View Profile
« on: May 30, 2020, 01:14:08 PM »

Hi everyone,
I'm trying to develop a megaman-style 2D video game in C ++; I got stuck on the ladder implementation; I can't code the change of state at the end of the ladder climb.
That is, once you reach the limit of the ascent to the top, you have to get on the plane. Can anyone point me to some resource that can be useful to me?
Logged
ThemsAllTook
Administrator
Level 10
******



View Profile WWW
« Reply #1 on: May 31, 2020, 07:47:55 AM »

This isn't really answerable without knowing how you've structured your code, so I'll have to take a whole lot of guesses...

Presumably you have some sort of overlap check to see if your character is in front of a ladder to allow the climbing input to attach to it. Once that's started, one way to end the climb at the top would be to run the same check every time you move up or down to start falling when you reach the bottom, and enter the on-ground state when you reach the top. Are you having trouble detecting when the ladder ends, or positioning your character exactly on the surface at the top, or something else? What does your character controller code actually look like?
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic