Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I'm already starting with my project in Python, but before I start, I would like to ask - am I able to create a Chess Game in Python, without the need of downloading any game library (like Pygame)? I should create a game using tkinter.
The interface is actually not related to the chess game at all -
So, you could make a game to play chess with print statements on the terminal, and just use capital and small letters to represent the pieces, like "rkbqkbkr" - and the gameplay part would be independent.
And yes, tkinter is a fully capable windowing toolkit - it only lacks image and text rotation calls - but you can use tkinter to play chess, and won't even need PIL, which is also an external library needed by tkinter to load images, because the chess pieces thenselves are available as unicode characters
♔♕♖♗♘♙♚♛♜♝♞♟ (these also would work for the terminal version)
Moreover, actual serious chess software don't even have to implement an interface at all - there are text-communication protocols that are used by a number of programs which can work in symbiosis - one program, like xchess or gnome-chess working displaying only the graphic interface, and the actual game engine working in text only.
Game libraries do not grow on trees. Someone had to create it first which means theoretically you can write all the code too. But people are using exiting solutions to focus on their creation and not on reinventing the wheels like all the base features each game needs as it takes both skills and time -> it simply "costs". So yes, you can go fully own path. Should you? It's up to you.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 months ago.
Improve this question
I am relatively new to coding and I'm currently doing my a level computer science coursework. I'm doing a text based RPG game in python 3. The problem I've ran into is I've coded the entire game with the outputs into the console of VS code, but I need to create a gui for the game. Just a simple window with one textbox that outputs everything the console outputs currently and a textbox that allows for any user input via typing. And maybe a backdrop for the gui. I've scoured the internet for solutions but I cannot find one. The gui don't need to be very fancy. Does anyone have the knowledge of any modules of ways I can easily slap a gui ontop of my code? Thank you in advanced.
For a basic GUI you can use TKinter: Documentation
It's very easy to use and there are a lot example on the web that you can reference
I believe you can use the tkinter (“Tk interface”) package for this. It's a simple and straightforward standard interface in Python to the Tcl/Tk GUI toolkit, and the only GUI framework that comes built into Python itself. Considering your mentioned requirements for the project, you should easily be able to create what you want — an entry widget, for instance (example).
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
So I made some games in Python, but they are all text-based because I can never find out how to do graphics. I have done a bit of searching, and the answers that I have found either don't work or don't answer my question. I am wondering how to use graphics and implement them in code, such as if a red dot touched a blue one the red one will turn green, or if I press the up arrow key the red dot will move up. I know that is a lot to ask, so I am wondering if there is a website or something that can tell me where and how to start.
As #Axe319 mentioned you can use, pygame, Tkinter, or turtle although there are more. You can find information on pygame here https://www.pygame.org/news, but if you have a Mac it can be tricky to use. Pygame is probably more of the more popular ones to use, however more recently people have been using other modules. tkninter is usually used for GUI, but you can use it to make some games. Turtle graphics as he said again are minimal and I have only used them to make pictures, but I know people have made games. Based on what you wrote Pygame, or Tkinter would work best, and if it is simple enough use tkinter. They both have plenty of tutorials on the internet if you need help.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I'm developing a dashboard computer for my car based on a Raspberry Pi and a touchscreen. The GUI is based on PyGame so it can write directly to the framebuffer, which works fine.
However, I'm looking to integrate the navigation software Navit into my solution. Navit can be configured to output to the framebuffer too, which also works fine when running it.
Now to my question: Is it possible to run both applications at the same time, simultaneously using the framebuffer? My idea is that you start the PyGame GUI in fullscreen and then sets the Navit screen to say 20% less width so that my GUI buttons are visible along the edges and writing it's graphics at a time each. Is this even doable?
NB: I know it is possible to embed Navit into my GUI as per http://wiki.navit-project.org/index.php/Embedding, but that requires me to use PyQt which I don't want to do since I already have developed everything in PyGame and don't want to be dependent on X and other graphics.
Any ideas of other solutions appreciated if I'm completely out sailing here.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I'm not very good in Python and just used several times before. I used PYQT and python to make an interface for controlling out-side devises.
I'm wondering whether Python can make an interactive animation something like Flash produces. I searched and found some suggestions: HTML5, Pygame and Tkinter. I have no idea about how those things work with Python.
Does someone can give some advises? Thank you!
In my opinion Pygame the best library in Python3. You can do all things that you want, but you need to work in the hard-way, control main_loop, work with messed up classes and perhaps needs some OpenGL basic functions.
Tkinter is a good lib to make softwares, but to work with graphics is badly. Is easy, have a lot of tutorials in net, you don't need to work directly to main_loop... But is limited, in some step you will stuck and take the double of time to figure out.
You should be use Pygame or Pyglet (Similar to pygame, but still updated and more organizated -- doens't have much tutorials on net, so if you are begginer don't try this before pygame).
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
Im new to Python and I am getting to grips with it.
I have a question: why is Python it self not used to develop games? I can see why Pygame games is used, due to ease of loading images on to the screen for example. If I was to develop a game in Python, would it mean I would have to manually display images to the screen? Or do Python also provide these set of libraries?
For example in Pygame you would have:
pygame.image.load("image.jpg").convert()
to load an image to the screen.
If I was to do this in python, would I have to manually load images? Read from a file then display? Is this all done in the underlining code for Pygame?
Well as you are progressing more into game development you'll find out that you need more and more things in order to do what you have in mind. What pygame and all these dev kits do, is that they've already done the work for you.
If you are going to create a serious game,you'll need collision modules, animation modules, sprite loading modules, maybe music and video, controls and more.
Without pygame you'll have to create all of them from scratch :P.
I don't know about the inners of Pygame and to be honest i haven't used it, but i can assure you from my experience in game development that its a real PAIN to make anything from scratch so eventually you'll need something as a base for your game. Thats why there are so many game engines around ;)
Unless you are a python prodigy or something :P