Timeline for 2D Collision Detection XNA C#
Current License: CC BY-SA 3.0
19 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 16, 2020 at 10:15 | history | edited | CommunityBot |
Commonmark migration
|
|
Aug 4, 2015 at 22:59 | history | edited | Bruno | CC BY-SA 3.0 |
edited body
|
Aug 4, 2015 at 22:19 | history | edited | Bruno | CC BY-SA 3.0 |
added 1403 characters in body
|
Aug 3, 2015 at 8:52 | history | edited | Bruno | CC BY-SA 3.0 |
code edit
|
Aug 2, 2015 at 17:45 | history | tweeted | twitter.com/#!/StackGameDev/status/627897918763204608 | ||
Aug 2, 2015 at 16:49 | history | edited | Bruno | CC BY-SA 3.0 |
edited body
|
Aug 2, 2015 at 13:31 | answer | added | jgallant | timeline score: 1 | |
Aug 2, 2015 at 8:48 | history | edited | Bruno | CC BY-SA 3.0 |
deleted 255 characters in body
|
Aug 2, 2015 at 8:41 | history | edited | Bruno | CC BY-SA 3.0 |
Another problem occured
|
Aug 2, 2015 at 2:25 | answer | added | Andrew Wilson | timeline score: 1 | |
Aug 1, 2015 at 23:19 | comment | added | dimitris93 | Glad I could help, good luck with coding | |
Aug 1, 2015 at 23:02 | comment | added | Bruno |
Position is a property which I use to determine and change the Sprite position. The properties of Rectangle(Top, Bottom, Width, Height) determine only the parameters of the sprite. Not the position! They have only get methods. And they work with integers. The position is a Vector2 data type. But you know what? Your guesses at what's wrong have helped me realize that I didn't know well the values of the Rectangle properties. Your suggestions were spot on. Here's how it should be: this.Position = new Vector2(currentPlayerPosX, platformPosY - playerHeight); This is amazing! Thank you so much!!!
|
|
Aug 1, 2015 at 18:12 | comment | added | dimitris93 | You are clearly doing something wrong. Why does the player have a Position variable when you have a Rectangle variable (bounds) which contains the position ? If rectangle's x,y is the top left corner, then set the player.y to platform.y - player.height... I think you are doing 2 things wrong. 1) you are updating the position wrongly (not considering that rectangle's top-left corner is x,y) and 2) you are drawing it using the Rectangle and not the position. So in the end player.y is (5 + player.height) pixels below from where it should be | |
Aug 1, 2015 at 17:51 | comment | added | Bruno |
That's odd! this.Position = new Vector2(currentPosX, platformTop); locks the player in the middle of the platform:screen I think this.Position means that the position coordinates start from the top left corner. But then again, shouldn't the Player top corner overlap the top platform border and not be below it?
|
|
Aug 1, 2015 at 17:16 | comment | added | Bruno | Since MovY is 5.00, the new Vector2(0, 5) subtracts 5 to keep the player from falling through the platform. It's a temporary thing. Currently I'm trying to make what you suggested. I'll write back later. It might take me some time. | |
Aug 1, 2015 at 16:57 | history | edited | Vaillancourt♦ | CC BY-SA 3.0 |
Removed the need to scroll, integrated te image in the question.
|
Aug 1, 2015 at 16:54 | comment | added | dimitris93 |
What is new Vector2(0, 5) supposed to be ? If player intersects with the platform, then move him directly on the top edge of the platform. So in pseudocode: Player.Bounds.Bottom = Platform.Bounds.Top
|
|
Aug 1, 2015 at 16:48 | review | First posts | |||
Aug 1, 2015 at 16:57 | |||||
Aug 1, 2015 at 16:43 | history | asked | Bruno | CC BY-SA 3.0 |