Package: gamestorm
GameStorm - LibraryWelcome!What is GameStorm?GameStorm is a python package - with batteries included - which helps you makes small, grid-based games easily and with very little code. It is built on top of PyGame which is a very flexible and wonderful 2D game engine.https://www.pygame.orgSmall? Grid-based? Can you show me an example?Sure! Look at the following picture. It is an example of what you can make using GameStorm out of the box (remember, batteries included)!Example 1Example 2What does 'batteries included' mean?That means GameStorm has all you need to make a small game? Sample graphics, text, and sounds are already present. You can use your own, but you don't have to! Also, gamestorm is preconfigured to work with specific keyboard keys as well as gamepads!GameStorm seems limited. What is the point?Good question. GameStorm has three purposes:Learning. GameStorm makes it easy to learn game-programming. In fact, why not learn programming in general with GameStorm? Graphical content can be more fun than text ("Hello World!")Prototyping. GameStorm gives you the ability to prototype a game idea very easily. Sure, the idea will have to use a grid, but many games do; Chess, Tetris, Sokoban. There are many things you can do with a grid and tiles.Fun! It's fun to make games. It's more fun to see your concept on screen quickly than it is to learn to use a fully fledged game engine.I'm intrigued. How can I give this a try?First, install it with pip:pip install gamestormThen continue reading the for more detailed instructions. Enjoy!GameStorm DocumenationBefore looking at any code, you should understand the system and the conventions that GameStorm uses. It's simple and effective.The GameStorm 'System'GridThe grid is the visual game area. It takes up the entire window. You can specify how big or small you want it to be. The grid is made up of columns and rows which contain tiles. You don't work much with the grid, other than to set it up. Mainly you work with its tiles.TilesThese are the main resources of the game. Each 'cell' in the grid is a tile. A tile has three major components; a background, a symbol, and a cursor, and they are drawn in that order. You can perform various operations on the tiles and their components. Some examples are:Set the background of all the tiles.Set the symbol of a specific tile.Clear (remove) the cursor of a specific tile.Draw some text starting as a specific tile.Clear all the components of all the tiles.See theAPI documentationfor all the methods available concerning tiles.The following picture contains a diagram of a tile and its components.The essence of gamestorm is manipulating these components to make a small but fun game. Remember, there are already hundred of sample backgrounds, symbols, and cursors included. So you can use these if you don't want to worry about graphical assets just yet.TextYou can draw text ina GameStorm game. It'sverylimited. There is only one font. And each character is drawn to a separate tile. This method was chosen to keep the API as simple as possible. Fortunately, you can draw the text you want, starting at the tile you want, using one simple method.Note: Overriding the font is not yet possible, but is coming soon hopefully.Drawing / RenderingDrawing - that is, the actual rendering to the screen - is done deliberately. That means, you manipulate the backgrounds, symbols, and cursors of all the tiles you want, and then you perform the rendering by calling 'draw'. For example, a symbol is not drawn when you set one to a tile. Instead, it will be waiting for you to call 'draw'.InputFor input, GameStorm makes use of the keyboard or a gamepad. There are simple methods, for checking when one of the keys/buttons was pressed. For simplicity, the input is limited to the number of buttons that would appear on a SNES gamepad. That means, the keyboard and gamepad are restricted to the following keys:NameGamepadKeyboardUpUpUp ArrowDownDownDown ArrowLeftLeftLeft ArrowRightRightRight ArrowButton 1Button 1Key 1Button 2Button 2Key 2Button 3Button 3Key 3Button 4Button 4Key 4Button 5Button 5Key 5Button 6Button 6Key 6SelectSelectTABStartStartENTERExitNoneESCNote: Remapping the keys or the gamepad buttons is not yet possible, but is coming soon hopefully.In no time, you can make a game and use a gamepad to control it!SoundFX and MusicIn GameStorm, there are two types of sounds: soundfx and music. Music is longer audio that is meant to be played while the game is running. SoundFX are small audio samples that are meant to be played upon certain events. For example, you can play an explosion sound when something in the game is destroyed, or you can play a 'beep' sound when you move the cursor from one tile to another.GameStorm has a few built-in music tracks and many soundFX so you can put sound in your game right away. You can use your own music and sound if you want to.Ready to try?If you're ready to see some code, then continue reading.CodeLet's start with a simple example; our take on Hello World.importgamestormnum_tiles_x=15num_tiles_y=7screen_width=1280screen_height=720#these two lines are requiredg=gamestorm.GameStorm()g.init(num_tiles_x,num_tiles_y,screen_width,screen_height,title='Hello World')#set up some stuff to draw soon!g.set_all_tiles_background(25)g.set_tile_symbol(6,4,196)g.set_tile_symbol(7,4,196)g.set_tile_symbol(8,4,196)g.set_tile_cursor(7,4,1)g.draw_text(2,1,'Hello World!')#perform the drawg.draw()#check for the exit event to quitwhileTrue:events=g.get_events()ifg.is_exit_button_pressed(events):g.quit()breakThat small script will render what's in the following image.Just as we promised; simple! We will not demonstrate the use of sounds here, but we assure you the API is very straight forward, and you will know how to play sounds just by perusing theAPI documentation.ConclusionWe hope you enjoy GameStorm. We hope that it helps to inspire students, programmers, makers and more. Enjoy!FOR DEVELOPMENT OF THE GAMESTORM LIBRARYIf you want to help out with this project - first of all, thank you - here are helpful hints.Install it by making a Virtualenv environment (python3) and thenpip install .Run the tests by runningnose2 testsRun the sample program above as a start. It's the file calledsample-program.py