A Game Engine Made in Python with the Pygame Module

Overview

MandawEngine

A Game Engine Made in Python with the Pygame Module

Discord: https://discord.gg/MPPqj9PNt3

Installation

To Get The Latest Version of MandawEngine: On Windows:

pip install https://github.com/mandaw2014/mandawengine/archive/master.zip

On Mac and Linux

pip3 install https://github.com/mandaw2014/mandawengine/archive/master.zip

Getting Started

import Mandaw

from mandaw import *

Make a window

from mandaw import *

mandaw = Mandaw() 

mandaw.loop()

Make a simple square

square = GameObject(window = mandaw, shape = "rect", x = 0, y = 0, color = "red", width = 20, height = 20)

Center it with

square.center()

Draw it

@mandaw.draw
def draw():
    square.draw()

Full Code

from mandaw import *

mandaw = Mandaw("First Mandaw Window!")

square = GameObject(window = mandaw, shape = "rect", x = 0, y = 0, color = "red", width = 20, height = 20)
square.center()

@mandaw.draw
def draw():
    square.draw()

mandaw.loop()

Collisions Between GameObjects

What we have so far

from mandaw import *

mandaw = Mandaw("Collisions!", bg_color = "cyan")

square = GameObject(window = mandaw, shape = "rect", x = 0, y = 0, color = "orange", width = 20, height = 30)
square.center()

ground = GameObject(window = mandaw, shape = "rect", x = 0, y = 0, color = "gray", width = 5000, height = 100)
ground.center()
ground.y = 500

@mandaw.draw
def draw():
    square.draw()
    ground.draw()   

mandaw.loop()

Here We Can Use The collide() Function along with the built in update() function. For example, We're Going To Make Gravity Here

from mandaw import *

mandaw = Mandaw("Collisions!", bg_color = "cyan")

square = GameObject(window = mandaw, shape = "rect", x = 0, y = 0, color = "orange", width = 20, height = 30)
square.center()

ground = GameObject(window = mandaw, shape = "rect", x = 0, y = 0, color = "gray", width = 5000, height = 100)
ground.center()
ground.y = 500

@mandaw.draw
def draw():
    square.draw()
    ground.draw()   

@mandaw.update
def update(dt):
    # Collision code here
    if not square.collide(ground):
        # Square's y position += 1 x deltaTime
        square.y += 1 * dt

mandaw.loop()

Platformer Controller Prefab

What we have so far

from mandaw import *

mandaw = Mandaw("Platformer Example", bg_color = "cyan")

mandaw.loop()

Import the PlatformerController2D with

from mandaw.prefabs.platformer_controller import PlatformerController2D

Then call it

player = PlatformerController2D(mandaw, x = 0, y = 0, centered = True)

Then in the def update(dt) function, call

@mandaw.update
def update(dt)
    player.movement(dt)
You might also like...
A Pygame game made in 48 hours
A Pygame game made in 48 hours

Flappuccino Flappuccino is a game created in 48 hours for the PyGame Community New Years Jam using Python with Pygame. Screenshots Background Informat

This is a simple game made using pygame.

Ball breaker This is a simple game made using pygame game view The game view have been updated wait for the new view to be uploaded Game_show.mp4 Lear

Racing Fire - A simple game made with pygame.

Racing Fire A simple game in the making. Using pygame, this game is made to feel like an old arcade game. I developed a simple controller for it with

A game made similar as space inveders with pygame

space-inveders-pygame a game made similar as space inveders with pygame . . . if you are using it make sure to change audio and imgs file i do no own

N-Queens game made using pygame library
N-Queens game made using pygame library

N-Queens N-Queens game using pygame for AIML201 Testing: 1. git clone https://github.com/python-game-dev/N-Queens.git 2. cd N-Queens 3. python main.py

A didactic GUI chess game made in Python3 using pygame.
A didactic GUI chess game made in Python3 using pygame.

Chess A didactic GUI chess game made in Python3 using pygame. At the moment, there is no AI. The only way you can test the game is by playing against

🐥Flappy Birds🐤 Video game. With your help I can go through🚀 the pipes. All UI is made with 🐍Pygame🐍
🐥Flappy Birds🐤 Video game. With your help I can go through🚀 the pipes. All UI is made with 🐍Pygame🐍

🐠 Flappy Fish 🐢 I am Flappy Fish 🐟 . With your help I can jump through the pipes and experience an interesting and exciting flight deep into the fi

A Tetris game made using PyGame as renderer only, for a school project.
A Tetris game made using PyGame as renderer only, for a school project.

Tetris_Python A Tetris game made using PyGame as renderer only, for a school project. Twist in the Game Blocks can pentrate through right and left bou

PyGame-Tutorial - Refrence for building games in pygame
PyGame-Tutorial - Refrence for building games in pygame

PyGame-Tutorial How to build games using the python library PyGame End result Ho

Comments
  • if __name__ == __main__ added

    if __name__ == __main__ added

    I have merged some examples with their source code file file so with if name == main To make the code easier to understand and to prevent everyone from jumping through the game engine code and the examples just to understand it

    YAY

    opened by PratangsuRakshit 0
  • Some basic upgrades

    Some basic upgrades

    Just some basic changes

    These updates are there to make game devlopment with MandawEngine easier.

    These changes are not yet super important but they will imporve the MandawEngine

    Features Added

    • So many default colors added to color.py
    • Made a demo run() with GameObject.py

    Support

    For support, email [email protected] or join discord.

    opened by PratangsuRakshit 0
Releases(mandawengine)
  • mandawengine(Oct 25, 2021)

    A complete revamp from the old MandawEngine Pygame This update includes built in functions, such as def update(dt): And def draw(): It also includes tidying up of all gameengine scripts

    Source code(tar.gz)
    Source code(zip)
  • v1.1.0(Aug 24, 2021)

    The First Proper Version Released On Github. It includes:

    1. Sprite Animation
    2. Audio
    3. Colors
    4. GameObjects
    5. Input Controls
    6. Basic 2D Lighting
    7. Sprites
    8. Text

    And much more on the way

    Source code(tar.gz)
    Source code(zip)
Orbital-patterns - A program which plots pattern that revolving planets make

orbital-patterns Click to spawn planets Press "S" to capture screenshot. Image w

Yuvraj.M 11 Dec 24, 2022
A program to read, edit, and write save files for the game Railroads! Online

RROSE - v0.3.6 This program is intended to be used as an external tool to Railroads Online server hosts. It will read save files, allow to modify entr

17 Dec 09, 2022
source codes for my(small indie game developer) games

My repository for most of my finished && unfinished games Table of Contents Getting Started Prerequisites Installation Usage License Contact Prerequis

Gustavs Jākobsons 1 Jan 30, 2022
Code infrastructure and player algorithms for the Codenames board game.

Codenames Code infrastructure and player algorithms for the Codenames board game. This is the active fork of mkali-personal/codenames. Intro This is b

Asaf Kali 1 May 18, 2022
A python3 project for generating WorldEdit shematics for the MineClone2 game for Minetest from images.

MineClone2 MapArt This is a python3 project you can use with the MineClone2 game for Minetest. This project take an image and output a WorldEdit shema

3 Jan 06, 2023
This is simple minesweeper-like Telegram game

This is simple minesweeper-like Telegram game. You need to open all "free" squares and put flags on squares with bombs on them. If you open a cell with a bomb, the game is over.

Aleksandr 32 Dec 31, 2022
Online battleships game on python and JS

Battleships Online battleships game Using websockets to connect to the client. SQLite database for storing account data and game logs (for players top

5 Nov 11, 2021
This is a python interactive story game that I made to show off what I've learnt in python coding for a month

Purpose The files in this repository are for that of a story game created with python version 3.8.5 The purpose of this project was to get familiar wi

0 Dec 30, 2021
🐥Flappy Birds🐤 Video game. With your help I can go through🚀 the pipes. All UI is made with 🐍Pygame🐍

🐠 Flappy Fish 🐢 I am Flappy Fish 🐟 . With your help I can jump through the pipes and experience an interesting and exciting flight deep into the fi

MohammadReza 2 Jan 14, 2022
A rhythm-based game that automatically generates obstacles based on a song's features.

DISCLAIMER: This is my first coding project, created in December 2019. The game may not be optimized, and looking back on it, there are a lot of chang

Kenneth Huang 1 Dec 27, 2021
Historical battle simulation package for Python

Jomini v0.1.4 Jomini creates military simulations by using mathematical combat models. Designed to be helpful for game developers, students, history e

Ümit Kaan Usta 36 Dec 08, 2022
Python Interactive Mini Games

Python Interactive Mini Games Mini projects from Coursera's An Introduction to I

Ashish Choudhary 1 Jan 16, 2022
For educational purposes, a simple script that assists in solving the word game Wordle.

WordleSolver For educational purposes, a simple script that assists in solving the word game Wordle. Instructions Pick your first word from the sugges

Christian De Leon 2 Mar 25, 2022
A first-person shooting game developed by using OpenGL

OpenGL-MazeSurvivor-FirstPerson Shooting Game This application named ‘MAZE SURVIVOR’ is a first-person shooting game that finished within a month. It

JunHong 2 Jan 04, 2023
Solo CLF project about the creation of the FlickColor game in Python with very precise instructions.

Solo CLF project about the creation of the FlickColor game in Python with very precise instructions.

COZAX 1 Dec 09, 2022
Ultimaze est un jeu en 2.5D, réalisé dans le cadre d'un projet de NSI.

Ultimaze Ultimaze est un jeu en 2.5D, réalisé dans le cadre d'un projet de NSI. La consigne était d'utiliser la librairie pygame pour créer un jeu en

parlabarbedeMerlin 3 Sep 17, 2022
A full featured game of falling pieces using python's pygame library.

A full featured game of falling shapes using python's pygame library. Key Features • How To Play • Download • Contributing • License Key Features Sing

Giovani Rodriguez 7 Dec 14, 2022
A simple yet powerful Snake Game made with myPygameWorkflow

snakeGame A simple yet powerful Snake Game made with myPygameWorkflow. Requirments python3 Python.org myPygameWorkflow Github Ripo Usage $ cd main $ p

DuskyElf 1 Dec 26, 2021
Implementation of the Spider-Man Game

Projeto FPRO FPRO/LEIC, 2021/22 Francisco Campos (up202108735) 1LEIC08 Objetivo Criar um clone do clássico Spider-Man em Pygame... Repositório de códi

1 Dec 24, 2021
Lucky Balls is gambling game where user try to guess 6 numbers from 1 to 48 that computer has picked.

LUCKY BALLS Lucky Balls is gambling game where user try to guess 6 numbers from 1 to 48 that computer has picked. INSTRUCTIONS User input his bet, tha

rile037 2 Dec 28, 2021