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

Author Topic: Simple Collision Detection needs re-writing  (Read 1212 times)

0 Members and 1 Guest are viewing this topic.

Shorefire

  • Newbie
  • *
  • Posts: 2
    • View Profile
Simple Collision Detection needs re-writing
« on: January 16, 2013, 06:02:43 am »
Hello, I have been trying but cannot seem to succeed, can someone please re-write this for SFML 2.0, it is currently not working for the latest version.  I have done some searching around and cannot find a fix, I am somewhat new to SFML so converting it to 2.0 is difficult with my limited understanding of how SFML works, a tad rusty with c++ to.

https://github.com/SFML/SFML/wiki/Source%3A-Simple-Collision-Detection

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Simple Collision Detection needs re-writing
« Reply #1 on: January 16, 2013, 06:13:24 am »
Well there has been quite a bit of changes between SFML 1.6 and SFML 2.0, so one can't directly convert the code. For instance the pixel perfect collision would probably be quite a performance killer (except if one keeps a copy of the images in the RAM and VRAM) and the GetAABB function is quite useless, since it kind exactly does, what now getGlobalBounds() does...

I'll now go to bed, but maybe I'll take another look a few hours later. :D
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Shorefire

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Simple Collision Detection needs re-writing
« Reply #2 on: January 16, 2013, 09:51:20 pm »
In that case, could you point me in the right direction of learning how to check collision with a image file, for instance, I want to be able to check collision with a collision image of my map, one being graphical for show and the other being black walls and blocks, different colors checking for different collision types, like taking damage etc.