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
1 answer

My Sprites are not showing properly in Pygame

My sprites aren't showing properly in my program. The map displays fine, but the sprite only shows for a split second when I quit the program by pressing the big X at the top right (But not when I exit by pressing ESC) Display sprites code: #…
Haqeem Wan
  • 83
  • 7
1
vote
2 answers

Is there a way to change sprite color temporarily after collision with C# in Unity

I'm creating a 2D top-down shooting game. I want to add a damage effect to the enemy when the bullet collides with it. Is there a way to turn the collided sprite white for 0.5 seconds and then fade out to the normal sprite. void…
KyryloRen
  • 41
  • 1
  • 4
1
vote
1 answer

Trying to get a bunch of images to show in succession when touching screen on Swift

I put the different images to show in succession in the assets.xcassets folder as shooter, shooter1, shooter2 and so on but whenever i touch the screen the animation/image shown in the view doesn't change? Here is my code: import UIKit import…
Richard Desouza
  • 249
  • 4
  • 13
1
vote
1 answer

Adding second sprite doesn't work with pygame tutorial

I have been using this code from this tutorial https://opensource.com/article/18/5/pygame-enemy but I couldn't add more enemies simply by using enemy = Enemy(40,100,'spr.png')# spawn enemy enemy_list = pygame.sprite.Group() # create enemy…
7beggars_nnnnm
  • 697
  • 3
  • 12
1
vote
1 answer

Problems generating Player sprite image with pygame

I am trying to run the following pytho pygame code from this tutorial https://opensource.com/article/17/12/game-python-add-a-player. After correcting the indentation as I posted on this question 'Player' object has no attribute 'rect I tried to run…
7beggars_nnnnm
  • 697
  • 3
  • 12
1
vote
2 answers

Extracting images from a simple/plain background

Given a sprite sheet with a plain background like this: I want to take each individual image off this background and create a file for it. I've looked around and had trouble finding information on how to do this - I cant help but feel there is some…
eygrr
  • 319
  • 2
  • 10
1
vote
1 answer

Unity 2018 - 2D Sprite - Scaling and Rotating base on different pivots

I am a new in the Unity world and I have a question regarding Scaling and Rotating. In Unity I can scale and rotate based on the object pivot. But in my animation I am scaling the object with bottom pivot and I would like to rotate this object…
1
vote
1 answer

Sprite Collision in Unity

How do I Make my powerup (a 2D sprite) destroy itself when the player (another 2D sprite) enters its trigger in unity? I have them both on sorting layer 6 (On the sprite renderer). I'm not too sure what I've done wrong. Here is what I have on my…
SingleSouls
  • 21
  • 1
  • 5
1
vote
2 answers

Randomly removing an array

just for the record, i'm using AS3. I have an issue where I would like to remove a sprite randomly in AS3, I have managed to figure out how to create the sprites so that they fill as a grid, just for the life of me I can't figure out how to remove…
Seb
  • 11
  • 2
1
vote
1 answer

Find point of collision for two sprites

I'm working on a 2D game in C# and XNA and I have succeeded at getting the per-pixel collision detection with sprites working. The challenge that has me puzzled right now is how to calculate the location where the two sprites are colliding. The…
APalmer
  • 919
  • 3
  • 11
  • 22
1
vote
1 answer

How do I delete a GameComponent from Game.Components?

Basically my game is to stop the rocks falling from the sky using a plank. I'm not sure what is not functioning correctly, but here is my code: In the RockManager class public void CheckForPlankCollision(Plank plank) { foreach (GameComponent…
1
vote
1 answer

Unity Pixel per unit

i hope you can help me ... I chose a sprite background of size 2048x1365. My camera size is 6. The aspect ratio is 4:3. This is the math i did to claculate the PPU for that sprite: I multiply my camera size by two to get my camera height and got…
aviv jan
  • 11
  • 1
  • 2
1
vote
1 answer

Changing FPS on pygame in order to achieve smoothness of sprite's movement

I have a problem with the game I'm currently working on. The point of the game is to hit a ball with a plank so that the ball doesn't drop. There are a lot of bugs with the code but i figured i should fix this one first. Basically, once the ball…
1
vote
1 answer

How to load images with Python?

I have tried to load custom sprites I have made and nothing is working! My error is: Traceback (most recent call last): File "C:\Users\BenPa\AppData\Local\Programs\Python\Python38-32\Testing pygame.py", line 5, in WalkRight =…
Ben Paton
  • 11
  • 1
1
vote
2 answers

AndEngine: Problem with registering and unregistering physics connector

Here's the problem: I have a figure, that has both sprite and body. This figure is dragable, and on the touch event's Action Down I need body to be disconnected so it could not collide with other bodies while being dragged. Then on Action Up body…
Egor
  • 39,695
  • 10
  • 113
  • 130