Questions tagged [sprite]

A sprite is a two-dimensional image or animation that is integrated into a larger scene.

Sprite

A sprite is a two-dimensional image or animation that is integrated into a larger scene.

Spriting

The term is also used when taking subsections of a larger image file containing icons for display. This allows browsers to load only one image file and reuse it to display many icons by using offsets. This is known as spriting.

FAQs

Resources

4792 questions
1
vote
2 answers

player walking on predetermined path pygame

I am new to pygame and I am trying to make a game where the player has to bypass some enemy's to get to a point where you can go to the next level. I need the enemy's to walk back and forward on a predetermined path but I can't figure out how to do…
Geordyd
  • 165
  • 2
  • 10
1
vote
2 answers

Spritesheet help in pygame

I am currently working on a game, trying to improve my beginner python skills. My game is functioning at its most basic level - I can't bring myself to move forward in its development until I can animate my sprite. It's given me the worst headache…
1
vote
1 answer

Pygame - rendering multiline text using Sprites

Struggle is that I am capable of rendering one line of text with Sprites in Pygame, I am also capable of rendering multi-line text, but without the Sprites, but I can't figure out way how to render multi-line text using Sprites. I've got this for…
mikro45
  • 63
  • 1
  • 1
  • 9
1
vote
0 answers

Function Vector> : Entries getting changed and i dont know why

I want to initialize a square of textures with sf::sprite elements. To make the main()-function as clean as possible, I wrote a function in another file, it looks like this: vector> init_board_graphics(int size) { sf::Texture…
beinando
  • 477
  • 4
  • 18
1
vote
1 answer

Pygame: Click event is affecting every sprite to the left of them

I have an array with all the sprites inside of them, and in the loop, if the sprite is clicked then the sprite is killed. If I click the sprites from left to right, everything is fine. They are cleared one by one independent of each other. But, if I…
1
vote
0 answers

Walking cycle on scroll using skrollr

Im working on my finals project and what I want to happen is to make the character walk while you scroll using skrollr.js here's what I have so far is a sprite animation it walks continuously and I don't know how to make it walk just when you start…
1
vote
1 answer

Collision Detection Not Working for Sprites in Pygame

I have recently tried to upgrade the code for my game I am working on by changing my basic rect and images to the more advanced Class system. However, I seem to be having trouble with my collision detection, where when I tell my sprite hg to stop…
Maxosaur
  • 103
  • 10
1
vote
3 answers

Handle too many textures Unity

At present one of my quiz game require, many images of flowers based on questions asked. I can say total 250+ images with resolution of 512x435 each. Plus other games textures get loaded at a time. So when game screen get opened which showing all…
Siddharth
  • 4,142
  • 9
  • 44
  • 90
1
vote
1 answer

pygame sprite.spritecollide() doesn't work with moving sprite Group

When my player sprite collides with the coin group the coins disappear as wanted, but when it collides with the enemys group nothing happens. The code is the same. I don't know what I did wrong because I did the same thing twice but it only works…
Miray
  • 57
  • 5
1
vote
1 answer

sprite follows a different sprite with a delay

I make my first application and the question arose how to make it so that one object would follow another with a certain speed, tried to find the answer to the question but did not find it. This is what I did, but without delay EDIT: gif is…
Vasya2014
  • 203
  • 1
  • 5
  • 25
1
vote
2 answers

Sprite.Draw() draws my textures too small

I declared a device + sprite in a Windows.Form like this PresentParameters presentParameters = new PresentParameters(); presentParameters.Windowed = true; presentParameters.SwapEffect = SwapEffect.Copy; var device = new…
1
vote
1 answer

How to use sides of a sprite rect in pygame?

I am attempting to draw a line between two different instances of the same sprite class, the sprite class being coded in as shown here (this is just the __init__ function): class Atom(pygame.sprite.Sprite): """Creates an atom of an element. The…
ModoUnreal
  • 642
  • 5
  • 15
1
vote
2 answers

Pygame sprites - get the rect collision side

I am new in pygame and I am trying to get the basic knowledge. I want to create the obstacles and detect which side of the player rectangle (that represents the colliding box of the sprite) is colliding with the obstacle rectangle. With this I can…
user193464
  • 380
  • 1
  • 6
  • 25
1
vote
1 answer

Animate a Sprite grid using CSS3?

I've got this sample sprite grid sheet that I need to run through and animate. I am able to reach a certain point but struggling to make it perfect. The animation is not that smooth and additionally, the image is not aligned properly. During the…
Vishal
  • 345
  • 1
  • 3
  • 10
1
vote
1 answer

Rotating and moving a sprite in Pygame

I'm new to Python, Pygame, and programming in general. I'm trying to create an Asteroids clone, but I can't figure out how to make my player sprite move and rotate at the same time. I used the Vector2D class from this answer (tried to modify it for…
shoris
  • 29
  • 2
  • 8