tur-learning / CIS1051-python

Intro to Problem Solving & Programming in Python
https://tur-learning.github.io/CIS1051-python/
MIT License
0 stars 0 forks source link

POC (Proof Of Concept) - Implement basic elements of the Game #22

Open andreagalle opened 1 year ago

andreagalle commented 1 year ago

What we excpect from this task is to have a minimal playable version of The Space Race (aka TSR) videogame, with a menu selection to chose different maps, the ship will just explore without doing anything else. The player can change map pressing the ESC key.

andreagalle commented 1 year ago

@ben-vanzyll-temple this is the first issue you will work on (for the Final Project) during this first Iteration (actually the 2nd, that concludes the 6th March).

By this end you will have to push on your branch the code to implement this task and of course, before, we will discuss here all the viable solutions, together.

Me and @dario-abbondanza prepared for you some useful resources, we will share with you here (on GitHub) together with additional exaplanations.

This will be the primary way we will communicate here to work together.

dario-abbondanza commented 1 year ago

Following Andrea's comments, I would suggest @ben-vanzyll-temple to take the following steps:

  1. Random maps can be generated using this program: https://deep-fold.itch.io/space-background-generator . Maps backgrounds must be 1500x1500 pixels. You can find an example in the "/projects/the_space_race/" directory within the lab-sessions branch. There is also a spaceship image you can use, or you can create a new one using free tools you find online (see additional resources below).
  2. Menu selection should allow the possibility of switching maps.
  3. Images can be loaded using the pygame.image.load function, and can be transformed and resized using the pygame.transform.scale function. Look at the pygame documentation to understand how to use them. Ideally, we would like to zoom in the background and zoom out the spaceship, so that it appears as a small object in a very large environment.
  4. The player should be able to move the spaceship sprite on top of the background by pressing the arrow keys. To do that, I would suggest using the pygame.key.get_pressed function to handle key events and the pygame.Surface.blit to display the spaceship in the appropriate position. For an example, you could have a look at the code in "/lab-sessions/scrolling_background" in the lab-sessions branch.
  5. To display the zoomed background, you can use the blit function with an additional argument, specifying the region to be cropped and displayed. Have a look at the documentation for details.

ADDITIONAL RESOURCES: