Hello guys!
Before I start with anything, I'd like to express my hapiness for having a chance to be a member of such a functional and big community of game developers and programmers.
It would be rude to start without introducing, so here it is:
My name is Marko, I am from Rijeka, Croatia. I am a student at Engineering Faculty of Rijeka, my field is electrical engineering.
Even though I am (future) electrical engineer, it always was a pleasure to make programs.
Recently I decided to earn some extra money by making some Android games.
I always was a passionate gamer, I mostly understand what happens everywhere, I always dreamt about making few of my own games, so I decided to try learning it a bit, I've had some previous experience in Python, c++, basic, VB, perl etc., but I mostly learned everything about syntax, not much about each and every one of them individually.
I learned java was used for android phones so I found a good tutorial at kilobolt.com and started learning, after few weeks I stopped learning and repeating everything they did and started implementing my own code.
Now, I have a few questions (I'll try to be very precise, my code is huge since I am a bit inexperinced so it usually takes few more lines to do something than usually, so I'd rather keep it at words here. If anyone wants me to send them my code, I'll gladly do it, but I doubt you'll find any information in that pile haha! :))
Ok, my first question would be:
I used JFrame superclass to make a GUI.
At paint method, when I decide to assign coordinates of an object to a picture everything works well, but the problem is, I don't know how to enter whih coordinates I want. To be precise, of course, I know how to add them, but for example if I want to add a circular object (or some more complex) and add a .png file, it is being recognizes as a cube. So when I try to implement any simple collision recognition system, other objects interact with it as if it was a cube.
That means I can't implent some laws of physics or geometry. For example if ball collided with a wall at some certain point it start heading in different direction, depending on angle between the balls moving line and wall's horizontal line. So if the wall wasn't flat, if it had some spikes, it would be still recognized as a cube with dimensions equal to maximum distance between both coordinates.
I am using following command:
g.drawImage(picture object, object.getX(),object.getY(),this);
And the second question would be:
I am sometimes getting NullPointerException when I run my code, or series of errors in Graphics superclass.
I rechecked the code hundreds of times.
I scanned my computer for viruses and found few trojans. It turns out my girlfriend downloaded some game which installed few adware programs, and I noticed it when files started missing from the folder I placed my image files for the game.
So, is it possible, Eclipse got damaged during virus disinfection or by the adware trojans themselves?
So sorry for writing such a long text, English is not my mother language so I can't explain everything in short.
I heard you guys are very friendly so wanted to get some help here, I also want to stay here and be a prt of this community.
Well, good night folks, it's pretty late here.
First thing in the morning, I'll check for the answers, and once again, sorry for the length of the text and if you need my code, let me know!