1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2012
    Rep Power

    Game Design: How to draw Sprites in Partial Grid Squares


    I have been puzzling over a question for a couple months in regards the system that is used to draw objects for a game. I have thought of using a grid to draw sprites and detect collisions. That scheme makes sense to me.

    However, I started to wonder about the possibility of a sprite that takes up half of a square on a grid. I figured there had to be a system where I could draw a two sprites that take up half of the same square on a grid. At that point we really aren't talking about a grid anymore or maybe we are talking about a smaller grid within that square on the grid.

    As you can see, I'm rather puzzled by how this is implemented. I'm hoping that there is someone who can point me in the direction of a technique that is used for implementing this.

    Cheers, Cam.
  2. #2
  3. Lord of the Dance
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Oct 2003
    Rep Power
    Have you tried to search for game collision detection 2d

    IMO, moving object should be controlled at pixel position.
    The simple is to have an invisible box and use the x,y value of the four corners to see whether there is a "hit"/collision.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Rep Power

    Lightbulb Use some physics engine

    Though you can use some simple techniques like bounding box, or bounding circle. But I would suggest that you use some physics engine for some serious game development. Box2D is a famous 2D game physics engine...became famous after its use in Angry Birds. For 3D, you must try something like Unity3D or other free engines and editors.

    Comments on this post

    • Cameron0960 agrees : Thanks for the info. I started looking into Box2D. Tutorial away!

IMN logo majestic logo threadwatch logo seochat tools logo