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

Author Topic: Help in moving sprite  (Read 1516 times)

0 Members and 1 Guest are viewing this topic.

mnajrg

  • Newbie
  • *
  • Posts: 26
    • View Profile
Help in moving sprite
« on: November 28, 2012, 06:35:32 am »
How can I make a simple sprite move on the screen like a ball?

masskiller

  • Sr. Member
  • ****
  • Posts: 284
  • Pointers to Functions rock!
    • MSN Messenger - kyogre_jb@hotmail.com
    • View Profile
    • Email
Re: Help in moving sprite
« Reply #1 on: November 28, 2012, 06:46:48 am »
Read this: http://en.sfml-dev.org/forums/index.php?topic=5559.0 Please.

Your question nearly makes no sense for anyone that's not inside your head.
Programmer, Artist, Composer and Storyline/Script Writer of "Origin of Magic". If all goes well this could turn into a commercial project!

Finally back into the programming world!

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
AW: Help in moving sprite
« Reply #2 on: November 28, 2012, 09:06:37 am »
To move a sprite or a shape you can use move():
sf::CirlceShape ball(10.f);
// ...
ball.move(10.f, 10.f);
If you want some physics you need to implement it or use an existing library. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/