Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (754)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (842)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Game Development / Newbie & Debugging Questions / Re: Game graphics on: 2009-02-17 19:29:04
What is the difference between paintComponent and paint?

What is the difference between overriding paintComponent/paint and this way of doing it:

Graphics2D g = (Graphics2D)strategy.getDrawGraphics();

Not to mention what is each line doing in the second case?  Like what data is in "g", what data is in "strategy"?  How do Graphics2D and BufferStrategy work together?

My problems were mostly from some sort of incongruence between the way I coded painting and key events.  They were interfering with each other and weren't working properly.  Maybe I was just coding poorly, but that was a very difficult problem to work around at the time.
2  Game Development / Newbie & Debugging Questions / Game graphics on: 2009-02-17 02:25:02
Graphics have always been confusing to me since the beginning of my java experience.  After some reading I understand that the whole Graphics thing is first sent to some sort of event handler, where it is actually drawn on the screen.

I was getting along fine by trying things and tweaking it until it worked, until I tried to make a real game, with a lot of things going on, and more complex controls and movement.  I ran into some problems due to the gap between my understanding of what was going on and how Graphics actually worked.  I eventually worked around it, but it was ugly.  I thought concurrency would solve my problems, but that was just horrendous.

Since then I've been afraid of Graphics.  I felt like there should be a more tame version of Graphics, or there must be at least some sort of convention when working with it that I wasn't aware of.

I try to read tutorials, but reading tutorials is how I got in the position I am in, so I'm not so sure what is good and what isn't, what I can combine and what conflicts.  I also looked into full screen and it seems like that might be simpler to deal with, but I guess you could say I'm afraid that I'll learn all about it and end up having a useless heap of knowledge that I can't handle.

It just seems so confusing and wrong to me that I feel like I'm missing something.  So how do "real" java game programmers implement graphics without running into problems when dealing with graphics that are relatively mundane for games?
Pages: [1]
DesertCoockie (33 views)
2018-05-13 18:23:11

nelsongames (75 views)
2018-04-24 18:15:36

nelsongames (69 views)
2018-04-24 18:14:32

ivj94 (752 views)
2018-03-24 14:47:39

ivj94 (82 views)
2018-03-24 14:46:31

ivj94 (622 views)
2018-03-24 14:43:53

Solater (98 views)
2018-03-17 05:04:08

nelsongames (179 views)
2018-03-05 17:56:34

Gornova (405 views)
2018-03-02 22:15:33

buddyBro (1065 views)
2018-02-28 16:59:18
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!