sprite

How do you work with sprites, and why were they used so widely in older games?

旧街凉风 提交于 2019-12-13 21:00:33
问题 My friend and I decided to create a platformer together as our computer science project. I am currently using an image function in p5.js library to swap between images and create animations for walking, jumping, etc. I looked up how it was done before for 2d games on systems such as Sega Mega Drive and NES, and understood that at the time pretty much all that was used for graphics in 2D space was sprites. After more research, I found out that sprites were made into a large image file with a

Optimization for changing pixels of sprite in Unity3D

放肆的年华 提交于 2019-12-13 20:13:09
问题 Problem : After a month, I'm coming back to the prototype for painting on sprite for my mini game. As you see in this thread I've figured out the solution for painting on sprite and because of big nested loop in the script, the mini game isn't at the good situation (I mean low FPS). So I've tried to use another method instead of Texture2D.SetPixel() then I used Texture2D.SetPixels() but like before the FPS was low. So right now, I don't find any solutions for this problem. Last thing which

Android AndEngine: Simple sprite collision

こ雲淡風輕ζ 提交于 2019-12-13 18:27:11
问题 I am new to AndEngine game development (or game development in general) and I am working on a very simple game. The setting is that I have 4 main sprites in the game: a.) Fighter Plane b.) Tank c.) Foot soldiers d.) Bomb The game is in a current infinite loop. The fighter plane comes out from the left, zooms across the screen and comes out the right again continuously every second. The Tank comes out from the left side of the screen, makes its way to the middle of the screen, drops off some

python pygame blit function

Deadly 提交于 2019-12-13 17:46:18
问题 When I use blit function, it does not delete the previous loaded sprite to make sprites move until I call the "display.fill(bgcolor)" function. The problem is that I have a multicolored background. so how do I update the image without affecting my background? NOTE - already tried "pygame.display.update()" and "pygame.display.flip()" - it doesn't help :( class states(): def __init__(self, goku1,goku2, x, y): self.image=goku1 keys=pygame.key.get_pressed() if keys[K_RIGHT]: self.image=goku2 if

SVG sprite not work in Safari

 ̄綄美尐妖づ 提交于 2019-12-13 15:23:47
问题 Safari is not better than IE for a web developer. Here is the issue I saw in Safari. I am trying to use an SVG sprite to load product icon in my web page. HTML code: <img src="https://www.abc123.com/icon_sprite.svg#amex"> SVG Sprite Code: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="276" height="224" viewBox="0 0 276 224" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org

CSS3 - Fade between 'background-position' of a sprite image

别等时光非礼了梦想. 提交于 2019-12-13 14:22:01
问题 I want to fade between 'background-position' of a sprite image only with CSS . I found a lot o tutorials but I didn't found something simple like this: <!doctype html> <html> <head> <meta charset="utf-8"> <title>CSS3 - Fade between 'background-position' of a sprite image</title> <style type="text/css"> div{ width: 120px; height: 60px; background-image: url('sprite.jpg'); background-repeat: no-repeat; background-position: 0 0; } div:hover{ background-position: 0 -60px; } </style> </head> <body

Slick Animation - There must be one duration per frame

只谈情不闲聊 提交于 2019-12-13 14:04:54
问题 I am trying to make a game in Slick, and before I start I want to test the helicopter animation I will be using. It just opens and then immediately closes with these errors: Exception in thread "main" java.lang.RuntimeException: There must be one duration per frame at org.newdawn.slick.Animation.(Animation.java:111) at javagame.Menu.init(Menu.java:22) at javagame.Game.initStatesList(Game.java:19) at org.newdawn.slick.state.StateBasedGame.init(StateBasedGame.java:170) at org.newdawn.slick

how to detect if the sprite has been clicked in pygame

主宰稳场 提交于 2019-12-13 12:07:11
问题 Im new in pygame, right now im working with sprites. My question is how do i detect if the sprite has been clicked? I want to do something when the sprite was clicked just like a button. thx :) [Edited] thx Stephen. In addition is there a way to know who is the sprite that was clicked? Here is sample code boxes = pygame.sprite.Group() for color, location in [([255, 0, 0], [0, 0]), ([0, 255, 0], [60, 60]), ([0, 0, 255], [120, 120])]: boxes.add(UpDownBox(color, location) for example i click the

AndEngine camera and Device display : Ratio between co-ordinates on each

ⅰ亾dé卋堺 提交于 2019-12-13 09:36:00
问题 I'm using a FrameLayout on top of Andengine camera to add a button. I need to align the button to a sprite on the andengine camera. I'm using gravity top in the frame layout and adding top padding to shift the button down. Works while on the development device. But because of the RatioResolutionPolicy , on a different device with different screen size, the alignment does not work. I am wondering how to find the device screen Display co-ordinates that would exactly coincide with the AndEngine

Adding to Stage in ActionScript 3 from a .as file

ぃ、小莉子 提交于 2019-12-13 07:36:11
问题 Note: Yes, I know that similar questions have been asked before. However, after following the answers in such questions I'm still stuck and can't find a solution to my problem. I'm having a problem which requires adding DisplayObjects to the Flash stage. Since I have to Display elements of several different classes, I decided to create a class to work as an intermediary between the .as files and the addChild function called "Displayer" as shown below: package { import flash.display