Jump to content

[Java] Swing

Stardar1

So I am beginning to create a framework I can use to build 2-dimensional video games, however I have no experience using Swing.

 

General questions:

 

The coordinate system Swing uses, is the origin in the top left? what are the increments?

 

For the purposes of a 2-dimensional video game, is there a point in multiple Panels?

 

Any tips for Swing programming?

 

Any and all help appreciated. 

Different PCPartPickers for different countries:

UK-----Italy----Canada-----Spain-----Germany-----Austrailia-----New Zealand-----'Murica-----France-----India

 

10 minutes ago, Stardar1 said:

Well, with an i7, GTX 1080, Full tower and flashy lights, it can obviously only be for one thing:

Solitaire. 

Link to comment
Share on other sites

Link to post
Share on other sites

Multiple panels could be beneficial for example a mini map, stats bar that are updated less frequently or differently from the main game screen. At least from what I gather a panel is :P

 

The origin is at the top-left corner.

Link to comment
Share on other sites

Link to post
Share on other sites

The origin's in the top left as prolemur's mentioned. The increments are in multiples of 1, each being a pixel wide.

 

Do you need to use Swing here? Only I was following a YouTube channel by "TheChernoProject" building a 2D game (and engine) from scratch using Java & could recommend this. It's a reasonably easy start into both games programming and with Java where he runs through the steps of outputting and refreshing all the screen pixels individually and largely ignoring/bypassing the overhead of swing controls which you might find of interest/use too...

Link to comment
Share on other sites

Link to post
Share on other sites

The origin's in the top left as prolemur's mentioned. The increments are in multiples of 1, each being a pixel wide.

 

Do you need to use Swing here? Only I was following a YouTube channel by "TheChernoProject" building a 2D game (and engine) from scratch using Java & could recommend this. It's a reasonably easy start into both games programming and with Java where he runs through the steps of outputting and refreshing all the screen pixels individually and largely ignoring/bypassing the overhead of swing controls which you might find of interest/use too...

I have done something similar to that in C using 3D vectors, and understand the logic. A link would be great. 

 

I was told by my AP Comp Sci instructor that Swing was the best thing to use (this is a side project of mine), though I did not find it very intuitive. 

Different PCPartPickers for different countries:

UK-----Italy----Canada-----Spain-----Germany-----Austrailia-----New Zealand-----'Murica-----France-----India

 

10 minutes ago, Stardar1 said:

Well, with an i7, GTX 1080, Full tower and flashy lights, it can obviously only be for one thing:

Solitaire. 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×