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

TypeError: argument 1 must be pygame.Surface, not str, don,t know what's causing this

I went back to the first game I made in pygame and wanted to add sprites so I went into three different classes and changed the code to have them be sprites not blocks. Now whenever I run the code I get an error on the line all_sprites.draw(screen)…
Sam318
  • 63
  • 3
1
vote
1 answer

Incorrectly removing sprite group enemies in the right order

I have 2 sprite groups, one for the enemies, and one for the players weapon. An example of how I set up the enemy sprite group... (The weapon sprite group is done the same way) class Bat(pygame.sprite.Sprite): def __init__(self, bat_x, bat_y,…
Owen Penn
  • 163
  • 9
1
vote
1 answer

How to change animator states from a key press in Unity?

I am working on a small beat-em-up game as a summer project. I am stuck trying to change the sprite animation when a key is pressed. Here is my code: using System.Collections; using System.Collections.Generic; using UnityEngine; public class Test…
CurlyCue
  • 35
  • 1
  • 2
1
vote
1 answer

Mask collision between two sprite groups

My player attacks by throwing their weapon at the enemies. This is currently done by using a singular sword that gets thrown, then teleports back to the player to be thrown again. I want to change this so that I have a class called sword which I can…
Owen Penn
  • 163
  • 9
1
vote
1 answer

Pygame: What is the best way to display these ships and their movement from sprite sheet?

Attached below is one of the sprite sheets I am using. Right now, I am wondering the best way to display the ships with their animation when moving. The ships have 9 frames. I have found old examples with deprecated code, or examples that have…
Sean Ford
  • 23
  • 4
1
vote
2 answers

Combine several SVG

I need to know how to combine multiple from a SVG file. Right now I have three icons and somehow I can not find any logic behind that. I read that I need to remove the last part and combine it with the following. Example: From
norriz
  • 11
  • 1
  • 2
1
vote
1 answer

LibGDX - Sprite / Pixmap / Camera / ViewPort sizes (width/height ) - algorithm of all size transformations from PixMap to (physical device) Screen

What is my complete thinking algorithm to understand all possible width/height transformations on the path PixMap -> (physical) Screen/monitor? Sorry for the stupid question, but how do these sizes corellate / scale / interact? What size do I…
Code Complete
  • 3,146
  • 1
  • 15
  • 38
1
vote
1 answer

Can I have multiple sprites on one game object in Unity?

So I'm making a 2d top down game and one of my enemies is supposed to be a tank. I have two separate sprites for this tank, one for the tracks/body and one and for the turret. I want to have one game object contain both of these sprites. I would…
1
vote
1 answer

Is it possible to get the current frame of a sprite sheet animation in Unity?

I have a simple 12-frame 2D sprite animation in Unity (2019.2.21f1), which I created by making a sprite sheet and using the Unity sprite editor to slice the sprite sheet into the animation's individual frames. I would like to execute certain code on…
ChrisC
  • 892
  • 2
  • 12
  • 33
1
vote
1 answer

wordpress css sprite load image

I'm trying to use sprites just like this in my wordpress project. But I've got trouble in my css loading background images. I've checked the path in the console after loading the page, the url path is good but I've got an 404 error. my css :…
andrc
  • 75
  • 1
  • 10
1
vote
1 answer

How do I draw a large (500+) number of sprites to build an isometric tiled map in DirectX 10?

So, I've been puttering around with a few books on DirectX (specifically 10) and am trying my hand at building a game that uses it, but I'm stumped by a problem that none of the books seem to mention: I'm building an isometric map with sprites and…
Bo T.
  • 43
  • 4
1
vote
1 answer

How can you increase an object's velocity if it collides with another object in JavaScript?

I am currently working on a project in Code.org's Game Lab. In this game, if the object(bee) collides with another object, it's velocity should increase permanently. Is there any way to do this? Here is a link:…
Ishaan Masil
  • 65
  • 1
  • 9
1
vote
0 answers

Lossless rendering of sprites in case of zoom out in unity 3d

So I'm very new to unity and I am facing issues while importing a sprite which is a deck of playing cards. The problem here is that when I start zooming out the camera the sprites start looking weird(pixelated). I want them to be clear when I zoom…
md shoaib
  • 125
  • 1
  • 10
1
vote
1 answer

Deepcopying a 2d arrary (board) with sprites on it

i'm currently working on my final project in school so i'm making a game with pygame. The game includes a board with bases, colonies and defenses, all are sprite objets. In the project we were requested to add 2 machine learning algorithems so one…
PotKilled
  • 13
  • 2
1
vote
1 answer

Three.js/webgl RayCasting Sprites in Scene with Transparency or Alternatives

I am working on a webgame which requires selection of drawn objects, so not in simple geometric shapes. To do this, I have been drawing them as sprites in a scene on a canvas using Three.JS. I have been racking my brain for months trying to figure…
egg peanut
  • 13
  • 3