Python Forum
[PyGame] Making Player Sprite Ricochet of walls
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyGame] Making Player Sprite Ricochet of walls
#4
(Jun-03-2019, 12:28 PM)metulburr Wrote: By tile; do you mean tilemaps or do you mean a 4 sided object?

It's txt file that is read and translated into a map of 32X32 tile sprites. I'll look at the pong code and see what it is, but if there are sprite groups for walls and paddles, that won't be useful if there is a single tile in the room that can be hit from all sides. Will it??


(Jun-03-2019, 02:03 PM)Windspar Wrote: Use clipping rect size. Determine which is smaller. Width or Height. If even then you can says it hit both angles.
Then you can compare rect.centerx or rect.centery to collision rect.centerx or rect.centery.

ok... I think i sort of get it. Long story short, if the smallest of the remainders of the rect.centery or rect.centerx comparison will determine if it is a vertical surface or a horizontal surface?



I'll look into all of this and see where I get.

Thanks guys
Reply


Messages In This Thread
RE: Making Player Sprite Ricochet of walls - by michael1789 - Jun-03-2019, 06:12 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyGame] pygame, help with making a function to detect collision between player and enemy. Kris1996 3 3,354 Mar-07-2020, 12:32 PM
Last Post: Kris1996
  [PyGame] Sprite image.get_rect() moves sprite to 0, 0 michael1789 2 4,618 Dec-13-2019, 08:37 PM
Last Post: michael1789
  How to place walls in random dungeon ? michael1789 5 4,048 Nov-11-2019, 12:12 AM
Last Post: michael1789
  Sprite not rendering Clunk_Head 2 2,163 Oct-03-2019, 11:27 AM
Last Post: Clunk_Head
  Need help making a sprite GalaxyCoyote 4 3,260 Aug-11-2019, 09:12 PM
Last Post: metulburr
  moving a sprite pfaber11 3 2,615 May-15-2019, 12:52 PM
Last Post: pfaber11
  Raycasting(again) walls with different heights robie972003 0 2,470 Mar-23-2019, 01:18 AM
Last Post: robie972003
  [PyGame] Need Help With Sprite ghost0fkarma 2 3,302 Jan-09-2018, 02:14 PM
Last Post: ghost0fkarma

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020