Java-Gaming.org Hi !
 Featured games (84) games approved by the League of Dukes Games in Showcase (595) Games in Android Showcase (169) games submitted by our members Games in WIP (647) games currently in development
 News: Read the Java Gaming Resources, or peek at the official Java tutorials
 Show Posts Pages: [1]
 1 Game Development / Newbie & Debugging Questions / Re: Where to learn 2D-vectors on: 2011-02-06 22:54:21 Quote from: Kieran Newland on 2011-02-06 15:05:34The function, Math.atan2(y, x) can give you the angle of your mouse compared to the sprite. You could rotate your sprite to this angle or something similar to show that the angle is correct.That's what I'm trying to work with, but for some reason I can't seem to get the mathemathics right, hm, but I might have an idea to try out. (I guess what I can't see really is how to count the angle as 0,0 is top-right corner, not bottom-right. But as I said, I just got an idea what to try (if statements  ))Quote from: krasse on 2011-02-06 20:13:35My 2D vector class:[...]If you want to create a vector between two points, such as the gun position and the mouse position, for animation, you can do like this:[...]Great, thanks .. but, I won't copy it, because that not learning  I will read the methodes that you'd use and rewrite them (Great that you have some comments in there)  Well, thanks again, both of you
 2 Game Development / Newbie & Debugging Questions / Where to learn 2D-vectors on: 2011-02-06 14:25:47 Hey allI've been working on this small 2D-side scroller, after following MrJavaHelp's game tutorials on youtube.I asked here and on another forum for how to solve my idea of a shot following the mouse-press.I wanted to do this with angles, but I can't seem to get it right.On the other forum where I asked, I got the answer to drop angles, and use vectors, and he linked me to R2-vectors on wikipedia, a short, non-informative text (in my view)So, now I've been watching about 30min different youtube-videos explaining what a vector is, and I kind of get it now.But I have no idea how to implement or use it in Java/programming...So, where to find examples or tutorials or something that shows how and where to use vectors in Java-2D?(Or, do anyone here have an personal example? )Thanks if anyone has an answer//M
3  Game Development / Newbie & Debugging Questions / Re: extends both KeyAdapter and MouseAdapter on: 2011-02-05 17:01:18
Nevermind
[size=16pt]Solved it[/size]

Did a own class for MouseAdapter :
 1 `addMouseListener(new AL());`

 1  2  3  4  5  6  7 `private class AL extends MouseAdapter{      public void mouseClicked(MouseEvent e){         test = new Point(e.getX(), e.getY());         hittade = true;         spelare.mousePressed(e);      }   }`
4  Game Development / Newbie & Debugging Questions / extends both KeyAdapter and MouseAdapter on: 2011-02-05 16:51:31
Hey all

I've followed MrJavaHelps tutorials at youtube, and continued on the little game made.
But, he did the following (kind of):

 1  2  3  4  5  6  7  8 `private class ActionListener extends KeyAdapter{      public void keyReleased(KeyEvent e){         spelare.keyReleased(e);      }      public void keyPressed(KeyEvent e){         spelare.keyPressed(e);      }   }`

Spelare is my player-object, the functions does send the event on to the player to react to them.

So, I wanted to use the MouseAdapter the same way, but it doesn't work;
 1  2  3  4  5  6  7  8  9  10  11  12 `private class ActionListener extends KeyAdapter, MouseAdapter{      public void keyReleased(KeyEvent e){         spelare.keyReleased(e);      }      public void keyPressed(KeyEvent e){         spelare.keyPressed(e);      }      public void mouseClicked(MouseEvent e){         test = new Point(e.getX(), e.getY());         spelare.mousePressed(e);      }   }`

The point is for testing, but, I get an error when trying to do this:
Quote
Syntax error, insert "ClassBody" to complete ClassDeclaration

So, uhm, how to approach this?

//M
 5 Game Development / Game Mechanics / Re: Trigonometry Java on: 2011-02-05 16:00:12 Quote from: ryanm on 2011-02-05 15:31:51Thanks for the help, great  It seems to do what I wanted
 6 Game Development / Game Mechanics / Trigonometry Java on: 2011-02-05 15:17:01 Hello allI'm making a 2D side-scroller .. really simple with paint-graphics.Right now you can shoot "lazers" forward, but I'd like them to go after a mousePressedSo, I've made it work so far that I've got the mousePressed X and Y, now I want a angle so that I can change the y-position of the "lazor" () after the angle, this is my approach showed with paint-skills:This is how I would calculate the V on my calculator .. Is there a function like the "tan-1" in Java? (I can't seem to find any when googling)If not - what to use?Thanks for answersAnd sorry if I choose the wrong forum section //M
 7 Discussions / General Discussions / Re: Vote now in the official JGO logo contest thread with this topic on: 2011-01-13 18:28:53 c++//but then .. I don't have enough posts
 10 Game Development / Newbie & Debugging Questions / Re: Ok guys, Needing to start somewhere - books? on: 2010-09-07 09:59:42 Dam'I'll get myself banned here  I've still not chosen bookI've contacted my libaries here, to check if they can get any of the booksIt's down to three now:Killer Game Programming in Java - Andrew Davison | ISBN: 0596007302Introductory Programming with Simple Games: Using Java and the Freely Available Networked Gaming Engine - Ladd, B C | ISBN: 0470212845Developing Games in Java - David Brackeen | ISBN: 1592730051I have no idea, I can afford, at best, 2 of them.Sorry for spamming your forum like this, but I'd like to get started, and don't know where  Ehm', can anyone recommend anything? Last chance kind of, and then you'll get rid of me for a while  Killer game programming in Java - PreviewIntroductory Programming with Simple Games: Using Java and the Freely Available Networked Gaming Engine - PreviewDeveloping Games in Java - Preview
 11 Game Development / Newbie & Debugging Questions / Re: Ok guys, Needing to start somewhere - books? on: 2010-09-05 12:36:24 Quote from: dime on 2010-09-05 05:35:11I'm a hobbyist game programmer.  I found this book probably most helpful: Java-How-Program -Harvey-DeitelKiller Game Programming in Java is ok. I really like the concepts and him explaining them.  I didn't like the code examples and stuff like that.Also lots of the book seemed like cheap filler.  He has a chapter on "Networking for games", but it's really weak.He creates a very basic text client/server and some how that is considered "Killer Game Programming" to him?It would of been a lot better if he just explained concepts and "common problems" with networking in games.  Like how to deal with lag in a real time games or never trust to client, verify on server, etc, etc.  Tons of things he could of talked about, but instead he went with a very basic example of sending text over the wire.I also forgot what, but remember that something in the audio chapters also bugged me too.I wasn't to found of the graphics stuff either.  The book seemed dated when I read it a year or two ago.  Again, if he would of just stuck with concepts it would of been good; but he went with these awkward examples of using outdated and really slow graphics libraries to load sprites, etc.Hmm, the release date of that book keeps me from beein 100% sure that it's the best one..  The question stands then, if I was to choose one book, just oneWould it be some of them listed above, or, the 2010 one (which I think most positive about now, because, after all, it's new)A preview of "Introductory Programming with Simple Games" (The book that I call the "2010 book") is available at google books, can anyone with knowledge or experience give it a look?  http://books.google.se/books?id=EMuxvH65pW8C&printsec=frontcover&dq=Introduction+to+Java+Programming+with+Games+review&source=bl&ots=i4GY8zU3vB&sig=UuAOH6wOm6iMYwixOI-bDQoq1qQ&hl=sv&ei=P42DTK6aC4yQOM-i9f8N&sa=X&oi=book_result&ct=result&resnum=5&ved=0CDMQ6AEwBA#v=onepage&q&f=false
 12 Game Development / Newbie & Debugging Questions / Re: Ok guys, Needing to start somewhere - books? on: 2010-09-03 07:17:45 Quote from: Karmington on 2010-09-01 16:37:01Short-term : the one in which an example complete game is similar to the one you want to do.That's not that easy for me, right now I do not have any idea what game type to make, mostly because I've got no idea where I will be in a half year (counting in knowledge)Quote from: Karmington on 2010-09-01 16:37:01Long-term : the one with the most diverse range of subjects, and least platform specific OR totally problem specific.I find Ive bought quite a few code books but they were more useful in the days before the internetz.Now they are all semi-obsolete, for example DirectX7 specific books. They make great doorstops.But yeah, they did their part in helping out to advance. The more theoretical ones are often the onesI end up returning to, ones which dont care what language youre using, and which have often been toohard to even understand half of. In the end it's you making the things tick the way you want is where you learn the most.I've also thought like that, but a book is easier to follow. I mean, I've subscibed to numerous guides on (for example) youtube, that I'll use. But I'd also like (or prefer) a book, it's simply easier to learn from according to me  Thanks for a answerI think I'll choose book on Monday/Tuesday next week (Monday morning do we meet with the teachers and discuss how our work is going)I hope for at least one more answer still  It seems like there aren't any good comparisons "up-to-date" with the books mentioned..So I rely a little on people responses here EDIT: As I said, I found another book today, from 2010, "Introduction to Java Programming with Games - Ladd, B C", does anyone know anything?
 13 Game Development / Newbie & Debugging Questions / Re: Ok guys, Needing to start somewhere - books? on: 2010-09-01 15:09:17 Trying to bump a last timeI've got green light to start, and I'm buying a book next weekWhich one to go with?
 14 Game Development / Newbie & Debugging Questions / Re: Ok guys, Needing to start somewhere - books? on: 2010-08-29 22:15:26 Sorry for double-postingBut I felt like I needed a "bump", and I'll also add some facts..(I could say tomorrow, but, so everyone will know)In about 12 hours the teachers should have told me if my project gets "green light"If it goes that way, I'll start doing some research about the different books.. Because I can only afford one .. Maybe two if the second one is badly needed  Anyway, here is a list of the books I've got right now listed as "Java gaming books", and I haven't checked the availability of these in Sweden, nor listed them in any specific order other than:"Books I've read a little about:Killer Game Programming in Java - Andrew DavisonPro Java 6 3D Game Development - Andrew DavisonDeveloping Games in Java - David Brackeen"And "Books that I haven't read about yet:Black Art of Java Game Programming - Joel FanPractical Java Game Programming - Dustin ClingmanAdvanced Java Game Programming - David Wallace CroftBeginning Java Game Programming Second Edition - Jonathan S. "Are there more? Are these any good?All help until now and during the next week is very appreciated  //M
 15 Game Development / Newbie & Debugging Questions / Re: Ok guys, Needing to start somewhere - books? on: 2010-08-27 19:14:04 Quote from: markus.borbely on 2010-08-27 19:05:23I'm afraid not. It would be cheaper for me to buy the books new than to go there and get them.Hm, too bad  Anyway, thanks for trying..What book(s) did you offer? Because we are going to "east skåne" (Vi ska till Ivö) tommorrow .. but, probably to little time to plan something .. or is it? Quote from: markus.borbely on 2010-08-27 19:05:23We usually pay lots for shipping to Sweden.So true
 16 Games Center / WIP games, tools & toy projects / Re: Hyper Blazer on: 2010-08-27 10:39:07 Great game"Warning: this topic has not been posted in for at least 120 days.Unless you're sure you want to reply, please consider starting a new topic. "Then this will be a bump, kind ofI downloaded the jnpl file to my school laptop, it's really a great game that entartains for a good while, without much thinking  Just a question, I dont know the rules of things like this, I'm new here after all, but can you release a runnable version that doesn't need a internet connection?The jnpl file downloads the game every time, and we haven't got wireless access all over school soo
 17 Game Development / Newbie & Debugging Questions / Re: Ok guys, Needing to start somewhere - books? on: 2010-08-27 07:39:37 Quote from: markus.borbely on 2010-08-26 04:50:18how about 50 sek each? But before you go, let me check that they are still there.I asked around and it seems like I cannot get to Malmö, sorry  Do you have any way to send the book(s) (Which one was the second book?)I can send the "payment" in some way  Quote from: OverKill on 2010-08-26 07:29:41@Mattedatten@Books:Thinking in java you can get in a downloadable form.Also iirc the killer game java book is also available online in some form.You mean killer game programming in java?Lets say it like this ... the book is available "illegaly", I've thought about downloading it to check it out .. But, reading a .pdf on a screen is worthless, really..
 18 Game Development / Newbie & Debugging Questions / Re: Ok guys, Needing to start somewhere - books? on: 2010-08-25 18:11:04 Quote from: Cero on 2010-08-25 14:07:22Seconded. Those would be my recommendations.Noted, thanks Quote from: markus.borbely on 2010-08-25 17:03:37Darn, a bit to far I think. I have both of my java game books at my old work in Malmö. Since I will never go there again, anyone willing to pick them up there can have them.Malmö, southen sweden, pretty close to Copenhagen. I like the idea Maybe, just maybe, I could get there.. Do you have any prices in mind?  And, if I went there, how would I find them if you aren't there?  (To many smileys, sorry  )
 19 Game Development / Newbie & Debugging Questions / Re: Ok guys, Needing to start somewhere - books? on: 2010-08-25 07:36:44 Quote from: OverKill on 2010-08-25 07:13:31'Brackeens book' == "Developing Games in Java by David Brackeen"But to be honest, if your Java skills are only basic and 'newbie', maybe you should first brush up on those.Or else using the books will only reduce you down to copy & pasting everything.Because even without those books, you should be able to get something up and running.A good java book I could recommend is Thinking in Java.btw: are you German speaking? (I am assuming from the name). You could also check out "Java in 21 Tagen", it is available as an open book and a nice resource. (publisher is gallileo computing iirc)Ok, the "basic/newbie" is what I'm assuming my knowledge to be, I mean, there are so much more to learn.But I've went through "Programming A/B" (Half year each) here at this school, but still I do not believe it's a high level of knowledge.Sorry if this sounds "arrogant" or something, but it'll be a java gaming book, mostly because books are expensive and our libaries around here aren't interested in books like these Also, not german, Sweden here Quote from: markus.borbely on 2010-08-25 07:25:18If I am going to pick any one book, it is "Killer game programming in java". It is both 2D and 3D and it is toolbox style, pick what you want, skip the rest (almost).If you say you come from Sweden:Du är händelsevis inte från Malmö eller däromkring?Blekinge, hur visste du det? (How are the rules here about not writing in English?)Sounds good, again, maybe that book will be the one.. Still noone with experience of "Pro Java 6 3D Game Development"? I mean, it's a newer book from the same author as "Killer Game Programming in Java"This thread got better response than I expected, thanks But keep writing here, I probably won't order any book before next week.
 20 Game Development / Newbie & Debugging Questions / Re: Ok guys, Needing to start somewhere - books? on: 2010-08-25 05:03:30 Quote from: kapta on 2010-08-24 14:46:56my favorite java games book is Developing Games in Java by David Brackeen and do highly recommend it.Thanks! And it seems to be available here in Sweden also I'll look into it and hope for more recommendationsQuote from: psychopat316 on 2010-08-24 17:33:25I own "Killer game programming in java" and I recommend it.Great, thanks Quote from: markus.borbely on 2010-08-24 18:56:34I own both Brackeen's book and killer game programming. Both are good.Brackeen talks about developing a specific game framework, threadpool, sprites animation a bit of networking and finally 3D. It gives you piece by piece until you have made a complete game designed  by Brackeen, first 2D and then 3D. If you want to know about how to implement a software 3D engine, this is the book for you (I didn't ).Killer game programming is much more general. It talks about a multitude of techniques. You are given more pieces and more diverse pieces. They do not always fit togheter. More toolbox style. The 3D part deals with java 3d, not very up to date today. But the knowledge are mostly good as general 3D knowledge.What book is "Brackeens book", by googling I think you mean the one also recommended by psychopat316?Overall, thank you very much for this explanation! But, would you recommend one for my project?What type of game is the "end-product" in the Brackeens game - I mean - 2D/3D, game type etc?Would you recommend Killer Game Programming for my use? Because it seems better for me - but also seems to take more time to work through?But, thanks again for the explanations!Overall, haven't anyone tried Pro Java 6 3D Game Development?Thakns for answers until now at least!