• Advertisement
Sign in to follow this  

Tile based map interfering with movemennt code

This topic is 2170 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I haven't posted in a while. Hopefully my code looks a bit better since the last time I posted xD. I've learned some new things and I've been working on my Senior Project for school which is to write a video game. I am still writing in Java and I have a mentor who helps me every weekend. However, today we ran into a problem. Today we worked on creating a tile based map, and it worked perfectly. However, our existing movement code appears to have broken due to this new code. When I comment out the code that loads the .txt file than then reads from my spritesheet and then paints the map to the screen, the movement works fine. I honestly don't know what's happening, and neither does my mentor. We've gone through debugging the program so many different times and different ways but still haven't been able to find out what's wrong. If somebody could please help me here it would be much appreciated. You can maim, rip apart, do whatever you want to my code but I am just dying to know where it went wrong. I have a feeling that it may have to do with my using a Swing Timer for the animation rather than using Threads but I am already out of time on today's lesson and after 3 hours, my brain is just fried.

I will attach the entire folder as an eclipse project.

Again, thank you so much. I'm just brain dead right now.

I didn't add very many comments, so if you are unsure what something does feel free to ask.

Share this post


Link to post
Share on other sites
Advertisement
Have you tried walking through your code? Debuggers are great for this.

Do you know what your code is supposed to do? Does it do what you expect it to do?


I have a feeling that it may have to do with my using a Swing Timer for the animation rather than using Threads
[/quote]

probably wayu off base on that one.


but I am already out of time on today's lesson
[/quote]

I dont know your timezone, but I bet there's still plenty of time in the day.

If all else fails, get some sleep, the sub conscious can do wonders.

Share this post


Link to post
Share on other sites
This comes way too late i know. But this is one of the reasons you should document your code. As your projects get larger or you ant to rip from your old projects you really need well documented code. Documenting your code can help you while coding it too, i always described functions and often thought about another way of doing it. Or sometimes theres something you have not thought about yet and can correct right away.

Share this post


Link to post
Share on other sites
This might not be the answer you want to hear, but you gave up on a problem after only 3 hours?!! I am a senior developer and it still happens to me time and time again that I get to stay a day or more on some issues. Just throwing undocumented code out on the internet and ask people to look at your whole project is a bit on the lazy side of things, and harsh for the people that want to help you and will not make you a better developer, which is really your goal now as you are still learning. Try to isolate the problem first, some specific questions would make more people want to help you.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement