Windows game bar not recording pygame window [duplicate] - python

I made a game using SDL and OpenGL in C++, which is of course common for games. Windows 10 should be able to detect that it's a game and show the Game Bar when starting it, but it doesn't. What can I do to make Windows 10 detect it as a game?

Windows cannot "detect" that you are playing a game. There is literally no way for it to magically work that out. Heck, I can think of a number of kinds of programs that a human would have difficulty categorising as a game or not (such as Stack Overflow, which doesn't use OpenGL or SDL whatsoever!).
Load up the game bar with Win+G, and check "Yes, this is a game" so that Windows remembers for next time.
http://www.tenforums.com/tutorials/8686-game-dvr-remember-game-undo-windows-10-a.html

Related

How to focus on a window with pygame?

I made a Python game using Pygame. I try to make it so when it starts, it loads the shell, and entering a raw input would display the pygame window and start the game so that I can make the game playable without having to close the shell. It works, however, the window starts minimized. The game is a simple "dodge the object" and has no pause what so ever. The game still runs in the background, possibly having the player hit multiple projectiles before the user realizes it. Is there a way to focus on the window?
For anyone in the future who stumbles across this question:
As of 2022, pygame v2.1.2 has an experimental module ._sdl2 where: Window.focus() is used to make a window to be moved at the top and set focus. Windows.focus() supports optional input_only bool parameter for whenever the window should be moved at the top (False), or just collect input (True).
As I understood you, you don't want the game to start, before the window is in fullscreen-mode, right?
When I try you attempt (starting through rawinput), my display is fullscreen from the start. Have you set everything correctly?
I suggest that you stop the game until there is an actual key-input (whatever controls you have set). Like this the player has the time to arrange everything to his liking before starting the game. Because, even if you figure out how to analyse the focus-issue: When the game starts, the window HAS focus, therefore this approach wouldn't work anyway.

How can I simulate mouse movement in OSX, not just change the cursor location [duplicate]

This question already has answers here:
How to control the mouse in Mac using Python?
(11 answers)
Closed 5 years ago.
I'm currently playing with the Leap Motion controller and trying to use it as a controller for the game Surgeon Simulator. If you search for "leap motion oculus rift surgeon simulator", you'll understand my end goal. However, I'm having issues with simulating the right kind of mouse movements on my Mac.
Problem:
The movement in the game seems to work based off of the mouse movement, not cursor location. For example, you can move the mouse infinitely to the left and still see interaction in the game - it never hits an edge. The libraries that I've tried, don't seem to mimic the right behavior.
I've tried autopy's smooth_move, PyUserInput's mouse library, and methods that I found on various blogs including http://www.geekorgy.com/index.php/2010/06/python-mouse-click-and-move-mouse-in-apple-mac-osx-snow-leopard-10-6-x/ and http://metapep.wordpress.com/2009/07/10/control-the-mouse-on-mac-with-python/
Does anyone have insight to what I'm missing? Is there something fundamental about mouse control that I'm not considering?
I'm nearing the point of trying this all out on a Windows machine instead with the pywin32 library or something.
https://pypi.python.org/pypi/PyUserInput/0.1.1
Take a look good sir. This will probably help defeat a lot of your issues. Also, if you finish it let me know :)

How to play a video clip from python?

I started making this game a while back and I'm nearly done. All I want to do now is to make a video animation right at the start of the game. So when you click on the game icon you go directly to a video animation then to the main game screen. It will show all the people that made it and developed it. I have finished making the video animation but how do I load it to the very start of the game? I just wanted to this because I want the game to look professional. Do you use the os system command? I'm using Windows 7, Python 3.1, Pygame 3.1 and I made the video clip in windows live movie maker.
There is a whole module dedicated for something like this and it's part of Pygame. pygame.movie

What is the right way to design an adventure game with PyGame?

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

wxPython or pygame for a simple card game?

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

Categories

Resources