Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
0 answers
61 views

Is using sprite sheets and drawing specific part the way to go?

I'm programming in Java. I have more than 200 MB of images used in my games, something like 100000 40x40ish images. I initially wanted to load them all during app initialization but it took like 2 ...
Axel Carré's user avatar
0 votes
1 answer
356 views

Libgdx - Screen tearing (or artifacts) while in fullscreen

I have a problem with libgdx, fullscreen and what I believe is screen tearing or any other sort of artifact. In windowed mode, everything works fine, but when i switch to fullscreen, moving sprites ...
Wyatt Gilette's user avatar
0 votes
0 answers
398 views

LibGdx- Sprites moving alongside camera

I am trying to render some entities in random positions on the screen. The spawning positions are okay however when I move the player entity (which the camera is focused on) and pass the middle of the ...
Grual's user avatar
  • 1
2 votes
1 answer
1k views

How do I detect a given sprite's bounds automatically using Java?

Background I have the following png file that contains the player sprite. As with any png file, the non-colored pixels are ...
Nicholas Adamou's user avatar
1 vote
1 answer
1k views

LWJGL—How to Animate and Render Characters Using a Sprite Sheet

I'm making an RPG similar to Super Nintendo RPGs in the early '90s. I'm handling movement much like Squaresoft's Final Fantasy IV. Notice that the player never actually changes his x and y positions ...
ND523's user avatar
  • 1,022
3 votes
2 answers
148 views

Why is my Mario clone game sprite getting cut off when I try to change it?

In my Super Mario 3 clone, my sprite draws correctly upon instantiating the JFrame, but when I press one of the buttons I've set to jump, it gets partially cut off. Everything on the screen is a ...
Derry's user avatar
  • 131
0 votes
1 answer
277 views

Collision detection with isometric tiles stored in rectangular files

So I'm working with a player moving across a grid of isometric tiles. Each tile is stored in a .png file. I have a class that crops out BufferedImages from different sprite sheets and initializes them ...
Christian Westbrook's user avatar
0 votes
1 answer
89 views

How to make a tile that can be stretched out

I was playing angry birds and I saw that the elastic used to throw the birds is a texture that expands well when you push it with your finger. How can textures like this be made in java with libgdx? ...
Daniel Oliveira's user avatar
0 votes
1 answer
331 views

How to get the attack animation cycle all the way through after one KeyEvent without twitching? (Java awt)

So I figured by myself (supposedly) how to make the attack animation cycle all the way through after pressing a key without needing to keep it pressed. But now it doesn't always start at the same ...
Neko's user avatar
  • 3
0 votes
1 answer
519 views

Performance optimization when changing Textures LibGDX

In the main Screen class of my game there is a ListArray<Card> which makes up the deck ...
SlavenIvanov's user avatar
1 vote
4 answers
4k views

What's a proper way to change colors of a sprite on the fly in libGDX?

I have found a great tutorial series on creating a simple 2D side scroller, Super Mario Brothers, in this case, and I believe I can adapt it fairly well to create a Megaman clone(something I am quite ...
John Vanek's user avatar
0 votes
1 answer
298 views

In Libgdx sprite displaced from their bodies position just after colliding with another body

In my game i have a ball falling from above and a rectangle below. when my rectangle collide with ball,sprite position displaced from body automatically,i could not understand this. and i also tried ...
Kharak's user avatar
  • 26
1 vote
2 answers
1k views

How do I use Sprite in libgdx ashley ecs framework?

In the libgdx ashley wiki there's an example of Position and Velocity components, which is pretty easy to understand. My problem ...
ronscript's user avatar
  • 501
1 vote
1 answer
100 views

Which is the most efficient way to make the screen follow a sprite?

This is my first non-board game and I'm trying to learn a bit about 2D graphics in Java. But I don't know, how should I efficiently implement a camera to make the screen follow the main character. I ...
May Hirapin's user avatar
1 vote
1 answer
257 views

Black lines on sprites

I am having the issue as seen below while using a textureAtlas with libgdx. I haven't found anyone else with the issue so I decided to ask here. Here is an image of the textures in the game screen: ...
Chris's user avatar
  • 161
0 votes
1 answer
54 views

Sprite update issue

I'm currently implementing Box2D with LIBGdx and i'm having issue on update, as you can see on this video : https://www.youtube.com/watch?v=D3Nph6yftTQ whenever my player move or the camera move the ...
Kamigaku's user avatar
  • 177
0 votes
1 answer
2k views

How do I fix a delay between the first and second KeyEvent

I recently got really interested in making my own little game. As I have no real game development background I'm still figuring stuff out, but I encountered a little problem. While working on the ...
horoTV's user avatar
  • 1
1 vote
1 answer
3k views

Libgdx Sprite rotation around specific point

I made complex dynamic body that rotates around other body that is static. It works perfectly, however I got messed up with sprite position on that body. Here's what I have now and here's what I need ...
user3334375's user avatar
3 votes
1 answer
6k views

Java Libgdx Attaching Sprite to Box2D Body

So I am working on programming a java 2D platformer for fun on the side and I have a rendered TMX level and a box2d body (just a circle shape) that I am currently using as my player. All the controls ...
user2306249's user avatar
0 votes
1 answer
117 views

Libgdx + Box2d working with 2 cameras

Recently I have read that you can work with 2 cameras whenever you involve Box2d, which only works in meters. In my Renderer class, I receive all the entities in the game and then draw them. I work ...
David's user avatar
  • 1
2 votes
1 answer
622 views

How could I implement destruction of bases in Space Invaders type game?

What approaches could you use to implement the the gradual destructions of bases/shields in a top down shooter type game similar to Space Invaders? The simplest approach could be to use a series of ...
Kevin Hooke's user avatar
1 vote
1 answer
357 views

Why is the alpha value of a Sprite in LibGdx 0.99607843 and not 1?

I'm developing a game in LibGDX and one of my problems is related to the alpha value of a Sprite object. If I create a new Sprite sprite object then ...
BananyaDev's user avatar
1 vote
1 answer
489 views

Positioning partials of character sprite animations

I'm not entirely sure how to best explain what I'm doing. Maybe I'm going about this completely the wrong way. If any of you find that that is in fact the case, I would appreciate it if you told me ...
Ryangr0's user avatar
  • 11
2 votes
0 answers
210 views

Sprite animation in Android view

I'm looking for a way to have different sprite animations in individual Android views. I try to use LibGDX and AndEngine but most I could find was how to get an Activity with the sprite animation. ...
Jose Gonzalez's user avatar
1 vote
0 answers
90 views

How can I detect sprite collisions out of screen?

I am creating an Android game using andEngine library. I have enemies coming from out of the screen into the screen. I already know how to detect collisions, but is there any method I can use to ...
OrangeHat's user avatar
  • 123
1 vote
1 answer
872 views

LibGDX - Rotating sprites and still keep the positioning between them

I've been struggling with a problem regarding rotations and relative positions between sprites (in this case, the sprites are just lines) - a bit off-topic, but should i be using the ShapeRenderer ...
Francisco's user avatar
  • 231
1 vote
1 answer
52 views

JAVA: Unformed Sprite When trying to Read SpriteSheet

So Im a beginner experimenting with ImageIO. Can someone tell me why im getting this pixelated-incomplete sprite? Here's the code ...
Zero Cipher's user avatar
0 votes
1 answer
5k views

Java: Exported JAR file doesn't load images

I am using Netbeans to create my game. The images do seem to load when I run it in Netbeans. However, the built jar file only leaves me with a blank screen. This is how I call the images in my game. ...
LaPXL8R's user avatar
  • 25
0 votes
2 answers
1k views

How would I create classes for each map tile instead of using a tmx? LibGdx

I am making a top down style game using LibGdx that I want to be randomly generated each new game load. I already have the algorithm to generate the array for what tile should be what. But i'm ...
Snhp9's user avatar
  • 113
1 vote
4 answers
2k views

What is the easiest way to make an object follow the edge of a sprite?

I have a rounded rectangle sprite and another sprite that's just a circle. I want the center of the circle to follow the edge of the rounded rectangle. Is there any easy way to accomplish this task? I'...
John's user avatar
  • 41
1 vote
1 answer
1k views

Libgdx - Sprites disappearing [closed]

I'm facing a little problem and I have no idea to bypass it. I've made a dungeon generator and I'm able to spawn randomly mobs, the problem is that when they are not moving the game is fine, but at ...
Kamigaku's user avatar
  • 177
0 votes
2 answers
2k views

Make objects slide across the screen in random positions

I want to make an object appear randomly at the right hand side of the screen and then slide across the screen and disapear at the left hand side. I am working with libgdx. I have this bit of code but ...
user3475907's user avatar
2 votes
1 answer
2k views

libgdx get rotated sprite coords points

I would like to get the position of each edge of a sprite when he has been rotated. I have no idea how to do it, I made a image to explain it. I would like to get the X and Y position of each Red ...
LeSam's user avatar
  • 278
2 votes
2 answers
2k views

How can I create delays for sprite animations that work correctly when the application is killed and restored?

Please see my original question here: Using System Time to compute delay times that correctly deal with app pauses? In summary, I am attempting to to introduce a delay (say of 5 seconds or so) ...
BungleBonce's user avatar
  • 1,927
2 votes
2 answers
404 views

Expandable 2d environment by spawning and controlling individual tiles

what is the best way to implement an environment that is "expandable" in every direction so that when the player moves in any direction a new row or column of tiles that can be manipulated ...
AllenZ41's user avatar
0 votes
2 answers
1k views

AndEngine - Smooth scaling on a sprite

I'm trying to implement a pinch zoom on a sprite. I would like to get an effect like the SmoothCamera, but on a single sprite. I've managed to pinch zoom on the sprite by changing its scale, but the ...
Phil-R's user avatar
  • 103
0 votes
1 answer
229 views

Load all bitmaps at once or only when needed?

I am starting to get a pretty hefty amount of bitmaps in my 2d game for android. I load them all in 3 colors to save some memory but the thing is, I load all of them when "Start game" is pressed, even ...
Green_qaue's user avatar
  • 1,913
0 votes
1 answer
619 views

How should I determine the bounding rectangles for frames within a sprite sheet? [closed]

I have a spritesheet for a character. The spritesheet has several rows, and each row represents an animation. The elements within a row might vary in width. How can I load the different sections of ...
Xkynar's user avatar
  • 601
3 votes
4 answers
2k views

How to set speed of circular motion

Edit 2 - clarification Just to clarify, the issue I have at the moment is how I specify a time (in seconds) for a complete revolution to occur. My delta is fixed and is 1/ticks per second (1/60). ...
BungleBonce's user avatar
  • 1,927
2 votes
1 answer
1k views

Is it possible to achieve a smooth sprite animation with a fixed 60 FPS using Java 2D?

I've seen a lot of different game loops, and before implementing anything complicated I decided to start with a capped 60 FPS. My run method looks like this in my game thread: ...
user avatar
2 votes
2 answers
2k views

How to implement pathfinding in this situation

So I'm creating a game for android using the libgdx library. I render the map from a tmx file and in it all the water tiles have the property of blocked. My player(a sprite) moves to where I clicked/...
Exikle's user avatar
  • 236
1 vote
2 answers
210 views

Twitchy sprite movement

I'm having an issue with sprite movement, and I'm not sure how to deal with it. When I set a destination for my player sprite (by clicking the screen), it sets the player moving in that direction. ...
BattleBarnes's user avatar
1 vote
2 answers
320 views

Handling creation of enemy sprites in a level

I am trying to build an RPG tile-map based game. Currently I am going to set enemy sprites that will be repeating their motion in fixed path. Suppose that I have a level map, which has got width 3 ...
NightFury's user avatar
  • 191
1 vote
1 answer
3k views

libgdx: how to manage entity classes [closed]

Good day sirs, I know this is a newbie question but I really need to ask it. I've been reading a lot of sample codes on libgdx, and I have seen entities(player, enemy, boss,etc.). my question is what ...
badasskitteh's user avatar
1 vote
1 answer
2k views

Dealing with "jumping" sprites: badly centered?

Thing is, I've used darkFunction Editor as a way to get all the spriteCoordinates off a spriteSheet for each individual sprite, and parse the .xml it generates inside my game. It all works fine, ...
parreirat's user avatar
  • 245
0 votes
1 answer
538 views

sprite array problem with initialization

I have a problem with my Sprites. I'm trying to create a lot of Sprites. However, I got a problem in that I have several grass tiles and I don't want to do this grass1 = new Sprite...; grass2 = new ...
pangaea's user avatar
  • 215
-1 votes
1 answer
276 views

How would you program sprite movement in a 2-D ariel view rpg game? [duplicate]

I'm relatively new to programming and I have recently programmed an RPG game in java. Any tips on character movement with animations? I would like it to be similar to those of other rpg games such as ...
Noob1234's user avatar
-3 votes
1 answer
302 views

java app goes too slow in android os [closed]

The problem is that my java app contains too many animated sprites and it runs very slowly on android system. Does the usage of .gif animation instead of sprite animation will improve the speed? I ...
qvatra's user avatar
  • 149
5 votes
1 answer
2k views

libGDX using Stage and Actor produces different camera angles on desktop and Android Phone

libGDX using Stage and Actor produces different camera angles on desktop and Android Phone. Here are pictures demonstrating the problem: http://brandonyuh.minus.com/mFpdTSgN17VUq On the desktop ...
Brandon's user avatar
  • 51
2 votes
1 answer
2k views

setPosition of Sprite onUpdate in AndEngine

I am trying to get a "highlighter" circle to follow around a sprite, but I am having trouble, I thought I could use the onUpdate method that's available to me in SequenceEntityModifier but it's not ...
SSH This's user avatar
  • 157