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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - CodingNewbie

Pages: [1]
1
General / Collision Detection Issue
« on: October 19, 2013, 12:15:44 am »
Hello everyone.  I am using the TMX Map Loader to load the .tmx files from the Tiled Map Editor.  In the documentation they have a section covering collision detection with this snippet of code:

bool collision;
    for(auto layer = mll.GetLayers().begin(); layer != mll.GetLayers().end(); ++layer)
    {
        if(layer->name == "Test")
        {
            for(auto object = layer->objects.begin(); object != layer->objects.end(); ++object)
            {
                                collision = object->Contains(point);
            }
        }
    }
 

For the line
collision = object->Contains(point);
, am I right to use something along the lines of animatedSprite.getPosition() in place of point?  Also, when I try to use that code to determine whether or not Collision is true or false, it is always true.  For example, if I make a move condition for my sprite stating that they can move if collision is false, else they cannot move, they will never be able to move.

I'm sure this didn't come out as clearly as it sounded in my head.  Any help with this would be greatly appreciated!


2
Graphics / Sprite animation with inconsistant sprite sizes
« on: October 13, 2013, 07:28:29 am »
Hello everyone.  I'm currently trying to animate a sprite with SFML, but I'm running into an issue because all the guides I can find on it assume that every sprite is the same (16x16, 32x32, etc).  Mine are any 3 of these sizes:
 
 - 60x76
 - 56x76
 - 56x72

Any help with this would be greatly appreciated.  In case any of you are wondering, I attached the sprite sheet I'm using (making a Pallet Town clone from Pokemon Fire Red):



 

Pages: [1]