Python Forum
How can I make all of the background move as opposed to just one platform?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I make all of the background move as opposed to just one platform?
#4
I think your problem is actually here:
  def moveLeft(self):
                       
        self.xVel = 6
                       <-------- Check for collision then move if there is none.  If there is, 
                                 self.xVel = 0
  
    def moveRight(self):
 
        self.xVel = -6


It's just if you push a key the screen moves. But if there is a block in the way then you don't want that to happen.
Reply


Messages In This Thread
RE: How can I make all of the background move as opposed to just one platform? - by michael1789 - Dec-28-2019, 08:51 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyGame] Players not falling from the platform, and some other errors. urmom33 1 3,463 Jan-23-2023, 10:28 PM
Last Post: deanhystad
  can't get collision detection to work in platform game chairmanme0wme0w 10 7,641 Aug-19-2022, 03:51 PM
Last Post: deanhystad
  How to make an image move in relation to another in PYGAME CompleteNewb 1 3,039 Nov-10-2021, 03:38 PM
Last Post: metulburr
  [PyGame] how to make objects move at a precise amount of time? Zhaleh 2 4,816 Aug-02-2020, 02:52 PM
Last Post: Zhaleh
  How to make a walljump + move between rooms ? dMn420 1 3,326 Jul-17-2019, 08:49 PM
Last Post: SheeppOSU

Forum Jump:

User Panel Messages

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