0% found this document useful (0 votes)
37 views18 pages

Python

This document is a micro project report for a group of students in the Computer Engineering program, focusing on a project titled 'Bubble Shooter' developed using Python. The project aims to simulate a bouncing ball under gravity, enhancing understanding of Python programming concepts and physics principles. The report outlines the project's objectives, methodology, resources used, and the skills developed through its completion.

Uploaded by

P
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views18 pages

Python

This document is a micro project report for a group of students in the Computer Engineering program, focusing on a project titled 'Bubble Shooter' developed using Python. The project aims to simulate a bouncing ball under gravity, enhancing understanding of Python programming concepts and physics principles. The report outlines the project's objectives, methodology, resources used, and the skills developed through its completion.

Uploaded by

P
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Programme: Computer Engineering Academic Year: 2024 –

2025 Course : Programming with Python Course Code: PWP- 22616


Semester : Sixth

MICRO PROJECT REPORT


ON

Microproject Title
Submitted by the group of 4 students,

Sr. Roll Enrollment


Full name of Student Seat No
No No No
1 16 Dhangar Pranjal Bhatu 2200590090 405228
2 36 Mahale Rakhi Janardhan 2200590117 405250
3 52 Patil Divya Anil 2200590141 405270
4 53 Patil Janhavi Ganesh 2200590143 405272

Under the Guidance of

Mr. Niket S. Sharma


in
Three Years Diploma Programme in Engineering and Technology of
Maharashtra State Board of Technical Education, Mumbai
(Autonomous)
ISO 9001: 2008 (ISO/IEC-27001:2013) at

0059 – Shri Shivaji Vidya Prasarak Sanstha’s


Bapusaheb Shivajirao Deore Polytechnic, Vidyanagari, Deopur, Dhule-424005
MAHARASHTRA STATE BOARD OF TECHNICAL
EDUCATION, MUMBAI

Certificate
This is to certify that,
Roll No Enrollment No Name Exam Seat No.
16 2200590090 Dhangar Pranjal Bhatu 405228
36 2200590117 Mahale Rakhi Janardhan 405250
52 2200590141 Patil Divya Anil 405270
53 2200590143 Patil Janhavi Ganesh 405272

students of Sixth Semester Diploma Programme in Computer Engineering at


Shri Shivaji Vidya Prasarak Sanstha’s Bapusaheb Shivajirao Deore
Polytechnic, Dhule (Institute Code : 0059), have completed the Micro Project
satisfactorily in Subject Programming With Python (22616) in the academic
year 2024–2025 as prescribed in the MSBTE curriculum of I Scheme.

Place: Dhule Date: / / 2025

Project Guide Head of the Department Principal

Seal of Institute
Part A: Micro-Project Proposal
Title :Bubble Shooter
1.0 Aim of the Micro -Project:

The aim of this micro-project is to develop a simple Bouncing Ball simulation using the
Python programming language. The project helps in demonstrating how a ball behaves
under gravity, including its motion, collisions with surfaces, and energy loss after each
bounce. It uses basic mathematical and physics principles to simulate realistic movement.
It also aims to improve understanding of core Python concepts such as loops, conditional
statements, functions, and basic graphics (using libraries like turtle or pygame) by applying
them in a real-life simulation.

2.0 Course Outcomes Addressed:


a) Develop python program to demonstrate use of operators.
b) Develop functions for given Problems.
c) Design classes for given problems.

3.0 Proposed Methodology:


1. Understanding the Physics: Study the basic principles of motion, gravity, velocity, and
energy loss during each bounce.

2. Setting Up the Environment: Use Python and a suitable library such as turtle or pay game to
create a visual interface for the simulation.

3. Designing the Ball Movement: Implement logic to move the ball vertically and detect
collisions with the ground.

4. Applying Gravity and Bounce Logic: Use mathematical formulas to simulate gravity and
reduce velocity after each bounce to reflect energy loss.

5. Creating a Loop for Continuous Motion: Use loops to animate the ball’s motion continuously
until it comes to rest or exits the screen.

6. Testing and Optimization: Test the simulation, make necessary corrections, and optimize for
smooth performance.
4.0 Action plan:
Sr. Details of Planned Start Planned Name of
No. Activity date Finish Responsible
date
Team Members
1 Data Collection 08/01/2025 27/01/2025 Pranjal B. Dhangar
Rakhi J . Mahale

2 Analysis 29/01/2025 17/02/2025 All Groups Members


3 Design 19/02/2025 09/03/2025 All Groups Members
3 Development 11/03/2025 23/03/2025 Divya A . Patil Janhavi G
. Patil

4 Report Writing 26/03/2025 28/03/2025 All Groups Members

5.0 Resource Required:


Sr. no Name of resources Specification Quantity Remark

1 Computer system Processor: Intel(R) Pentium(R) Dual 1


CPU [email protected]
RAM: 512 MB
2 Operating System OS: Windows 11(64bit) 1

3 Software Python :3.13 IDE 1

Names of Team Members with Roll Nos.


Rol Name
l

N
o
16 Dhangar Pranjal Bhatu
36 Mahale Rakhi Janardhan
52 Patil Anil Divya
53 Patil Janhavi Ganesh
Part B: Micro-Project Report
Title Bubble Shooter
1.0 Rationale:

ur daily life, we observe the motion of objects like balls, especially how they bounce and gradually come to rest
due to gravity and energy loss. Understanding this natural motion helps us learn fundamental
physics concepts such as acceleration, velocity, and energy conservation. Simulating such
behaviour using programming can be both educational and engaging. To achieve this, a Bubble
Shooter project was developed using Python to create an interactive and visually appealing
simulation.Python is an easy-to-learn language that is widely used in both academic and practical
fields. Libraries such as turtle or pay game allow us to build graphical animations, making the
tool more interactive and enjoyable. The rationale behind this project is to understand how
physics principles can be implemented using Python in a simple and effective manner. It also
enhances our programming, problem-solving, and animation development skills without
requiring any advanced libraries or complex mathematical tools.

2.0 Aim of the Micro-Project:


aim of this micro-project is to develop a simple Bubble Shooter Simulation using the Python programming
language. The project helps in visualizing the motion of a ball bouncing under the effect of
gravity and elasticity using basic physics and mathematical formulas. It also aims to improve
understanding of core Python concepts such as input/output, conditional statements, loops, and
functions by applying them in a real-life application.

3.0 Course Outcomes Achieved:


a) Perform operations on data structures in python.

b) Develop functions for given Problems.

c) Design classes for given problems


4.0 Actual Methodology Followed:
A. Algorithm

Step 1: Start

Step 2: Read initial height from which the ball is dropped

Step 3: Read coefficient of restitution (rebound factor, between 0 and 1)

Step 4: Set a threshold height (e.g., 0.01 meters) below which bouncing stops

Step 5: Initialize total distance = 0, bounce count = 0

Step 6: While height > threshold

Add current height to total distance (fall)

Calculate new height = current height × coefficient of restitution Add

new height to total distance (bounce up)

Increment bounce count

Step 7: Display total distance travelled and number of bounces Step

8: End
B. Flowchart
C. Program code

import
pygame
import random
import math
from collections import deque

# Initialize Pygame
pygame.init()

# Window setup
WIDTH, HEIGHT = 640, 720
screen = pygame.display.set_mode((WIDTH, HEIGHT))
pygame.display.set_caption("Bubble Shooter")

# Colors (from the image)


COLORS = [
(255, 0, 0), # Red
(255, 255, 0), # Yellow
(0, 255, 0), # Green
(0, 0, 255), # Blue
(160, 32, 240), # Purple
(255, 165, 0) # Orange
]

# Bubble setup
BUBBLE_RADIUS = 20
bubble_speed = 10
ROWS = 8
COLS = WIDTH // (BUBBLE_RADIUS * 2)
# Clock
clock = pygame.time.Clock()

# Bubble Class
class Bubble:
def _init_(self, x, y, color=None, dx=0, dy=0, moving=False):
self.x = x
self.y = y
self.color = color or random.choice(COLORS)
self.dx = dx
self.dy = dy
self.moving =
moving

def draw(self, surface):


pygame.draw.circle(surface, self.color, (int(self.x), int(self.y)), BUBBLE_RADIUS)

def move(self):
if self.moving:
self.x += self.dx
self.y += self.dy
# Bounce off walls
if self.x <= BUBBLE_RADIUS or self.x >= WIDTH - BUBBLE_RADIUS:
self.dx *= -1

# Game setup
bubbles = []

# Create hex-style grid of bubbles


for row in range(ROWS):
for col in range(COLS - (row % 2)):
x_offset = BUBBLE_RADIUS if row % 2 else 0
x = col * BUBBLE_RADIUS * 2 + BUBBLE_RADIUS + x_offset
y = row * int(BUBBLE_RADIUS * 1.732) + BUBBLE_RADIUS # vertical spacing = R *
sqrt(3)
bubbles.append(Bubble(x, y))

# Shooter setup
shooter = Bubble(WIDTH // 2, HEIGHT - 50)

# Collision detection between two bubbles


def check_collision(b1, b2):
dist = math.hypot(b1.x - b2.x, b1.y - b2.y)
return dist <= BUBBLE_RADIUS * 2

# Find clusters of bubbles of the same color using BFS


def find_cluster(x, y, color):
visited = set()
cluster = []
queue = deque([(x, y)])

while queue:
cx, cy = queue.popleft()
for bubble in bubbles:
if (bubble.x, bubble.y) not in visited and check_collision(Bubble(cx, cy, color), bubble):
if bubble.color == color:
visited.add((bubble.x, bubble.y))
cluster.append(bubble)
queue.append((bubble.x, bubble.y))
return cluster

# Main loop
running = True
while running:
screen.fill((255, 255, 255)) # White background
for event in pygame.event.get():
if event.type ==
pygame.QUIT:
running = False

if event.type == pygame.MOUSEBUTTONDOWN and not shooter.moving:


mx, my = pygame.mouse.get_pos()
angle = math.atan2(my - shooter.y, mx - shooter.x)
shooter.dx = math.cos(angle) * bubble_speed
shooter.dy = math.sin(angle) * bubble_speed
shooter.moving = True

shooter.move()

# Collision check with grid


if shooter.moving:
for b in bubbles:
if check_collision(shooter, b):
cluster = find_cluster(shooter.x, shooter.y, shooter.color)
if len(cluster) >= 3:
for match in cluster:
if match in bubbles:
bubbles.remove(match)
else:
bubbles.append(Bubble(shooter.x, shooter.y, shooter.color))
shooter = Bubble(WIDTH // 2, HEIGHT - 50)
break

if shooter.y <= BUBBLE_RADIUS:


bubbles.append(Bubble(shooter.x, shooter.y, shooter.color))
shooter = Bubble(WIDTH // 2, HEIGHT - 50)

# Draw everything
for b in bubbles:
b.draw(screen)

shooter.draw(screen)
pygame.display.flip()
clock.tick(60)
pygame.quit()

5.0 Actual Resources Used:-


Sr. no Name of resources Specification Quantity Remark

1 Computer system Processor: Intel(R) Pentium(R) Dual 1 -


CPU [email protected]
RAM: 512 MB
2 Operating System OS: Windows 11(64bit) 1 -

3 Software Python :3.13 IDE 1 -

6.0 Outputs of the Micro-Project:

Figure 1. Bubble Shooter with output


This figure shows a graphical user interface (GUI) window titled " Bubble Shooter ". Inside the
window, there is a single circular object (a ball) rendered in a teal color. This ball is part of a
simulation where it moves or "bounces" around the window, changing direction when it hits the
boundaries (walls) of the window.

7.0 Skill Developed/Learning outcome of this Micro-Project:

1. Python Programming Skills:


Gained hands-on experience in writing Python code using functions, variables,
conditional statements, and exception handling.
2. GUI Development using Tainter:
Learned how to create a graphical user interface using the Tainter library in Python,
including labels, buttons, entry fields, and dropdown menus.
3. Problem-Solving and Logic Building:
Understood how to apply mathematical formulas in programming to solve real-life
problems like temperature conversion

8.0 Application of the Micro-Project:

The Bubble Shooter game microproject serves as a practical implementation of various


programming concepts and demonstrates how game development can enhance problem-solving
and software development skills. The key applications of this microproject include:

1. Learning and Applying Python Programming Concepts: Utilizes core Python concepts such
as loops, conditionals, functions, classes, and object-oriented programming. Introduces the use
of libraries such as pygame for game development and graphics rendering.

2. Understanding Game Development Fundamentals: Helps understand game logic, collision


detection, animation, and event handling. Teaches how to structure a game loop and manage
game states like win/loss and restart conditions.

3. User Interface (UI) and Interaction Design: Provides hands-on experience with designing
simple and intuitive user interfaces . Improves understanding of handling real-time user inputs
(keyboard and mouse).
4. Problem Solving and Logical Thinking: Encourages breaking down a game into small logical
modules, enhancing analytical thinking. Helps in debugging and optimizing code for better
performance:

5. Portfolio and Resume Building : A well-designed game project acts as a strong portfolio
piece for internships and job interviews. Demonstrates initiative, creativity, and the ability to
complete a full software development cycle.

6. Foundation for Advanced Projects: Acts as a base for more complex game development
using engines like Unity or frameworks like Godot. Can be extended with new features such as
scoring, levels, sound effects, and multiplayer support.

9.0 References

i. https://www.jetir.org/papers/JETIR2106527.pdf
ii. https://en.m.wikipedia.org/wiki/Body_mass_index
iii. https://journals.lww.com/nutritiontodayonline/fulltext/2015/05000/body_mass_index
_obesity,_bmi,_and_health_a.5.aspx
Evaluation Sheet for the Micro Project

Name of Faculty : Mr.Niket.S.Sharma


Academic Year : 2024– 2025

Semester: Sixth Program Name and Code: CO – 6I

Course Code : 22616 Course Name :Programming With Python


Title of the Project: Bubble Shooter
COs addressed by the Micro Project:
a) Display the message on the screen using python script on IDE.
b) Develop functions for given problem.
a) Handle exceptions

Major Learning Outcomes achieved by students by doing the Project:


(A) Practical Outcomes
 Understanding GUI Development with Tainter.
 Implement decision-making logic to classify BMI results into categories (Underweight,
Normal weight, Overweight, Obese).
(B) Unit Outcomes (in Cognitive domain)
Develop relevant user defined functions for the given problem using python code.
(C) Outcomes in Affective Domain
 Understanding of Teamwork: Recognizing how different functions of an organization
must work together to achieve overall success.
 Commitment to Ongoing Learning: Developing a focus on continuously improving skills.
o Name of Student: Dhangar Pranjal Bhatu
Marks:
(A) Marks for Group work: (B) Marks for Group work: (C) Total Marks (A+B) =

(Mr.Niket.S.Sharma, Lecturer)
Signature with Name and Designation of the Faculty Member
Evaluation Sheet for the Micro Project

Name of Faculty : Mr.Niket.S.Sharma


Academic Year : 2024– 2025

Semester: Sixth Program Name and Code: CO – 6I

Course Code : 22616 Course Name :Programming With Python


Title of the Project: Bubble Shooter
COs addressed by the Micro Project:
a) Display the message on the screen using python script on IDE.
b) Develop functions for given problem.
c) Handle exceptions

Major Learning Outcomes achieved by students by doing the Project:


(A) Practical Outcomes
 Understanding GUI Development with Tkinter.
 Implement decision-making logic to classify BMI results into categories (Underweight,
Normal weight, Overweight, Obese).
(B) Unit Outcomes (in Cognitive domain)
Develop relevant user defined functions for the given problem using python code.
(C) Outcomes in Affective Domain
 Understanding of Teamwork: Recognizing how different functions of an organization
must work together to achieve overall success.
 Commitment to Ongoing Learning: Developing a focus on continuously improving skills.
o Name of Student: Mahale Rakhi Janardhan
Marks:
(A) Marks for Group work: (B) Marks for Group work: (C) Total Marks (A+B) =

(Mr.Niket.S.Sharma, Lecturer)
Signature with Name and Designation of the Faculty Member
Evaluation Sheet for the Micro Project

Name of Faculty : Mr.Niket.S.Sharma


Academic Year : 2024– 2025

Semester: Sixth Program Name and Code: CO – 6I

Course Code : 22616 Course Name :Programming With Python


Title of the Project: Bubble Shooter
COs addressed by the Micro Project:
b) Display the message on the screen using python script on IDE.
c) Develop functions for given problem.
d) Handle exceptions

Major Learning Outcomes achieved by students by doing the Project:


(A) Practical Outcomes
 Understanding GUI Development with Tkinter.
 Implement decision-making logic to classify BMI results into categories (Underweight,
Normal weight, Overweight, Obese).
(B) Unit Outcomes (in Cognitive domain)
Develop relevant user defined functions for the given problem using python code.
(C) Outcomes in Affective Domain
 Understanding of Teamwork: Recognizing how different functions of an organization
must work together to achieve overall success.
 Commitment to Ongoing Learning: Developing a focus on continuously improving skills.
o Name of Student: Patil Divya Anil
Marks:
(A) Marks for Group work: (B) Marks for Group work: (C) Total Marks (A+B) =

(Mr.Niket.S.Sharma, Lecturer)
Signature with Name and Designation of the Faculty Member
Evaluation Sheet for the Micro Project

Name of Faculty : Mr.Niket.S.Sharma


Academic Year : 2024– 2025

Semester: Sixth Program Name and Code: CO – 6I

Course Code : 22616 Course Name :Programming With Python


Title of the Project: Bubble Shooter
COs addressed by the Micro Project:
d) Display the message on the screen using python script on IDE.
e) Develop functions for given problem.
e) Handle exceptions

Major Learning Outcomes achieved by students by doing the Project:


(A) Practical Outcomes
 Understanding GUI Development with Tkinter.
 Implement decision-making logic to classify BMI results into categories (Underweight,
Normal weight, Overweight, Obese).
(B) Unit Outcomes (in Cognitive domain)
Develop relevant user defined functions for the given problem using python code.
(C) Outcomes in Affective Domain
 Understanding of Teamwork: Recognizing how different functions of an organization
must work together to achieve overall success.
 Commitment to Ongoing Learning: Developing a focus on continuously improving skills.
o Name of Student: Patil Janhavi Ganesh
Marks:
(A) Marks for Group work: (B) Marks for Group work: (C) Total Marks (A+B) =

(Mr.Niket.S.Sharma, Lecturer)
Signature with Name and Designation of the Faculty Member

You might also like