Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What's with this stupid line?

 
Jake Cirino
Greenhorn
Posts: 17
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't understand whats going on, I have an image being withdrawn from a spritesheet, and being used as a character that moves around the screen. however a little bit of the image below it sometimes appears when the object moves across the screen up and down, why is this?

SpritesheetCode:
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15216
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's hard to say with the code you've given. I don't see anything obviously wrong in the code, one thing that caught my attention was: why are you doing y + 1 on line 26?

Since we can't see what classes org.newdawn.slick.Image and com.fanger.ophidian.util.Array2D are we can't say if the problem is in one of those classes.

What does, for example, the method getSubImage() do that you're calling in line 17?
 
Jake Cirino
Greenhorn
Posts: 17
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jesper de Jong wrote:It's hard to say with the code you've given. I don't see anything obviously wrong in the code, one thing that caught my attention was: why are you doing y + 1 on line 26?

Since we can't see what classes org.newdawn.slick.Image and com.fanger.ophidian.util.Array2D are we can't say if the problem is in one of those classes.

What does, for example, the method getSubImage() do that you're calling in line 17?

For some odd reason when moving things are a multiple of 0.5f it kinda flips out. not a big deal.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic