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
#1
I have vector ("Asteroids") type movement and I want my player sprite to bounce of things they bump into.

It is best to use 2 .spritecollide checks, one for vertical walls and one for horizontal? That won't work for a tile that can be hit from both angles.

I'm sure it's been done a million times, but I could sure use help finding where to start. Can I somehow check what side of a tile is hit?
Reply


Messages In This Thread
Making Player Sprite Ricochet of walls - by michael1789 - Jun-03-2019, 07:58 AM

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,328 Mar-07-2020, 12:32 PM
Last Post: Kris1996
  [PyGame] Sprite image.get_rect() moves sprite to 0, 0 michael1789 2 4,600 Dec-13-2019, 08:37 PM
Last Post: michael1789
  How to place walls in random dungeon ? michael1789 5 4,027 Nov-11-2019, 12:12 AM
Last Post: michael1789
  Sprite not rendering Clunk_Head 2 2,140 Oct-03-2019, 11:27 AM
Last Post: Clunk_Head
  Need help making a sprite GalaxyCoyote 4 3,238 Aug-11-2019, 09:12 PM
Last Post: metulburr
  moving a sprite pfaber11 3 2,587 May-15-2019, 12:52 PM
Last Post: pfaber11
  Raycasting(again) walls with different heights robie972003 0 2,456 Mar-23-2019, 01:18 AM
Last Post: robie972003
  [PyGame] Need Help With Sprite ghost0fkarma 2 3,285 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