Sign in to follow this  

What to do now?

This topic is 405 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, everyone, I just joined the community

So, I'm in the process of learning python, I got the basics and a little more, I started learning this language because I got interested in programming, but recently the game development part of it got me interested as well, however, I'm not sure where to go from here.

Should I keep going with Python? If I had to, I'm not sure where to go from where I am, I started learning Javascript a while ago before finding out about the game development world, I've read I should learn C (or C#/C++ I don't even know).

The point is I'd really appreciate some guidance here, thanks a lot in advance

(English is not my native language, sorry if there's any errors)

Share this post


Link to post
Share on other sites

Hi, and welcome,

 

I think you're doing fine. Python is a nice language to learn programming, including game programming.

 

python.org doesn't seem to have a wiki page dedicated to game programming, but one site I know is pygame.org Pygame is the standard Python module for writing games in Python.

As for what type of game you can make, there is an article that you can read http://www.gamedev.net/page/resources/_/technical/game-programming/your-first-step-to-game-development-starts-here-r2976

 

Not sure if you want to do them all (likely not), but it should help to get inspired :)

 

 

As for other languages, yes, eventually. The point is that game programming isn't that simple. If you also take on learning a new programming language at the same time, you're making it all  a lot harder. I would suggest to try a new language once you are somewhat comfortable with programming / game programming.

 

Learning a new language does however make you a better programmer, as you get new options to choose from. I'll list a few as a reference.

The C# language is relatively close to Python (the other one being Java), which means the step won't be as large.

C is very much "bare metal programming". You'll get a deeper understanding how the computer really works, at the cost of having to write a lot of code. (Computers are a lot less smart than Python makes it believe they are.)

C++ is also close to the metal, like C, but much higher level. It's the standard language for high-end games. Like C, the C++ language gives you heaps of freedom, and assumes you know how to handle that, which makes for an interesting ride :)

 

I don't know Javascript, except that it's used in browsers, but you probably already figured that out :)

 

Anyway, have fun, if you have further questions, just ask

Share this post


Link to post
Share on other sites

Hi, and welcome,
 
I think you're doing fine. Python is a nice language to learn programming, including game programming.
 
python.org doesn't seem to have a wiki page dedicated to game programming, but one site I know is pygame.org Pygame is the standard Python module for writing games in Python.
As for what type of game you can make, there is an article that you can read http://www.gamedev.net/page/resources/_/technical/game-programming/your-first-step-to-game-development-starts-here-r2976
 
Not sure if you want to do them all (likely not), but it should help to get inspired :)
 
 
As for other languages, yes, eventually. The point is that game programming isn't that simple. If you also take on learning a new programming language at the same time, you're making it all  a lot harder. I would suggest to try a new language once you are somewhat comfortable with programming / game programming.
 
Learning a new language does however make you a better programmer, as you get new options to choose from. I'll list a few as a reference.
The C# language is relatively close to Python (the other one being Java), which means the step won't be as large.
C is very much "bare metal programming". You'll get a deeper understanding how the computer really works, at the cost of having to write a lot of code. (Computers are a lot less smart than Python makes it believe they are.)
C++ is also close to the metal, like C, but much higher level. It's the standard language for high-end games. Like C, the C++ language gives you heaps of freedom, and assumes you know how to handle that, which makes for an interesting ride :)
 
I don't know Javascript, except that it's used in browsers, but you probably already figured that out :)
 
Anyway, have fun, if you have further questions, just ask


Thanks a lot man, I appreciate the time you took on replying, I'm gonna check out the link you posted

Now, here's a weird proposal.

It occurred to me, maybe you could give me your email? I think everything would be easier if I could actually contact you when I have some doubt or something, obviously I would not annoy you daily, I just think I could use the help.

You can say no, though, the reply you gave is more than enough.

Thank you again

Share this post


Link to post
Share on other sites

Don't worry, we're a helpful bunch here, and we're used to new people asking unexpected questions :)

Unless you insult people, you will be given a good answer, although it may not always be the answer you expect.

 

In society, it is often seen as bad if you have to ask a question.

Here, nobody knows everything, and asking questions about things is considered to be good. You'll get smarter (get better understanding), and often other people also learn a thing or two. So don't be afraid to ask when you want to know or when you're not sure. Everybody here has such problems, even experienced programmers. Talking about it often gives you new angles you didn't consider yourself. (Browse the forums to see all the weird topics that experienced programmers discuss :) )

 

Last but not least, you'll get quicker answers here (there is usually someone around scanning the forum), and you'll get better answers, as people will add things that others forgot to mention, or they correct errors.

Share this post


Link to post
Share on other sites

Hello, GabrielJim!

 

Python is good enough for games development and I recommend you stick with it for now.

 

Eventually you would use PyGame(an API for games) for handling graphics, input and sound, but before that I recommend looking at the following two things...

 

1) Write a text-based game.  This could be a "ye olde" adventure game along the lines of "You are in a room with a DRAGON, surrounded by treasure.  You are armed with a FEATHER DUSTER.  What now?" or perhaps a resource management game...similar to Championship Manager, where you just navigate menus via a list of options.  If you are really adventureous though,  one could actually make a full blown text rpg along the lines of the old Final Fantasy games!  Just running from a "command prompt", or a linux "terminal", this sort of game only requires your knowledge of whatever language you are using. Give it some thought, though...

 

2) "Visual Programming" or making GUI apps.  One of the things so easily over-looked by the beginner is that they will eventually have to create tools to make levels, characters and other such stuff for their games.  Python has the capability to create windows and include menus, buttons, text fields and drop-down selection boxes.  You definitely want to delve into this stuff as you can produce files that can be loaded by your PyGame program.  Also, remember that text-based game stuff I mentioned before? Well, now you can beef it up with buttons, simple graphics and a menu bar to assist in saving your game instead of typing in commands, using mouse clicks! Hurrah!

 

...after all this, you will enter the games-api arena with the confidence of a Rock-God!

 

Have fun! ^_^

Edited by Anri

Share this post


Link to post
Share on other sites

Don't worry, we're a helpful bunch here, and we're used to new people asking unexpected questions :)

Unless you insult people, you will be given a good answer, although it may not always be the answer you expect.

 

In society, it is often seen as bad if you have to ask a question.

Here, nobody knows everything, and asking questions about things is considered to be good. You'll get smarter (get better understanding), and often other people also learn a thing or two. So don't be afraid to ask when you want to know or when you're not sure. Everybody here has such problems, even experienced programmers. Talking about it often gives you new angles you didn't consider yourself. (Browse the forums to see all the weird topics that experienced programmers discuss :) )

 

Last but not least, you'll get quicker answers here (there is usually someone around scanning the forum), and you'll get better answers, as people will add things that others forgot to mention, or they correct errors.

 

Alright, i'll have it in mind if i get any problems or anything :)

Hello, GabrielJim!

 

Python is good enough for games development and I recommend you stick with it for now.

 

Eventually you would use PyGame(an API for games) for handling graphics, input and sound, but before that I recommend looking at the following two things...

 

1) Write a text-based game.  This could be a "ye olde" adventure game along the lines of "You are in a room with a DRAGON, surrounded by treasure.  You are armed with a FEATHER DUSTER.  What now?" or perhaps a resource management game...similar to Championship Manager, where you just navigate menus via a list of options.  If you are really adventureous though,  one could actually make a full blown text rpg along the lines of the old Final Fantasy games!  Just running from a "command prompt", or a linux "terminal", this sort of game only requires your knowledge of whatever language you are using. Give it some thought, though...

 

2) "Visual Programming" or making GUI apps.  One of the things so easily over-looked by the beginner is that they will eventually have to create tools to make levels, characters and other such stuff for their games.  Python has the capability to create windows and include menus, buttons, text fields and drop-down selection boxes.  You definitely want to delve into this stuff as you can produce files that can be loaded by your PyGame program.  Also, remember that text-based game stuff I mentioned before? Well, now you can beef it up with buttons, simple graphics and a menu bar to assist in saving your game instead of typing in commands, using mouse clicks! Hurrah!

 

...after all this, you will enter the games-api arena with the confidence of a Rock-God!

 

Have fun! ^_^

 

Hey!

 

Yes, i was actually playing around with the idea of a text based game, the thing is i don't really know how to proceed with it, should i just write a program based on if/else statements? Or do you know an easier way?

 

Thanks, for the reply!

Share this post


Link to post
Share on other sites

GabrielJim, I would probably look at using a "switch" statement instead, for a menu.

 

However, I've just gone through my books, and had a look at "Python Programming for the absolute beginner", by Michael Dawson.  It does seem like a perfect fit for you as each chapter is focused on making a game(or sometimes just programs) with Python.  These include text-based games, and later in the book also cover GUI programming and PyGame and another library for multimedia called "livewires".

 

Depending on where you are, its $35 or £20.  Its a book you can grow with, and takes you right up to PyGame which shows you how to make a fruit-slicing game and an Asteroids clone.  Everything you need! ^_^

Share this post


Link to post
Share on other sites

GabrielJim, I would probably look at using a "switch" statement instead, for a menu.

 

However, I've just gone through my books, and had a look at "Python Programming for the absolute beginner", by Michael Dawson.  It does seem like a perfect fit for you as each chapter is focused on making a game(or sometimes just programs) with Python.  These include text-based games, and later in the book also cover GUI programming and PyGame and another library for multimedia called "livewires".

 

Depending on where you are, its $35 or £20.  Its a book you can grow with, and takes you right up to PyGame which shows you how to make a fruit-slicing game and an Asteroids clone.  Everything you need! ^_^

 

Oh, that seems pretty perfect.

However, does it cover Python 2 or Python 3? I'm learning Python 3 and i feel like it would not be a good idea to mix it up

Share this post


Link to post
Share on other sites

Assuming that nothing happens until the user has entered some input, your game is a 'while' loop with an 'input' statement and code to process that input.

Usually, you also want to print something before asking the next input, so the user knows what happened too.

 

You could try hangman as first text-based game, as there is very little processing to do there.

 

 

As for best way to write code, the opinions vary :)  In fact, as you get more experienced you'll find new and better ways to express the same thing. Thus even the same person changes opinion over time.

 

In my experience, the best strategy is to start small, and slowly make it bigger. When you realize things get too large, or cannot be handled easily, stop adding and think of a better solution. Likely this will happen a few times before you get it right (and this is normal, I have programmed for 30 years, and still have this problem), but every time you find it went wrong, you learn a little so you can avoid the same mistake the next time.

As for fixing, you can either fix the code that you have at that point in time, or you can go back to an earlier version (if you have that), or you can start from scratch again. Every option has different advantages and disadvantages, as you'll find out.

 

Last but not least, let others read your code (the technical term is "code review" although that is a bit more formal), and read code of others. While it is scary at first, and getting comments on your work may feel awkward, it is generally given in positive spirit, as points where you can improve.

The more important part however is the explanation how to improve those points. That's the real gold, knowledge how to get better real quickly.

You can ask for a code review right here, just post the code (use the "<>" symbol for the code, as that makes it look good). You can also post code fragments that way if you have a question about some particular part.

 

@Anri: Python does not have a "switch" statement, you code it as a "if ..: ... elif .. : ... elif ... : ... else: ..." sequence.

Share this post


Link to post
Share on other sites

Assuming that nothing happens until the user has entered some input, your game is a 'while' loop with an 'input' statement and code to process that input.

Usually, you also want to print something before asking the next input, so the user knows what happened too.

 

You could try hangman as first text-based game, as there is very little processing to do there.

 

 

As for best way to write code, the opinions vary :)  In fact, as you get more experienced you'll find new and better ways to express the same thing. Thus even the same person changes opinion over time.

 

In my experience, the best strategy is to start small, and slowly make it bigger. When you realize things get too large, or cannot be handled easily, stop adding and think of a better solution. Likely this will happen a few times before you get it right (and this is normal, I have programmed for 30 years, and still have this problem), but every time you find it went wrong, you learn a little so you can avoid the same mistake the next time.

As for fixing, you can either fix the code that you have at that point in time, or you can go back to an earlier version (if you have that), or you can start from scratch again. Every option has different advantages and disadvantages, as you'll find out.

 

Last but not least, let others read your code (the technical term is "code review" although that is a bit more formal), and read code of others. While it is scary at first, and getting comments on your work may feel awkward, it is generally given in positive spirit, as points where you can improve.

The more important part however is the explanation how to improve those points. That's the real gold, knowledge how to get better real quickly.

You can ask for a code review right here, just post the code (use the "<>" symbol for the code, as that makes it look good). You can also post code fragments that way if you have a question about some particular part.

 

@Anri: Python does not have a "switch" statement, you code it as a "if ..: ... elif .. : ... elif ... : ... else: ..." sequence.

Does it not have a switch statement? OMG, thats a nightmare!  :blink:

 

Quite surprised at that, Alberth.  Any idea as to why its not got a switch?

Share this post


Link to post
Share on other sites

Assuming that nothing happens until the user has entered some input, your game is a 'while' loop with an 'input' statement and code to process that input.

Usually, you also want to print something before asking the next input, so the user knows what happened too.

 

You could try hangman as first text-based game, as there is very little processing to do there.

 

 

As for best way to write code, the opinions vary :)  In fact, as you get more experienced you'll find new and better ways to express the same thing. Thus even the same person changes opinion over time.

 

In my experience, the best strategy is to start small, and slowly make it bigger. When you realize things get too large, or cannot be handled easily, stop adding and think of a better solution. Likely this will happen a few times before you get it right (and this is normal, I have programmed for 30 years, and still have this problem), but every time you find it went wrong, you learn a little so you can avoid the same mistake the next time.

As for fixing, you can either fix the code that you have at that point in time, or you can go back to an earlier version (if you have that), or you can start from scratch again. Every option has different advantages and disadvantages, as you'll find out.

 

Last but not least, let others read your code (the technical term is "code review" although that is a bit more formal), and read code of others. While it is scary at first, and getting comments on your work may feel awkward, it is generally given in positive spirit, as points where you can improve.

The more important part however is the explanation how to improve those points. That's the real gold, knowledge how to get better real quickly.

You can ask for a code review right here, just post the code (use the "<>" symbol for the code, as that makes it look good). You can also post code fragments that way if you have a question about some particular part.

 

@Anri: Python does not have a "switch" statement, you code it as a "if ..: ... elif .. : ... elif ... : ... else: ..." sequence.

 

 

GabrielJim, my copy is the third edition(2010), and covers Python 3.1.1.

 

You should be alright.

 

Thank you both, a lot, i really appreciate the help

 

Alberth, about the code review, do threads in Gamedev get deleted? If they do, where should i post the code review? Because if they don't i think it'd be a good idea to post it right here as i progress.

 

Anri, is this one the book you have?

 

http://kvspgtcs.org/wp-content/uploads/2013/08/Python-Programming-for-the-Absolute-Beginner.pdf

 

I'm sorry about not buying it, i'm not from USA, so my dollar situation it's not really great, but i'm gonna read it from there anyways (if it's the one you're talking about).

Share this post


Link to post
Share on other sites

Quite surprised at that, Alberth. Any idea as to why its not got a switch?
Not exactly sure why, but it may have to do with the break versus fall-through, or with the double cases with the same value (CPython doesn't check beforehand, it;s all interpreted at runtime.)

 

It is possible to make a dispatch dictionary which emulates a switch, like

def f1():
    print("hello")

def f2():
    print("world")

d = { 'a': f1, 'b': f2 }
d['a']() # prints "hello"

You almost never see these however. In my experience, switches aren't that often needed, at least I don't really miss them in Python. Perhaps dicts and lists make up for it for a large part, ie it is trivial to store key/value pairs in a dictionary, like 'd' above. You'd use a switch for such things in other languages.

 

 

Alberth, about the code review, do threads in Gamedev get deleted? If they do, where should i post the code review? Because if they don't i think it'd be a good idea to post it right here as i progress.

Threads don't get deleted. As code gets larger, posting may become more problematic, but way before that people will not read your code any more.

 

A program like hangman is 50-100 lines or so, which is fine. Posts longer than about 500 lines have very little use. People read the forum, and do a code review in 5-10 minutes. That won't work with long code. 100 lines of say 40 characters / line, is a 4KB, you won't make a noticable impact on what everybody here posts, or at todays disk sizes (smallest is around 1TB! I have no idea how people manage to fill even that "small" amount of storage!)

 

 

Some people open a repository at a site like github or bitbucket for their code.

Share this post


Link to post
Share on other sites

GabrielJim, thats the book, but a 2003 edition, using Python 2.2.3.

 

I'd say you'll find some differences between that version and Python 3, but just roll with it and look up what the Python 3 solution is through google searches.  In other words, dont worry about it.  I tried my hand at some Python 2.7(?) for Raspian(for the Raspberry Pi) a while ago, and came across some minor differences such as how I used the print() function.


 

Quite surprised at that, Alberth. Any idea as to why its not got a switch?
Not exactly sure why, but it may have to do with the break versus fall-through, or with the double cases with the same value (CPython doesn't check beforehand, it;s all interpreted at runtime.)

 

It is possible to make a dispatch dictionary which emulates a switch, like

def f1():
    print("hello")

def f2():
    print("world")

d = { 'a': f1, 'b': f2 }
d['a']() # prints "hello"

You almost never see these however. In my experience, switches aren't that often needed, at least I don't really miss them in Python. Perhaps dicts and lists make up for it for a large part, ie it is trivial to store key/value pairs in a dictionary, like 'd' above. You'd use a switch for such things in other languages.

 

 

Alberth, about the code review, do threads in Gamedev get deleted? If they do, where should i post the code review? Because if they don't i think it'd be a good idea to post it right here as i progress.

Threads don't get deleted. As code gets larger, posting may become more problematic, but way before that people will not read your code any more.

 

A program like hangman is 50-100 lines or so, which is fine. Posts longer than about 500 lines have very little use. People read the forum, and do a code review in 5-10 minutes. That won't work with long code. 100 lines of say 40 characters / line, is a 4KB, you won't make a noticable impact on what everybody here posts, or at todays disk sizes (smallest is around 1TB! I have no idea how people manage to fill even that "small" amount of storage!)

 

 

Some people open a repository at a site like github or bitbucket for their code.

 

Alberth, cheers for that! I'll definitely keep that in mind should I return to Python. :cool:

Share this post


Link to post
Share on other sites

Python 2.2 is a LOT different from 2.7

 

Around Python 2.4, they started working on Python3, and at around 2.5, Python 3 was ready enough to push the switch from 2 to 3 to the general public. Versions 2.6 and 2.7 make a lot of changes to get the 2 and 3 versions closer together, easing the transition.

Share this post


Link to post
Share on other sites

Python 2.2 is a LOT different from 2.7

 

Around Python 2.4, they started working on Python3, and at around 2.5, Python 3 was ready enough to push the switch from 2 to 3 to the general public. Versions 2.6 and 2.7 make a lot of changes to get the 2 and 3 versions closer together, easing the transition.

 

Uh, that's a real shame, the book seems pretty good, and i can't find the 2010 version.

 

But oh well.

Share this post


Link to post
Share on other sites

GabrielJim, you can download the 3rd edition source code from this page...

 

http://www.delmarlearning.com/companions/content/1435455002/downloads/index.asp?isbn=1435455002

 

...just click on "book source code".  Inside the zip file, navigate as follows...

 

\py3e_source\py3e_source\

 

...and you will find a list of chapter folders. 

 

Use the pdf for now and the source code to overcome any problems.  If you are already learning Python 3 from another source then you should be alright.

Share this post


Link to post
Share on other sites

GabrielJim, you can download the 3rd edition source code from this page...
 
http://www.delmarlearning.com/companions/content/1435455002/downloads/index.asp?isbn=1435455002
 
...just click on "book source code".  Inside the zip file, navigate as follows...
 
\py3e_source\py3e_source\
 
...and you will find a list of chapter folders. 
 
Use the pdf for now and the source code to overcome any problems.  If you are already learning Python 3 from another source then you should be alright.


Oh, I didn't think of this, thanks! Appreciate the help

Share this post


Link to post
Share on other sites

This topic is 405 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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

Sign in to follow this