Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Sprite  (Read 1463 times)

0 Members and 1 Guest are viewing this topic.

otacilioricardo

  • Newbie
  • *
  • Posts: 2
    • View Profile
Sprite
« on: July 31, 2013, 09:02:11 pm »
Hi.

I have a Sprite and need to know where each element is, for example: I want a ladder and climb up this ladder.
How do I?
You can identify each stair step or have to create separate?
Thank you.

datMoka

  • Newbie
  • *
  • Posts: 48
  • Wooo!
    • View Profile
Re: Sprite
« Reply #1 on: August 01, 2013, 12:02:17 am »
Hey. No offense but it doesn't sound like you know much about programming in general if you're not sure how to get around this. Programming is all about problem solving; you look at what you need to do as a problem and then plan steps and methods on how to solve said problem.

Lets look at your problem. You want a player to be able to use a ladder system.

Firstly, look at what you want to happen when the problem is solved; you want the player to be able to move upwards but only when using the stairs.

You want to know when the player is in the ladder's boundaries by using sf::FloatRect. When and only when the two bounding boxes of the player and the ladder intersect should the player be able to move upwards. You could have it simple and just move the player by -ySpeed or snap them to the ladder to make it look a bit more polished.

Hope this helps.

otacilioricardo

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Sprite
« Reply #2 on: August 01, 2013, 11:04:03 pm »
Hi datMoka.

Asked whether there is something ready in SFML. But thanks for the reply.


phil652

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
Re: Sprite
« Reply #3 on: August 01, 2013, 11:19:04 pm »
Go see this tutorial
« Last Edit: August 02, 2013, 06:09:44 pm by phil652 »