This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Game Development and the fly likes What's with this stupid line? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Game Development
Bookmark "What Watch "What New topic
Author

What's with this stupid line?

Jake Cirino
Greenhorn

Joined: Jul 27, 2012
Posts: 17

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

Joined: Aug 16, 2005
Posts: 14961
    
  26

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?

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Jake Cirino
Greenhorn

Joined: Jul 27, 2012
Posts: 17

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.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: What's with this stupid line?
 
It's not a secret anymore!