Relevant information
I'm in a grade 11 computer science class that uses Python & Pygame. We're aloud to use sprites and images though we're never taught it, just drawing graphics like squares and circles. We were taught arrays, lists, functions but not classes and objects. We also relatively do things without using functions like the init
main one I see a lot on line, we also don't use self
or super
.
If it's anything relevant, I'm making a top down (bird's eye view) 2D shooter game similar to a 2D version of dead ops arcade in Call Of Duty: Black Ops.
What I'm trying to do
I've been programming with Java & LibGDX before hand. So I want to use sprites in images in Pygame the same way I've been using it in LibGDX. Getting images, obtaining image rectangles for collision, rotating/transforming images, changing the images of the sprite.
Though every tutorial I've seen for sprites and images in Pygame that I can search up uses objects, classes and function calls that I'm not familiar with.
What I've done
I've loaded a PNG into my program and drew it to the screen. Simple and straight forward. Though the Pygame documentation doesn't give me a lot of options in terms of manipulating these images other than moving their location.
What I'm asking for
A simple run down syntax of how I would use a sprite in Pygame, without objects/classes or any weird function terminology. In terms of functions I can make a function, pass information through parameters and return values. I'm not aware of global variables, self
or super
.
The simplest of simple where I can resize an image, change the image of a sprite, transform/rotate it, and get a rectangle that I can use to overlap with another one.