Python Forum
[PyGame] How to stop the sprite's movement when it touches the edges of the screen?
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyGame] How to stop the sprite's movement when it touches the edges of the screen?
#2
Hi

I don't know how to solve your problem, however, it would make it easier for someone to help you if you used " insert python code" .

you can read about it above you post " please make sure to use python tags when inserting code into the forum"

example
"""this is stuff"""
import numpy as np 
data=np.zero((5,5))
....
When it is formatted like this it so much easier to work with. Just copy and paste. This way we can play around with your code and see if we can get it to work. However, I am lazy, so I don't want to manually write it into my editor :P

BR Mark
Reply


Messages In This Thread
RE: How to stop the sprite's movement when it touches the edges of the screen? - by Mark3232 - May-12-2018, 10:56 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyGame] When I hit the space bar from the home screen, it sends me to the game over screen JesusisKing 1 1,087 Apr-30-2023, 10:11 PM
Last Post: deanhystad
  Laggy Game Movement game_slayer_99 12 4,639 Oct-05-2022, 11:34 AM
Last Post: metulburr
  [PyGame] Particle movement mystery XavierPlatinum 10 3,159 Jul-09-2022, 04:28 AM
Last Post: deanhystad
  [PyGame] Isometric Movement on Tiled Map Josselin 0 2,418 Nov-02-2021, 06:56 AM
Last Post: Josselin
  [PyGame] object's movement to left leave shadow on the screen Zhaleh 3 3,228 Aug-02-2020, 09:59 PM
Last Post: nilamo
  [PyGame] Sprite image.get_rect() moves sprite to 0, 0 michael1789 2 4,665 Dec-13-2019, 08:37 PM
Last Post: michael1789
  Sprite not rendering Clunk_Head 2 2,222 Oct-03-2019, 11:27 AM
Last Post: Clunk_Head
  Using classes for room movement (text game) Lawr3y 3 6,658 Aug-20-2019, 12:40 AM
Last Post: Lawr3y
  Need help making a sprite GalaxyCoyote 4 3,340 Aug-11-2019, 09:12 PM
Last Post: metulburr
  Problem with coding for movement keys Aresofthesea 3 3,525 Jul-05-2019, 07:05 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

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