Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Level flips and rotates when rendered to the screen.

  1. #1
    Junior Member
    Join Date
    Sep 2014
    Location
    Sarajevo, Bosnia and Herzegovina
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Level flips and rotates when rendered to the screen.

    I've been at this for a while now, and I really don't know what's causing the problem. The tiles are loaded from an image file (1 pixel = 1 tile) and all the tiles rotate in a strange fashion. They don't rotate clockwise or counter clockwise, they seem to switch places. But the strange thing is that only the tiles's images change their position, so if a grass and a water tile change their position you will be walking on water and swimming in grass, if you can get what I mean. Below are some images to better illustrate the problem.

    The images are kind of big so I just linked to them.

    https://dl.dropboxusercontent.com/u/267089024/help.png

    This one better illustrates the problem.

    https://dl.dropboxusercontent.com/u/267089024/help2.png

    The same map, only swimming.

    https://dl.dropboxusercontent.com/u/267089024/help3.png


    Here's the link to the source code:

    https://dl.dropboxusercontent.com/u/...024/Source.rar

    And here's a link to the exported jar file:

    https://dl.dropboxusercontent.com/u/...4/JavaGame.jar


    I'm really clueless on what to do, and I have no idea how to solve the problem. I made this started making this game while following a Youtube tutorial, so I'm gonna try and rewatch some of the videos again. Maybe it turns out I typed a wrong number somewhere or put a Y where X was supposed to go.

    Anyways, thanks in advance to anyone who helps out.
    Oh, and I wasn't sure if I should've put this in the AWT / Java Swing forum or the Java Rendering and Gaming one.


    EDIT: I've figured out the problem. After not working on this some time when I cam back I noticed there was a render method

    public void render(Screen screen, Level level, int y, int x)

    This is why you don't make shitty games in the damned console. In curses all of the functions would first take y and then the x coord...
    Last edited by Gritog; October 4th, 2014 at 02:44 PM.


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Level flips and rotates when rendered to the screen.

    Thread moved.

  3. #3
    Junior Member
    Join Date
    Sep 2014
    Location
    Sarajevo, Bosnia and Herzegovina
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Level flips and rotates when rendered to the screen.

    *BUMP*

    I was able to keep myself from thinking too much about the problem and have focused on other things. Today I decided to try and follow the tutorial I mentioned earlier to the end, and in an eposode I watched he changed how tiles are rendered to the screen. Before they would all render, regardless if you could see them or not. Once I implemented the code into my own game things just got plain weird.

    Here's the current version of the game:

    https://dl.dropboxusercontent.com/u/...vaGameHelp.jar

    And of course, here's the source code:

    https://dl.dropboxusercontent.com/u/.../NewSource.rar

  4. #4
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Level flips and rotates when rendered to the screen.

    Please post the code here that you want help with - preferably runnable code that demonstrates the problem - and ask a specific question or describe what you need help with.

Similar Threads

  1. [SOLVED] Adjust screen size and button arrangement for any computer screen
    By Prathiksha in forum AWT / Java Swing
    Replies: 4
    Last Post: April 23rd, 2014, 11:11 AM
  2. Replies: 2
    Last Post: March 28th, 2014, 09:59 AM
  3. Replies: 0
    Last Post: October 14th, 2013, 08:30 PM
  4. Class level Lock vs Object level lock
    By hs82 in forum Java Theory & Questions
    Replies: 0
    Last Post: October 14th, 2013, 10:17 AM
  5. Replies: 9
    Last Post: December 31st, 2011, 01:22 AM