Results 1 to 5 of 5

Thread: Sprite Engine Collision, cmRadius , always colliding

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Hi,

    I solved it, forgot for both Bullet and Enemy movement
    Code:
     CollidePos := Point2(X, Y);
    Though I will need to modify this... CollidePos is supposed to be the center of the enemy?
    For example if I have a 32x64 enemy, the correct colidepos would be 16,32 ? and there I would set a radius of 32...
    And would create the illusion that the enemy is only destroyed if the middle of it is hit... which I think is perfectly fine, I think Jamestown used this method for
    the player ship, not sure if it was meant like this by design, or if it was just a shortcut with using Radius collision...

    Wow can't believe this, we are going somewhere... once I'm done I'll post the entire project step-by-step ... how I did it .

    Greetings
    Robert

  2. #2
    Glad to see you are progressing.

  3. #3
    This forum has a positive effect on me just by posting here I sometimes solve my own problems...

    ... and I also took a 3 hour walk in the City to clear my head.... after that ...it just hit me...

    CollisionPos is always the center of the sprite I'm checking for collision, and I must update it onMove ,...because it is constantly moving... makes sense now.
    Also radius for a circle that fits into a 32x32 square is 16...that works to now.

    I did the Editor, now I'm working in Lazarus IDE . I've cut back on a lot of features, last time I think I did the huge mistake of wanting to do everything at once, and dying painfully in the end.

    My current goals are, scrolling map, waves of enemies coming at me , firing at enemies, enemies have different hit points some take 1 hit, some 2 or 3... my ship has 3 lifes...

    I enemy ship type 1 gives 25 point , type 2 50 etc.... every 1000 points you get an extra life... game will have I hope 3-4 levels...
    A nice menu...with information...I'm thinking about doing a comic style briefing before each mission, nothing to fancy...

    Right now with the scrolling done, and the collision working, I have everything but the artwork...

    so I'm drawing right now.

    Level01 is done, going from Earth to Moon Base...

    Greetings
    Rob

  4. #4
    Welcome back Robert
    Glad to hear it is working so far

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •