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)
Game using Python

🎡 Rock-Paper_Scissor Game Using Python Beginner Friendly Easy to use ♟ Want to Play this? Clone this repository Open in any IDE(for eg. VS Code, PyCh

Akash Kumar 1 Oct 17, 2021
A Replit Game Know As ROCK PAPER SCISSOR AND ALSO KNOW AS STONE PAPER SCISSOR

🔥 ᴿᴼᶜᴷ ᴾᴬᴾᴱᴿ ᔆᶜᴵᔆᔆᴼᴿ 🔥 ⚙️ Rᴜɴ Oɴ Rᴇᴘʟɪᴛ 🛠️ Lᴀɴɢᴜᴀɢᴇs Aɴᴅ Tᴏᴏʟs If you are taking code from this repository without a fork, then atleast give credit

ANKIT KUMAR 1 Dec 25, 2021
This is an interactive MiniMap made with Python, PyQT5 & Pytesseract for the game

NWMM-New-World-MiniMap Features: Automatically grabs position from "New World" Instance Live visualisation of player position on MiniMap Circular & re

Nezzquikk 18 Sep 21, 2022
A small game I made back in think 2011

Navi Network A small game I made back in think 2011. An online game inspired by the self-hosted nature of Minecraft, made with pygame, based on the Me

Peder Bergebakken Sundt 2 Jan 19, 2022
It calculates the Nim sum of a nim game.

nim-sum-calculator It calculates the Nim sum of a nim game. The rules of Nim The traditional game of Nim is played with a number of coins arranged in

2 Jan 02, 2022
A basic quiz game using Python

QuizGame A basic quiz game using Python Passwords for quizzes (NO CAPS LOCK!): -ryzermattishandsome -canisleepwithyou Before using this, please make s

Austin 1 Nov 12, 2021
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

Leonardo Delfino 1 Dec 22, 2021
A popular children's game developed in Python.

Pedra Papel e Tesoura Um dos jogos mais populares da infância... 🪨 📜 ✂️ 💻 Situação do projeto: Projeto finalizado ✔️ 🛠 Tecnologias: Python Tkinter

Arthur V.B.S. 2 Dec 05, 2022
j-chess implementation in python

j-chess-client-python This repository aims to be a starting point for implementing a chess ai for the j-chess-server in python. To start, you can copy

Jonas 1 Dec 25, 2021
A chess engine with basic AI capabilities (search for best move using MinMax algorithm)

A chess engine with basic AI capabilities (search for best move using MinMax algorithm)

Ken Wu 1 Feb 02, 2022
Minesweeper clone with 3 modes of difficulty, UI scaling and custom games feature.

Insect Sweeper Minesweeper clone with 3 modes of difficulty, UI scaling and custom games feature. Mines are replaced with random insects that a player

Piotr Data 1 Nov 05, 2021
Wordle Solver: A simple script which is also called Wordle solver

wordle-solver this code is a simple script which is also called Wordle solver. t

amirreza 1 Feb 15, 2022
A "guess the number" game on a GUI interface using Tkinter library🙂

A "guess the number" game on a GUI interface using Tkinter library🙂

Arsalan 2 Feb 01, 2022
Games: Create interesting games by pure python.

Create interesting games by pure python.

4.2k Jan 06, 2023
Wordle is a web-based word game. Players have six attempts to guess a five-letter word;

Wordle is a web-based word game. Players have six attempts to guess a five-letter word; feedback is given for each guess, in the form of colored tiles, indicating when letters match or occupy the cor

Abhishek 2 May 21, 2022
Tic-Tac-Toe Game in python3 Tkinter

Tic Tac Toe Tic-Tac-Toe Game in python3 Tkinter About: Tic Tac Toe or Noughts and Crosses as called in British is a pencil and paper game for two play

Sai Swarup Yakkala 5 Nov 06, 2022
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
BritishTrainsDepartureBoard - A pygame program that immitates the dot matrix departure screens found at National Rail stations

BritishTrainsDepartureBoard - A pygame program that immitates the dot matrix departure screens found at National Rail stations

Finn O'Neill 3 Aug 10, 2022
Blackjack Game made using Python

Blackjack Game made using Python Blackjack is a popular card game played in most of the casino.This is an intuition to replicate the same card game us

SUHASJAGADISH 1 Nov 28, 2021
A DDQN that learned to play tic tac toe by playing against itself

TicTacToeAI A DDQN that learned to play tic tac toe by playing against itself Cu

Anik Patel 3 Apr 09, 2022