pyscroll | make scrolling games with animated maps in pygame | Game Engine library
kandi X-RAY | pyscroll Summary
kandi X-RAY | pyscroll Summary
pyscroll is a generic module for making a fast scrolling image with pygame. It uses a lot of magic to get great framerates out of pygame. It only exists to draw a map. It doesn’t load images or data, so you can use your own custom data structures, tile storage, ect. pyscroll is compatible with pytmx (so you can use your Tiled maps. It also has out-of-the-box support for pygame sprites.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Center the view on the screen
- Queue edge tiles
- Flit the tile queue
- Convert a vector2 Vector2 to iso coordinates
- Render the map
- Process the animation queue
- Advance the animation
- Context manager to clip a surface
- Create buffers
- Convert images from parent image to parent image
- Yield tile images from a rectangle
- Return the image at the specified location
- Return the tile image corresponding to the given coordinates
- Get tile images from a rectangle
- Run the game
- Handle keyboard input event
- Draws the surface
- Draw the text overlays
- Run the map
- Translates a list of points
- Translate a point
- Returns the center of the view
- Zoom zoom level
- Return the tile image associated with the given coordinates
pyscroll Key Features
pyscroll Examples and Code Snippets
self.image = pygame.Surface([12, 19]).convert_alpha()
self.image = pygame.Surface([12, 19], pygame.SRCALPHA)
class Player(pygame.sprite.Sprite):
def __init__(self, x, y):
super(
self._position[0] = self.rect.topleft[0]
self._position[1] = self.rect.topleft[1]
>>> pos = 10
>>> rect = pygame.Rect(10, 0, 5, 5)
>>> pos -= 1.4 # Move left.
>>> rect.x = pos
&
Community Discussions
Trending Discussions on pyscroll
QUESTION
I think I'm having a rounding problem causing my sprite to move faster/jump farther while moving left.
My sprites update method is calling move, which calls move_single_axis for each axis. Inside this I'm doing some collision detection where I rely on pygame's rect class to both detect the collision, and set the new position.
I think this is the problem but I'm uncertain how to get around the rounding issue because pygame's rect uses integers under the hood.
Here's the update code:
...ANSWER
Answered 2018-Jan-01 at 06:51I ripped out everything except for the hero and the QuestGame
class and could see the incorrect movement, so the problem was not caused by pyscroll
(unless there are more issues).
The reason for the movement problems is that you set the self._position
in the update method of the hero to the topleft
coords of the rect.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install pyscroll
You can use pyscroll like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page