Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (538)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (601)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Java2D - Space Invaders  (Read 4410 times)
0 Members and 1 Guest are viewing this topic.
Offline Dregron
« Posted 2013-09-22 00:54:05 »

Hi i just wanted to post my tutorials on creating Space Invaders but trying to create it with pre-refactored (most of it aleast) code.

My main reasons for doing this is to hopefully let beginners/intermediate programmers be able to come in and easily understand
and change code when they want to.

Still need a lot of practice with commentary and confidence but i am sure that will come in time, and also sorry about the microphone i
need to get a new one.

This is just a hobby just now but if they acutely help some programmers then i will make a schedule but for
just now am kind of just posting them whenever. but they should be a video about 1-4 every 2 weeks depending
on the circumstances.

http://www.youtube.com/user/DregronProgram

But if you give it a chance i hope you enjoy and get something out of it,
Cheers Smiley




The trouble with programmers is that you can never tell what a programmer is doing until it’s too late.
Offline opiop65

JGO Kernel


Medals: 161
Projects: 7
Exp: 4 years


JumpButton Studios


« Reply #1 - Posted 2013-09-22 01:50:32 »

Have you read the rules of this board? You're supposed to include code and not just advertising your videos.

Online wessles

JGO Wizard


Medals: 77
Projects: 4
Exp: 3 years


Radirius Games


« Reply #2 - Posted 2013-09-22 02:04:14 »

I don't know about anyone else, but I would NOT use java2d. It is slow, and takes longer to code, compared to lwjgl, which is easier to learn, faster to make, and over all just looks a lot better. If I were to make this tutorial, I would mention lwjgl, and how you should move on from java2d to it when you need better looking graphics. But hey, that is just my opinion. I await the coming 'you're so ignorant!'

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 139
Projects: 4
Exp: 3 years



« Reply #3 - Posted 2013-09-22 02:08:16 »

"lwjgl easier to learn than java2d"
I lol'd.

Anyways yeah, either request deletion or copy+paste the actual tutorial here.
Offline opiop65

JGO Kernel


Medals: 161
Projects: 7
Exp: 4 years


JumpButton Studios


« Reply #4 - Posted 2013-09-22 02:10:40 »

Are you suggesting that newbies should jump straight into lwjgl? Really? If you remember, you most likely started out with java2D. Lwjgl doesn't handle anything for you. You have to make everything, like spritesheets, buffer objects and whatever else low level stuff you need. If you don't want someone to say you're ignorant, don't say ignorant things. Nobody starts out with lwjgl. Almost everyone I know started out with java2d because its noon friendly. Do they use it anymore? No. But that's just because yes, it is slow and clunky. But at least you don't have to write everything yourself.

Online wessles

JGO Wizard


Medals: 77
Projects: 4
Exp: 3 years


Radirius Games


« Reply #5 - Posted 2013-09-22 02:26:05 »

Sorry. I sort of jumped behind myself there. I really meant that he should mention that once you are good with java2d, you should move into lwjgl. That does not mean 'newbies should jump straight into lwjgl[.]' It could mean that you use libGDX, slick2D, or something. You could even use slick-util for all the buffering and loading stuffs. Lwjgl isn't that hard to learn... Takes time though (for me, anyways).

BTW: I did start with java2d, and almost quit game programming because of the hierarchy. It just did not make sense to me... Then my hobby was saved when I found lwjgl. It all just flows so nicely (to me, anyways)! Just set up a display in a few lines, and start loading textures and drawing. I will never go back Smiley.

Offline Jeremy
« Reply #6 - Posted 2013-09-22 02:33:42 »

Stop calling libraries you don't use properly slow because you don't use them properly.

lwjgl in terms of basic 2D graphics is minimally more difficult than Java2D due to the loss of abstraction. To argue though that it makes interfacing with graphics in general more or less complex is absurd. Any properly written game or engine will have abstracted the rendering procedure enough anyways to plug either one in. You should use what is best for your project.

If you can get away with Java2D there is absolutely NO reason to use a native dependency like lwjgl AT ALL outside of sheer preference (preference vs portable code... hmm.)

If your code needs to perform more complex rendering algorithms that Java2D makes very difficult (lacking any direct access to hardware etc) and any alternatives perform too poorly than you can consider the very easy transition to lwjgl (easy assuming code was structured properly.)

You throw away a huge advantage offered by Java by using complex native dependencies (that go all the way down to kernel drivers) when you don't need them.

JevaEngine, Latest Playthrough (This demo is networked with a centralized server model)

http://www.youtube.com/watch?v=rWA8bajpVXg
Offline opiop65

JGO Kernel


Medals: 161
Projects: 7
Exp: 4 years


JumpButton Studios


« Reply #7 - Posted 2013-09-22 02:45:14 »

I don't find java2D slow at all really. Running a mostly complete 2D engine with a particle engine, hundreds of mobs and lighting and I get over 1000 fps on my decent machine. Just because you can't use it correctly doesn't mean no one else can.

Hell, my honors high school computer science class used java3D to create a fully functional Mario kart clone that actually runs on the crappy single core Intel CPUs that the school computers use. If you can't manage to structure your projects correctly so that your game runs faster than our school project, then you seriously need to learn some basic Java. Stop bashing on Java2D and realize its a decent tool to use, when its the correct time to use it.

Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 139
Projects: 4
Exp: 3 years



« Reply #8 - Posted 2013-09-22 02:52:28 »

Exactly what's wrong with Java2D hierarchy? The complaints with Java2D are never associated with hierarchy. Also, how is lwjgl going to be better - lwjgl 'hierarchy' is just your own written code, which in terms of object-oriented development is probably worse than the guys at Oracle.
Online wessles

JGO Wizard


Medals: 77
Projects: 4
Exp: 3 years


Radirius Games


« Reply #9 - Posted 2013-09-22 03:08:23 »

I did not say that Java2d is horrible. I'm sure it is great if used correctly. I am saying that I work better with opengl. It suites me.

Sorry to say, but I just don't like using java2d. That is just my preference. It just clicks more naturally with me. I am not saying that lwjgl is easier to learn. I am saying that I had a better experience with lwjgl. Also, why would you need to make graphics abstract? All the engines do that, but I have no clue why.

"NO reason to use a native dependency like lwjgl AT ALL outside of sheer preference (preference vs portable code... hmm.)"
Are you saying that lwjgl isn't portable (as in port to all OS?)?If so, look at far sky! It ports to Windows, Mac, And Linux! And it was written in lwjgl!

I don't see any disadvantages with its capabilities. It runs off of hardware. What is wrong with using native libs? And by the way, I hated the hierarchy in java2d, just because it did not feel like I was making a game. It felt like I was hacking into a window making program, and making a game. I mean, paint(), JFrame, JPanel, all of it just sounded like tools to making a window, not rendering anything other than some buttons and images.

And above all:
This is all my opinion!
I have not had any issues with lwjgl, its lack of abstraction, or how it is a native library! Thus, I use it! I just don't want to use java2d because it does not suite me. Granted, a lot of things will not 'suite' me in coding, but when I find out that there is an alternative to it, I want to use it!

And what are the issues with using lwjgl over java2d?

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Dregron
« Reply #10 - Posted 2013-09-22 10:56:35 »

yeah i realized my mistakes after i posted  Clueless, shouldn't have done it so late.
Sorry for the mistake i have sent a message endolf so should be sorted soon.

And the reason am using Java2D is just because of its simplicity you can just jump right into
it and not have to worry about versions or libs etc. I wanted to make it
simple and not difficult to follow, its more for people who know java but are not yet confidant enough
to code there own things yet.

The trouble with programmers is that you can never tell what a programmer is doing until it’s too late.
Offline opiop65

JGO Kernel


Medals: 161
Projects: 7
Exp: 4 years


JumpButton Studios


« Reply #11 - Posted 2013-09-22 12:30:27 »

No, don't feel bad for using java2D. It was the right choice because yes, newbies would have a hard time with anything else. I'll check out your tutorials later and tell you if I like them! Smiley

Online wessles

JGO Wizard


Medals: 77
Projects: 4
Exp: 3 years


Radirius Games


« Reply #12 - Posted 2013-09-22 16:28:36 »

Yeah. Don't worry. It wasn't a bad thing to use java2d. I was saying that I have had better experience with lwjgl. For a simple game like this, you did a good job explaining and guiding! I am just saying that you should at least mention at some point that there are other libraries than java2d, if they don't like java2d.

Oh, and I looked more in depth into the tutorials, and thought that you did an excellent job!

Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 139
Projects: 4
Exp: 3 years



« Reply #13 - Posted 2013-09-22 16:32:50 »

As advice for your video series, you ought to put the tutorials in a playlist, so you don't have scroll down from 16 to 1 to watch the first tutorial.
Also, is there a specific reason you're using AWT not Swing?
Offline das_ig

Junior Newbie





« Reply #14 - Posted 2014-01-06 12:56:21 »

Great tutorial for newbies like me  Grin.  thankx
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

rwatson462 (30 views)
2014-12-15 09:26:44

Mr.CodeIt (20 views)
2014-12-14 19:50:38

BurntPizza (42 views)
2014-12-09 22:41:13

BurntPizza (76 views)
2014-12-08 04:46:31

JscottyBieshaar (37 views)
2014-12-05 12:39:02

SHC (51 views)
2014-12-03 16:27:13

CopyableCougar4 (48 views)
2014-11-29 21:32:03

toopeicgaming1999 (115 views)
2014-11-26 15:22:04

toopeicgaming1999 (103 views)
2014-11-26 15:20:36

toopeicgaming1999 (30 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50
java-gaming.org 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‑gaming.org
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!