Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (522)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (590)
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  
  How many ways could a game be developed?  (Read 435 times)
0 Members and 1 Guest are viewing this topic.
Offline CodeWarrior

Senior Newbie





« Posted 2014-01-13 12:58:06 »

Sorry if this is a stupid question, I've been away from programming for a while and just got back into it.

I'm interested is there more than one way a game like pong for example could be programmed? or would it always be near enough 95% the same code (methods, libraries etc).. Excluding named variables of course hence the 95% . Lets say if it was a pong to be developed using JFrame...

Basically would there be a number of ways to code it to do that job of the classic pong? or even space invaders, tetris etc

I'd be interested to hear some feedback on this from the pros to help with my learning & confidence carrying on

I've also posted this question before in another java forum (not java gaming) but that was more for software, I'm interested to see what the experts have to say on here...

Thanks
Offline trollwarrior1
« Reply #1 - Posted 2014-01-13 13:09:03 »

You can make pong however you want. You can create it using byte code if you're a genius or something. I mean, .. Might be lame answer, but here you go.
You can create it anyhow you can / want. Might be 100% different than the original.
Offline Varkas
« Reply #2 - Posted 2014-01-13 13:14:19 »

Too many ways ...

You can always make an interpreter, e.g. simulate a toruing machine, and then invent some new syntax and semtantic just for this one project.

Even in methodologies you have many choices

- functional
- procedural/imperative
- flavors of object orientation
- logic based (fact/resolution systems)
- self modifying/self-generating code
- descriptive languages + scripting/interpretation



if (error) throw new Brick(); // Blog (german): http://gedankenweber.wordpress.com
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline CodeWarrior

Senior Newbie





« Reply #3 - Posted 2014-01-13 13:35:18 »

Great thanks..

I've noticed today that for keyboard input moving lets say a g.drawRect() on JFrame, there are many ways of using the key class to do this?

1. How many ways from the top of your head do you think you could do this? (This will also help me on the research side to programming in java)

Also, 2. How should I start out with programming a small game like pong/breakout, would it be best if I just stick to making it in one class first?

If someone could answer these 2 questions especially the 1st one that'd be excellent personally.
Offline Gibbo3771
« Reply #4 - Posted 2014-01-13 15:28:24 »

Great thanks..

I've noticed today that for keyboard input moving lets say a g.drawRect() on JFrame, there are many ways of using the key class to do this?

1. How many ways from the top of your head do you think you could do this? (This will also help me on the research side to programming in java)

Also, 2. How should I start out with programming a small game like pong/breakout, would it be best if I just stick to making it in one class first?

If someone could answer these 2 questions especially the 1st one that'd be excellent personally.


2. If you have experience with Java/Programming and know how to do basic OOP...no, split it and make it easier for yourself imo.

When I made Pong, I had 4 main classes. Player, AI, Paddle, Ball.

Despite it still being messy, it would have been a hella lot more ugly if it was in a single class.

Although you can pretty easily create it in once class with < 500 lines using a lib like LibGDX. Probably.

"This code works flawlessly first time and exactly how I wanted it"
Said no programmer ever
Offline Longor1996
« Reply #5 - Posted 2014-01-13 15:50:56 »

If we go and say that the game files can take up no more than 2 GB, then its about:
4611686018427387904 ways, in the matter of bytes that can be different.

It's probably even more than that, because I most probably made an error in my calculation!

Have a nice day!

- Longor1996

Sorry for my bad English! That's because i am from Germany.
Offline ctomni231

JGO Wizard


Medals: 99
Projects: 1
Exp: 7 years


Not a glitch. Just have a lil' pixelexia...


« Reply #6 - Posted 2014-01-13 23:17:08 »

I've noticed today that for keyboard input moving lets say a g.drawRect() on JFrame, there are many ways of using the key class to do this?

1. How many ways from the top of your head do you think you could do this? (This will also help me on the research side to programming in java)

Also, 2. How should I start out with programming a small game like pong/breakout, would it be best if I just stick to making it in one class first?

If someone could answer these 2 questions especially the 1st one that'd be excellent personally.

Okay, seems to me that you are fairly new to programming, so I'm going to try to put some perspective on coding.

Creating a game is more like drawing, or planting a seed. So, when you ask "how many different ways can you code?" You are asking "how many ways a plant can grow?", or "how many ways you can draw a tree?" You know the answer is a number, but you can't say what it is. It is something we can't measure. There are numerous different ways to write "Pong". A programmer can write it in 100 lines of code all the way 5000000 lines of code and more if they wanted to. The fact is it all depends on who you ask, and how good of a programmer the person is. There are as many ways to write a program as there are stars in the universe.

As for writing programs themselves. You always start simple. You write things in one class and expand outward from there. You can learn functions by just seeing how you can remove some code from your "main" class to make a function. When you code, the main idea is to make doing repetitive tasks easier. That is what computers were designed for. When you code, you are doing the same thing. Classes and functions are made to prevent you from having to repeat the same lines of code 40 times. The moment you are repeating code, that is when you know it is time to start using those functions.

The best way to learn how to program is to practice at it. There is a lot of information on the forums here and elsewhere on how to program. I hope this little segment broadens what programming is to you a little more.


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.

trollwarrior1 (32 views)
2014-11-22 12:13:56

xFryIx (73 views)
2014-11-13 12:34:49

digdugdiggy (52 views)
2014-11-12 21:11:50

digdugdiggy (46 views)
2014-11-12 21:10:15

digdugdiggy (40 views)
2014-11-12 21:09:33

kovacsa (64 views)
2014-11-07 19:57:14

TehJavaDev (69 views)
2014-11-03 22:04:50

BurntPizza (67 views)
2014-11-03 18:54:52

moogie (82 views)
2014-11-03 06:22:04

CopyableCougar4 (82 views)
2014-11-01 23:36:41
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

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!