• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

Flipped image when using tileset

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Marshal
Posts: 68095
258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 21866
105
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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).
 
Iantra Solari
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Posts: 68095
258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Who's Christine?
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:Who's Christine?


At a guess, Ritchie's mother
 
Iantra Solari
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
at least someone got the reference.
 
Campbell Ritchie
Marshal
Posts: 68095
258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But I'm not called Mr Campbell
 
Iantra Solari
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 21866
105
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, but Campbell Ritchie is Mr Ritchie, not Mr Campbell. As in, Ritchie is the last name, not the first name.
 
Iantra Solari
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But i never said he was Mr. campbell, i said ritchie sounded like christine's son...
 
Rob Spoor
Sheriff
Posts: 21866
105
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fair enough. Shall we stop this off-topic discussion?
 
Iantra Solari
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, we shall.
 
I child proofed my house but they still get in. Distract them with this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!