I have started development on a small 2d adventure side view game together with a couple of people. The game will consist of the regular elements: A room, a main character, an inventory, npcs, items and puzzles. We've chosen PyGame since we all are familiar with python from before. My question is quite theoretical, but how would we design this in a good way? Would every object on the screen talk to some main loop that blits everything to the screen?
(Hope this question isn't too discussion-y)
Thanks
Python Adventure Writing System - http://home.fuse.net/wolfonenet/PAWS.htm - might be useful
http://proquestcombo.safaribooksonline.com/1592000770 may also be useful
Related
I have programming as a subject in school, and this is our last project of the semester. For our last task we are going to use replit.com, which use PygameZero. Which from my understanding, is a easier version of Pygame, which again is a version of python more focused on making games (correct me if im wrong).
I want to make a Street Fighter type game, and because of that i really want to use two controller for it (because i want a PvP game). I have searched, but the turorials i find are for Pygame, and i can't find any for Pygame Zero. Either that, or it is some semi-advanced stuff that i don't understand. If anyone knows how to connect controllers to Pygame Zero, it would help a ton!
And if controllers matter, i have Xbox One controllers, a switch pro controller and a gamecube controller (whith a gamecube to usb adapter). Allthough i mainly want to use the xbox controllers if thats possible.
thanks so much in advance!
PS: Im relativly new to programming, so i would really apreciate if you could dumb down your answers to the point that i can understand it!
Pygame Zero does support controllers and PS4 and Xbox One controllers both work.
This book is a great resource for beginners in Python who want to make games in Pygame Zero. It also has some more information on joysticks here and here.
Also regarding Sembei Norimaki's comment, you basically have to try and see if the code in sixAxis.py at that website works with your controller. See the bottom of the file and edit it to see if you can get it to work.
Let´s say I want to create a game in Python, where a lot of cars will move in canvas, and I still (while they are moving) want to be able to make some actions, like buying items from a shop and so on. Is this possible to do in Python, without any game library import?
Short answer: Yes, but it's not recommended.
Long answer:
For the first part of your question is doable. You can use the tkinter module to create multiple moving objects on your canvas. This is done by using an object oriented program which makes different classes for your cars, in this scenario, and sets them to move. If you want a link for that, here it is. Adding functionality can be a bit annoying, but again, it's tkinter. However, putting these together? It sucks. Based on a lot of articles I've read, making a game in tkinter, is, to put it simply, a very long and painful experience. I highly recommend you to use a game library such as pygame or pyglet, but you technically still can do it in tkinter. So, in conclusion: don't make a game in tkinter, but you still technically can.
I recently finished a big project i have been working on, and i am looking for a new challenge. I was thinking about making python play a game, and making it unbeatable. to do this, i need an easy way of entering the other players move, and i was thinking about something where i can create multiple buttons which the user can press. (for example: if i want to make tic tac toe i would want 9 individual buttons that are triggered by a mouse click, to get the input).
I have no idea if this is possible in python. i have seen multiple pages about this, but some pages have such a large amount of information on them that i don't know where to start.
thanks in advance for any answers,
Harm
my question is quite simple, but I can't move on until I solve it. I want to develop a card game, something like Magic the Gathering. I suppose there will be just a little of animation, but much work with images, image transformation and special rendering - some kind of things, that every unit has now attack plus 2 so cards on table will adapt.
I thought Python will be best for it, because it easy to develop with it and I know it pretty well. Also I have a little of experience with PyQt and Pygame. But I can't decide which one is better for that purpose. What do you think will be easier to use: PyQt, Pygame or something else?
if you want just a simple animation and want to finish your game fast. use the pyqt's scene view. refer to (Rapid GUI programming using python and pyqt) book if you want to learn more about scene view.
PySolitaire is a collection of more than 300 solitaire and Mahjongg games. So maybe if you browse around, perhaps you can get some idea.
What is better? If you are developing games, PyGame I guess.
Both pygame and pyqt will work for what you want to do, but I'd recommend pyqt: you'll be able to use standard widgets (like listboxes, textboxes, menus, buttons, ...).
I've never worked with pyqt myself, but I image that drag 'n drop is something built-in, which will be really useful for a card game.
With pygame on the other hand you'll have to make everything yourself. This will give it more of a game feel as you can draw everything exactly like you want it to look like, but it'll take more work as you have to implement basic stuff yourself.
I have been playing around with writing some simple card games in Python for fun and I would like to add a graphical user interface (GUI) to the games. Which library would you recommend for writing the GUI for a simple card game?
If all you want is a GUI, wxPython should do the trick.
If you're looking to add sound, controller input, and take it beyond a simple card game, then you may want to use pygame.
I haven't used wxPython, but Pygame by itself is rather low-level. It allows you to catch key presses, mouse events and draw stuff on the screen, but doesn't offer any pre-made GUI controls. If you use Pygame, you will either have to write your own GUI classes or use existing GUI extensions for Pygame, like Phil's Pygame Utilities.
Generally, PyGame is the better option for coding games. But that's for the more common type of games - where things move on the screen and you must have a good "frame-rate" performance.
For something like a card game, however, I'd go with wxPython (or rather, PyQt). This is because a card game hasn't much in terms of graphics (drawing 2D card shapes on the screen is no harder in wx / PyQt than in PyGame). And on the other hand, you get lots of benefits from wx - like a ready-made GUI for interaction.
In Pygame you have to create a GUI yourself or wade through several half-baked libraries that do it for you. This actually makes sense for Pygame because when you create a game you usually want a GUI of your own, that fits the game's style. But for card games, most chances are that wx's standard GUI widgets will do the trick and will save you hours of coding.
The answers to this related question may be very useful for you:
What can Pygame do in terms of graphics that wxPython can't?
I'd say pygame -- I've heard it's lots of fun, easy and happy. Also, all of my experiences with wxPython have been sad an painful.
But I'm not bias or anything.
pygame is the typical choice, but pyglet has been getting a lot of attention at PyCon. Here's a wiki entry on Python Game libraries: http://wiki.python.org/moin/PythonGameLibraries