File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Flipped image when using tileset Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "Flipped image when using tileset" Watch "Flipped image when using tileset" New topic
Author

Flipped image when using tileset

Iantra Solari
Greenhorn

Joined: Apr 30, 2011
Posts: 11
Well, i'm having another problem with the "game" i'm trying to make. Basically, i'm in the process of changing the images to a tileset, so i only need 1 image. The problem is that the walking animation and the standing still images are flipped, i don't know why because they use the same image. Here's my code, could someone guide me towards fixing the problem?



I already tried making a flipped over image and using that as the still image, but the image stays the same...
oh and walking==3 is still, walking==4 is moving


Edit:
I'm really sorry for taking up space in the forums, but somehow playing around with the values in the script got me to fix the problem. I'm sorry i made this useless topic
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32599
    
    4
It's not a useless topic. Sorry, don't know offhand. I think this would sit better on our GUIs forum, so I shall move it. And welcome to the Ranch
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

Iantra Solari wrote:


I already tried making a flipped over image and using that as the still image, but the image stays the same...
oh and walking==3 is still, walking==4 is moving

If I were you I'd create static final int fields for that, or possibly enums. Don't you agree that the following looks easier to understand:
I'd also do something about those 96, 64 and 94 values. Currently they are so-called magic numbers (third bulleted item).


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
Iantra Solari
Greenhorn

Joined: Apr 30, 2011
Posts: 11
Ritchie... that sounds like christine's son. Thanks for moving this to the right place and thanks to Rob for the comment, i guess i'll have to learn some more java and understand what all that means before making a game-thing :P
Any tutorials or something you can suggest me to learn which you consider good??

Just paid a little more attention to the code and i realised i dont really need to be an expert in java to understand it... Thanks, i think i'll change it to that since it certainly looks easier to understand
Also, i used 64 and 96 because that's the sprite dimensions i liked and found, the 94s were just me being bad at adding mentally, but i was in the pocess of changing 94s to 96s when i discovered the flipped image problem. Anyways, should i use 16*32 sprites?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32599
    
    4
Who's Christine?
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4163
    
    3

Campbell Ritchie wrote:Who's Christine?

At a guess, Ritchie's mother


luck, db
There are no new questions, but there may be new answers.
Iantra Solari
Greenhorn

Joined: Apr 30, 2011
Posts: 11
at least someone got the reference.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32599
    
    4
But I'm not called Mr Campbell
Iantra Solari
Greenhorn

Joined: Apr 30, 2011
Posts: 11
No no no no no mr campbell is christine's ex husband, or boyfriend i'm not sure. Anyways, ritchie campbell is christine's son.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

Yes, but Campbell Ritchie is Mr Ritchie, not Mr Campbell. As in, Ritchie is the last name, not the first name.
Iantra Solari
Greenhorn

Joined: Apr 30, 2011
Posts: 11
But i never said he was Mr. campbell, i said ritchie sounded like christine's son...
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

Fair enough. Shall we stop this off-topic discussion?
Iantra Solari
Greenhorn

Joined: Apr 30, 2011
Posts: 11
yes, we shall.
 
I agree. Here's the link: jrebel
 
subject: Flipped image when using tileset
 
Similar Threads
94%
Passed SCJA with 94%
Randomly displaying images from a directory with JavaScript?
Passed with 94%
Improving Graphics.