Python or Java?

Started by
18 comments, last by fir 10 years, 3 months ago

Ok, I get it. So the language is a tool for creating games, and I first need to learn "programming" before I learn "game programming". So i'll stick to python.

But let's say iv'e watched all of thenewboston's videos about python (43 of them), and I now know and have practiced all the basics. I know all the basic commands, functions, modules etc. Where do I go from there? How do I get this knowledge of writing python to serve me in making actual games? How will "print x" or "if x else y" be translated into a game? How do I start doing this process called "game programming"? It's like learning how to use work tools and then wanting to build a building.

Advertisement

Ok, I get it. So the language is a tool for creating games, and I first need to learn "programming" before I learn "game programming". So i'll stick to python.

But let's say iv'e watched all of thenewboston's videos about python (43 of them), and I now know and have practiced all the basics. I know all the basic commands, functions, modules etc. Where do I go from there? How do I get this knowledge of writing python to serve me in making actual games? How will "print x" or "if x else y" be translated into a game? How do I start doing this process called "game programming"? It's like learning how to use work tools and then wanting to build a building.

For Python you can use pygame (a library) to handle graphics, input and sound.

Start with a very small game project (i usually recommend pong since it is fairly trivial).

Break it down into as small parts as you can.

what objects or data structures do you need to represent the game state ?

what rules govern how the game state is updated ?

then its simply a matter of a loop that:

*checks for player input

*updates the game state

*presents the gamestate to the player (i.e , draw stuff on screen and play sound effects)

[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!

Ok, I get it. So the language is a tool for creating games, and I first need to learn "programming" before I learn "game programming". So i'll stick to python.

But let's say iv'e watched all of thenewboston's videos about python (43 of them), and I now know and have practiced all the basics. I know all the basic commands, functions, modules etc. Where do I go from there? How do I get this knowledge of writing python to serve me in making actual games? How will "print x" or "if x else y" be translated into a game? How do I start doing this process called "game programming"? It's like learning how to use work tools and then wanting to build a building.

write some simple stuff like mandelbrot set viewer or arkanoid

then you could try to learn some more complex platform game

or something

hard truth is that this (doin decent game) is very hard (very large amunt of work, it is for example much harder then get a master degree in the college)

I was learning such basics you learn 20 years ago about '90

(though I was going very low lewel and got more than 10 years

of break in meanwhile) and still trying to make some decent game

with only partial succes - If this is not scary you - it should ;/

ps. probably native engish speakers got somewhat easier here becouse not knowing english can probably slow down you much here and learning english to this extent can take 5-10 years too (big part of articles tutorials etc are only avaliable in english - end even whan i was able to read english i was doing it much slower than in native language (still probably i read it a bit slower and it get more tired when reading english) -

If you need to further your programming (and library use), I'd suggest learning to use API's and looking up the information on installation and use of the pygame library to make some simple games. Python and pygame is great and you can do a lot with it -- so go at it! You'll notice that something like "handling collision" and other algorithms can be translated from language to language, so "game programming" will be a bunch of tools and algorithms you learn using python and pygame. Check it out and learn a lot!

There's also a ton of videos on youtube about making games with pygame, so if youtube videos are helping you a lot, I'd say go for it :)

From reading around some more, I came to realize that Java is much more efficient than python for creating full scale iOS and PC games (that's what im aiming for).

Efficiency is one of the last things you should worry about as a beginner. You're not exactly going to be writing Battlefield 5. Focus on what you find easiest to work with for now which certainly will be influenced by familiarity (so sticking with Python if you're already started down the road is very valuable). Given a year or three of experience you'll have the knowledge to not only make a choice between languages for new projects but also be able to ask the right questions.

Actually, efficiency is EXACTLY what he/she should worry about as a beginner; it's just a matter of how you define efficiency. ( For the record, I agree with you completely, I am just being a pedant ).

See, there are many metrics by which you can measure a programming languages efficicency. The speed of the code it generates, the productivity of the programmer using it, or the speed in which someone learns the language.

As a beginner, you want to choose a language that is efficient for learning. This generally means no or a simplified build cycle ( if you dont know what this means, good! you picked a language that fit the criteria! ), lots of supporting documentation and a large community of people to talk to. Python fits this criteria, although it wouldn't be my personal recommendation. ( I would personally recommend LUA ).


Ok, I get it. So the language is a tool for creating games, and I first need to learn "programming" before I learn "game programming". So i'll stick to python.

But let's say iv'e watched all of thenewboston's videos about python (43 of them), and I now know and have practiced all the basics. I know all the basic commands, functions, modules etc. Where do I go from there? How do I get this knowledge of writing python to serve me in making actual games? How will "print x" or "if x else y" be translated into a game? How do I start doing this process called "game programming"? It's like learning how to use work tools and then wanting to build a building.

If-statements allow you to make decisions based on a test case. Can you not think of any situations in a game where you could use this? Logical statements are the most commonplace things. If I'm hungry, I eat, else, I don't eat. Simple. Of course the computer doesn't attribute it's logic skills to intuition, so you have to make that decision explicitly. If a player's health is less than 0%, then end game and notify the player.

You probably wouldn't be using the "print" function unless you were making a text-based game or debugging with the console. The reason why tutorials use functions like this when teaching is because they're easy to use and without them you wouldn't have any means to get meaningful output without writing code to accomplish that. That's clearly not a good start.

Also, I should note that, you don't have to learn "programming" before learning "game programming." Just practice writing code, and make sure you complete your projects. In that respect, you ought to start small and gradually crank up the difficulty. If you feel you can handle a small game, then write a small game.

I'm not sure if I explained your questions coherently. I feel like I might not have addressed them completely. I'm a little tired so I'm writing this on limited mental capacity, but I'll get back to this tomorrow and see if what I said makes sense biggrin.png

Yo dawg, don't even trip.

You can always use both. It's incredibly easy to extend Java with Python (or to use Java in Python) with Jython. Jython let's you use Java in Python, and you can use the Java Scripting API to script Java applications. But unless you really need both it's generally not done.

Irh9: I would also not recomment mixing multiple languages when you just start with programming. Usually the syntax of one language is enough to deal with for a beginner. Two different ones are already problematic for someone who tries to understand the basic principles of programming.

Ok so for now ill study python and later use pygame for making some basic games. And ill see where ill go from there :)

Thanks to everyone who commented for your time and patience :)

IMo It is not to much important what you will chose, you still can change it a 'million' times. To be honest such kind of questions often gets me a bit angry (boring, boring, boring) but what to do. I would much like prefer to make a whole directory in this forum for such kind of questions "where to start"/"what to use"

This topic is closed to new replies.

Advertisement