• Advertisement
Sign in to follow this  

Is it possible that I just simply lack the required intelligence?

This topic is 1254 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

I've been trying to use JMonkey Engine 3.0 to develop a simple tower defense game. I am only using cubes, and you select on a tower and press c to give it ammo. The bullets are just simple lines. There are so many problems in my code. I've been studying a java for about 8 months, and I am starting to feel discouraged. I'm actually following an exercise from my book, and I am confused as heck. The reason why I say that is because I can't seem to figure out how to debug my code. There's stupid stuff like when the cube-shaped enemy reaches the base, and it's z position is less than zero it will disappear, but it doesn't. I've been stuck on this for days.

 

Could I get any friendly and honest advice? Thanks biggrin.png

Share this post


Link to post
Share on other sites
Advertisement

 

I've been trying to use JMonkey Engine 3.0 to develop a simple tower defense game. I am only using cubes, and you select on a tower and press c to give it ammo. The bullets are just simple lines. There are so many problems in my code. I've been studying a java for about 8 months, and I am starting to feel discouraged. I'm actually following an exercise from my book, and I am confused as heck. The reason why I say that is because I can't seem to figure out how to debug my code. There's stupid stuff like when the cube-shaped enemy reaches the base, and it's z position is less than zero it will disappear, but it doesn't. I've been stuck on this for days.
 
Could I get any friendly and honest advice? Thanks biggrin.png


First of all, no you do not lack the required intelligence, 8 months is no time at all when it comes to programming and there really is no such thing as a "simple tower defense game" (Its not normally the type of game we would recommend for beginners due to the complexity involved).

I would recommend getting familiar with whatever debugger your IDE includes (here is a guide for eclipse: http://www.vogella.com/tutorials/EclipseDebugging/article.html ).

If you still struggle you could post the relevant code here and ask for more specific advice.

 

I believe pretty much everything is screwed up. Should I just post all of my written code? And thanks for making me feel better :d

Share this post


Link to post
Share on other sites

I believe pretty much everything is screwed up. Should I just post all of my written code? And thanks for making me feel better biggrin.png

 

Saying that "pretty much everything is screwed up" is too vague and unspecific. As the others have pointed out, carefully debug your code, figure out exactly where things behave different than what you had in mind, and fix the bugs. If you don't know how to debug, learn it ASAP - more than a useful skill to have, you absolutely *need* it in order to improve.

 

Posting code is fine *after* you've done all you can to fix it on your own, otherwise it's just trying to outsource the debugging to somebody else.

 

And don't give up.

Share this post


Link to post
Share on other sites
Like the above, you need to be able to debug the code, and use break points.
You simply put a break point on the code that checks the position, and when the square is near the correct position you can single step through the code and see what's happening with your variables.
If you have no debugger, then you'll have find out how to use one, because it is the tool you need.
Making you code neat and readable, with decent variable names helps a lot as well.

Share this post


Link to post
Share on other sites
Also, when you find mistakes in your code, think if theres anything you can change in the way you code stuff to avoid similar mistakes in the future.
The whole point of many language features and coding practises is to prevention bugs and keep everything simple, so focus on that.

Share this post


Link to post
Share on other sites

Everything that everyone has said is so true.

Every good IDE has a debugger built in and as a programmer that debugger is your best friend, so many times I've been struggling with bugs at work in code that *looks* or "feels" right until you are stepping through and seeing that blasted int of 3 should actually be a float of 3.12 and that's throwing this calculation off.  Once you have learnt how to use a debugger you will hate every moment that you have to test or replicate an issue/problem without one. (E.G. deploying to customers' sites where a debugger isn't available)

Practice - another huge thing. I've been coding/programming (PHP to start, Java, C#, C++ (a little)) for 11 years and even now I look back at code I wrote as little as 6months ago and think what the hell was I thinking but at the time that the was the best way *I* knew how but in the time since I've learnt better practices, styles and even better ways to use the language I'm developing in but it takes TIME and PATIENCE to learn.

Share this post


Link to post
Share on other sites

I've been studying a java for about 8 months, and I am starting to feel discouraged.


It takes many students 4 years of dedicated study in a university to barely be able to qualify for a decent internship or entry-level job in the games industry.

If learning to program where all that easy, everyone would do it and we'd all be making minimum wage. Learning any skill requires the same process: persevere, practice constantly, and don't be afraid to ask for help when you're stuck. smile.png

Share this post


Link to post
Share on other sites
It takes many students 4 years of dedicated study in a university to barely be able to qualify for a decent internship or entry-level job in the games industry.

If learning to program where all that easy, everyone would do it and we'd all be making minimum wage. Learning any skill requires the same process: persevere, practice constantly, and don't be afraid to ask for help when you're stuck. smile.png

 

Yes, that is important too.

 

Speaking from my own expierience, I did an apprenticeship as Programmer before going to study CS. My last year of apprenticeship I spent in a Programming Team, we learned Java in School for a year during the apprenticeship.

 

I literally had no idea about this weird OO thing and Java, until the Boss of the team I did the last year of my apprenticeship in decided to pick a java project for the practical part of my final exams.

I had to understand Java in a week to get a good grade and not fail the exams. Still, the year before I literally sat about 4 hours per week trying to learn Java and couldn't even grasp the concepts of OO smile.png

 

 

So don't underestimate Java. Even though people say its easier than other programming languages... if its your first language (or first OO language), it will take you some time to understand it.

Edited by Gian-Reto

Share this post


Link to post
Share on other sites

My personal opinion that it doesn't matter how smart you are to learn something, only that it will affect how long it will take you to learn. If you ask any programmer, they will tell you about a 'click' when they understood how the code was interacting with it self. For some it takes a week, some a month... I have just finished a computing degree, and at the end of the 3rd years some people still didn't understand basic coding principles.

 

There are different ways of learning too, some find books easy to learn from, others prefer to do it them selves (trial and error) and others need a 1 on 1 teaching. maybe try switching your learning methodology if reading books isn't for you. There is a plethora of videos on the internet, The New Boston being a fantastic one for beginners such as yourself (although he is hated by some on the internet, as he tends to teach bad habbits).

 

Good luck!

Share this post


Link to post
Share on other sites

 

It takes many students 4 years of dedicated study in a university to barely be able to qualify for a decent internship or entry-level job in the games industry.

If learning to program where all that easy, everyone would do it and we'd all be making minimum wage. Learning any skill requires the same process: persevere, practice constantly, and don't be afraid to ask for help when you're stuck. smile.png

 

Yes, that is important too.

 

Speaking from my own expierience, I did an apprenticeship as Programmer before going to study CS. My last year of apprenticeship I spent in a Programming Team, we learned Java in School for a year during the apprenticeship.

 

I literally had no idea about this weird OO thing and Java, until the Boss of the team I did the last year of my apprenticeship in decided to pick a java project for the practical part of my final exams.

I had to understand Java in a week to get a good grade and not fail the exams. Still, the year before I literally sat about 4 hours per week trying to learn Java and couldn't even grasp the concepts of OO smile.png

 

 

So don't underestimate Java. Even though people say its easier than other programming languages... if its your first language (or first OO language), it will take you some time to understand it.

 

I feel lucky now lol

Share this post


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

  • Advertisement