Skip to content

Brunda02/Clash-of-clans

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Notes --> followed OOP in building this game we've different classes where each of them represents --buildings --kings --canons --barbarian --archers --balloons etc --> here few classes are inherited from parent classes example: hut class is inherited from building class, king is child class of person (parent class) etc

-->each of classes have different methods and constructors for example:

def init(self):

self.hit_pts=1

self.damage=2

self.health=30

this is constructor for person's class Encapsulation: it is a way where we bundle data and methods together. we've bundled attributes and methods in a class. so, we've used encapsulation

Polymorphism it is about having different interfaces for same function. for example if we want to calculate addition of 2 numbers. now we can write different functions with same name where one of it taes integers, other takes decimals etc.

Execution run python3 game.py

enter 'K' for choosing king and 'Q' for choosing queen

use -A for moving king to left

-D -->move king to right

-S -->move king down

-W --> move king up

spacebar -->to attack huts/townhalls

G,P,I--> create barbarian

J,K,L---> creates balloons

M,N,O-->creates archers

-Q-->quit game

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages