An introduction to Pygrr...

 Python... No, not the snake!

From Wikipedia/Python:

Python is an interpreted high-level general-purpose programming language. Python's design philosophy emphasizes code readability with its notable use of significant indentation. Its language constructs as well as its object-oriented approach aim to help programmers write clear, logical code for small and large-scale projects.[30]

Python is dynamically-typed and garbage-collected. It supports multiple programming paradigms, including structured (particularly, procedural), object-oriented and functional programming. Python is often described as a "batteries included" language due to its comprehensive standard library.[31]

What on earth does all that mean!? I'll cut the jargon. Python is a programming language, with highly readable syntax (high level language), and various applications One of its goals is to provide a single platform that can do pretty much anything, however, this versatility comes with a slight speed issue - in that the code isn't executed too quickly. This isn't a problem however, as it is used for mainly back-end jobs, such as handling data.

Another very promising part of Python is its scalability. Everyone (with programming ability!) can create a 'library' - a separate script that can be imported into your code, and can run functions from. Effectively, you can make modules that can be stuck to code, to power it... A chassis of a car is a good metaphor for this!

Due to its high readability, Python is commonly used as an entry-level language, for teaching all ages programming. It isn't then forgotten after learning, as it can be used through life, being an incredibly unique, and useful language. According to Stack Overflow, Python is the most in-demand language in the programming market right now, and it's only speculated to increase in demand, with programming being the 'future'!

Anyways, I'm not trying to 'sell' (in quote marks because it's free and has a very open-source nature!) Python to you, although, on a side note, you should learn it... I'm here to introduce Pygrr to you! It's a free library I've been working on for a while now, for Python. It's goal is to teach not only children, but anyone, game development. It allows users to create small, or large, games in Python, with in-built input handling, rendering and all that complex stuff! If you look at statistics, or even know anyone in the world, you'll know that people (especially kids!) love to learn fun things, and are more likely to put effort into something that they'll enjoy the output of... Games are a perfect example of this! Not only is it an art form, and a way for unique beings to express themselves through, but they're fun to use, and you can quite literally make a game about anything!

There's the introduction all done!

Pygrr code

Here's a very simple program written in Python, using Pygrr. The first line simply tells the program to include the Pygrr library, the second line initialises the Pygrr window, and then the player is created and packed. The 'while True' is a loop that will continue forever - all the game's code should go here! The code within the loop makes the player move, and then handles the next frame! That's all it takes, and we get this as our output:

Pygrr output

We have our first Pygrr project! As you can see, the player is a tad... Small, and the background is a plain white, plus, the screen has a default width and height... This can all be changed using commands, or even initialising arguments!

Here's a more customised program, with the output also pictured:

Pygrr code


Pygrr has several built in "models" for the user to display objects as. These are:
  • Triangle - of a given width and height
  • Square - of a given side length
  • Rectangle - of a given width and height
  • Circle - of a given radius
  • Oval - of a given width and height radius
Furthermore, a program designed for the user to draw their own models and import them into Pygrr is in the works by me... There are lots of movement functions too, from move_up, left, right, down, x, y, forward, back, and just plain move. X and Y relate to the screen coordinate system, where (0,0) is the centre of the screen.

More clips and stuff coming, this is all just a very brief overview of a small fraction of what it can do, even at this early stage of development...

Isaac, over and out...

Popular posts from this blog

Blog post #0 - Hello, world!

The principles of Pygrr