Week 8 subject 1: Arcade self paced learning
There's abundant resources online to learn Python programming with Arcade. Like the Arcade Academy. Skip directly to the 'drawing' part:
5. How to Draw with Your Computer — Arcade 2023 documentation,
follow the tutorial step by step.
If you don't like to follow through and learn Python all over again (however this is recommended!), go directly to the Arcade Tutorial:
Simple Platformer - Python Arcade 2.6.17
Week 8 subject 2: Platformer Program Template
This is a simplistic example of what a platformer game program should look like.
Wonder what a platformer game is? Look here: Build a Platform Game in Python With Arcade – Real Python.
Super Mario is a symbolic Platformer game. Also try one of the successful platformers: Lode Runner Web Game. Learn more about Lode Runner here: Lode Runner - Wikipedia.
SCREEN_WIDTH = 1000
SCREEN_HEIGHT = 650
SCREEN_TITLE = "Platformer"
class MyGame(arcade.Window):
"""
Main application class.
"""
def __init__(self):
# Call the parent class and set up the window
super().__init__(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
arcade.set_background_color(arcade.csscolor.CORNFLOWER_BLUE)
def setup(self):
"""Set up the game here. Call this function to restart the game."""
pass
def on_draw(self):
"""Render the screen."""
self.clear()
# Code to draw the screen goes here
def main():
"""Main function"""
window = MyGame()
window.setup()
arcade.run()
if __name__ == "__main__":
main()
No comments:
Post a Comment