Jump to content

  • Log In with Google      Sign In   
  • Create Account

Tile based map interfering with movemennt code


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 SharkBaitHooHaHa   Members   -  Reputation: 271

Like
0Likes
Like

Posted 12 February 2012 - 10:11 PM

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.

Attached Files



Sponsor:

#2 freeworld   Members   -  Reputation: 329

Like
0Likes
Like

Posted 13 February 2012 - 05:42 PM

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


probably wayu off base on that one.

but I am already out of time on today's lesson


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.
[ dev journal ]
[ current projects' videos ]
[ Zolo Project ]
I'm not mean, I just like to get to the point.

#3 menyo   Members   -  Reputation: 500

Like
0Likes
Like

Posted 13 February 2012 - 06:08 PM

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.

Current Project: TechnoFlux read all about it on my

DEV BLOG


#4 meeshoo   Members   -  Reputation: 508

Like
0Likes
Like

Posted 14 February 2012 - 07:31 AM

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS