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

Can I create a bullet system by auto generated instances of a class? (PYGAME)

I am creating a target shooter game where the player clicks their mouse and a bullet flies towards it. I have started using 'pygame.sprite' to make things easier. I currently have managed to load targets and a background, and make the targets move.…
j_yerbe
  • 111
  • 1
  • 9
1
vote
1 answer

I cannot make a Group list iterate my method through it (pygame.sprite)

import pygame from pygame.sprite import Sprite from pygame.sprite import Group class Raindrop(Sprite): def __init__(self, screen): super().__init__() ... ... def drop(self): ... ... raindrops =…
1
vote
1 answer

I'm having trouble with attributes attached to a pygame.sprite class when using them in functions

So I have revamped some code by using 'pygame.sprite' and making a function to handle all drawing. If you see the code below, I am trying to make a target shooter game, player fires bullets towards cursor and tries to hit targets. The 'movement()'…
j_yerbe
  • 111
  • 1
  • 9
1
vote
1 answer

AWS Media Convert - Generating sprite for video preview on progress bar hovering

Here is my process : I upload a video in an S3 bucket I encode the video with AWS media converter The videos are generated by AWS Media converter I need "something" to create a sprite like the picture below so I can use it to display the video on…
Francois
  • 93
  • 1
  • 15
1
vote
1 answer

How can I add a sprite when no keys are pressed?

How can I add a sprite when no keys are pressed? I have each four directions covered when the arrow keys are pressed but when they are released the sprite goes obviously but cant think of how to add it. I tried adding else statements and other…
htfsam
  • 11
  • 2
1
vote
1 answer

Tkinter contents of both widgets visible when overlapping

So, I am trying to make a video game in Tkinter (no, I don't want to use PyGame), but I have ran into a bit of a problem. I have realized that sometimes you may want to have two widgets overlap (e.g. sprite on top of background) but have the…
1
vote
1 answer

Image loading using pygame

This is the code for my background grid Background = pygame.display.set_mode((900 ,900)) Green = (45,198,14) Background.fill(Green) for i in range(0, 900, 50): pygame.draw.line(Background, (0, 0, 0), (0, i), (900, i)) …
1
vote
1 answer

How to detect the previous movement in Python Pygame?

I would like to detect the previous movement of the character to display an animation in relation of the previous mouvement. For example, if the previous mouvement is 'move_right', when the character stopped, I would like to display an image turned…
Dyrockw
  • 13
  • 4
1
vote
3 answers

Cocos2D crashing on iPhone immediately but not in simulator

I'm trying to test a Cocos2D app on an iPhone, and get this crash that I copied from the console: cocos2d: CCSpriteFrameCache: Trying to use file 'heroTestSheet.png' as texture cocos2d: CCTexture2D. Can't create Texture. UIImage is nil …
Chewie The Chorkie
  • 4,896
  • 9
  • 46
  • 90
1
vote
1 answer

Having a Sprite Follow a Line of a Specific Color Pygame

I am attempting to make a version of pacman where he and the ghosts can only move on roads from a google map. I understand the concept of using grids to act as boundaries, but that only works for square gameboards. Therefore I am looking for some…
1
vote
0 answers

Three.js draw Shape between Object3D and Sprite

I have a spinning Object3D with Sprite labels attached around it. The Sprites are positioned correctly and rotate around with the Object3D, always facing the camera. I need to draw speech bubble style tails on the labels, and have them point back to…
Kim T
  • 5,770
  • 1
  • 52
  • 79
1
vote
4 answers

benchmark for using base64 string instead of image reducing http requests

I am looking at replacing source of my images currently set to a image file in my css to a base64 string. Instead of the browser needing to make several calls, one for the CSS file and then one for each image, base64 embedding means that all of the…
amateur
  • 43,371
  • 65
  • 192
  • 320
1
vote
3 answers

averaging pixel locations to find a surface normal. (2D)

I Am working on a 2D game in XNA that needs some physics. I have found that physics engines such as Farseer will not cut it due to some of the ways they work. (thats a long story involving rewriting the code 3 times to finally figure out that I…
APalmer
  • 919
  • 3
  • 11
  • 22
1
vote
1 answer

SVG from an external sprite file

What am I missing here... I'm trying to display an svg logo from an external sprite file. As far as I'm aware the coding is correct, the url path is certainly correct as the logos show when using and the .svg file seems fine as again it shows when…
Juan-man
  • 436
  • 4
  • 13
1
vote
1 answer

Pygame: How to make sprites face the same direction when no key is pressed

My character is able to move properly. However, when no key is being pressed, a problem arises. How do I make it so when no KEY is being pressed, the sprite will face the same direction it was last facing? For example, if I press the UP, it would…
Haqeem Wan
  • 83
  • 7