Skip to main content

Part 2 : Making a game in python || pygame


In this video, you will learn - Changing background of the game - Displaying image in the game - putting an image in a definite position Stay tuned -Stay subscribed for other parts of the tutorial.Meanwhile like, share and comment your queries. python code: # Import a library of functions called 'pygame' import pygame # Initialize the game engine pygame.init() display_width=800 display_height=600 black=(0,0,0) white=(255,255,255) red=(255,0,0) gamedisplay = pygame.display.set_mode((display_width,display_height)) pygame.display.set_caption("Cool Game") clock=pygame.time.Clock() crashed=False carImg= pygame.image.load('car.png') def car(x,y): gamedisplay.blit(carImg,(x,y)) x=(display_width * 0.45) y=(display_height * 0.65) while not crashed: for event in pygame.event.get(): if event.type == pygame.QUIT: crashed= True gamedisplay.fill(red) #print(event) car(x,y) pygame.display.update() clock.tick(60) pygame.quit() quit() Keywords:
python game engine 2d, python game library, python game development, pygame game, python game creator, python game programming tutorial for beginners, pygame tutorial, python based games, Game development in python, build your own game in python with pygame, build your own game in python, make your own game in python, invent your own game in python, how to make a game in python for beginners, python game programming pdf, pygame tutorial for beginners, how to make a game in python without pygame, python games, pygame tutorial(pdf), making games with python and pygame,

Comments

Popular posts from this blog

How to Create a Family Wellness Routine

In today's fast-paced world, it can be easy to neglect our health and wellness in favor of keeping up with work, school, and other obligations. However, it's important to remember that taking care of ourselves and our families is essential for leading happy and fulfilling lives. One great way to ensure that the whole family is staying healthy and happy is by creating a family wellness routine. A family wellness routine is a set of daily habits and activities that promote physical, mental, and emotional well-being for everyone in the household. By establishing a routine that incorporates healthy eating, regular physical activity, and other wellness practices, you can help your family stay strong and resilient in the face of life's challenges. So, how can you create a family wellness routine that works for everyone? Here are some tips to get you started: 1. Set Clear Goals: The first step in creating a family wellness routine is to set clear goals for what you want to achieve...

Make your own tic-tac-toe game on Android

Now stay tuned with the new videos.Just click the button mention below of youtube: App Code for MainActivity.java: import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.Toast; public class MainActivity extends AppCompatActivity implements View.OnClickListener { int chance=0;     Button btn1,btn2,btn3,btn4,btn5,btn6,btn7,btn8,btn9,reset;     @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_main);     btn1=(Button)findViewById(R.id.btn1);     btn2=(Button)findViewById(R.id.btn2);     btn3=(Button)findViewById(R.id.btn3);     btn4=(Button)findViewById(R.id.btn4);     btn5=(Button)findViewById(R.id.btn5);     b...

Tips for Planning a Family Volunteer Day

Volunteering as a family can be a rewarding and fulfilling experience. Not only does it provide an opportunity to give back to the community, but it also allows families to spend quality time together while making a positive impact. Planning a family volunteer day may seem like a daunting task, but with the right tips and guidance, it can be a seamless and enjoyable experience for everyone involved. In this blog post, we will discuss some useful tips for planning a family volunteer day that will help you organize and execute a successful and meaningful day of giving back. 1. Choose a Cause or Organization The first step in planning a family volunteer day is to choose a cause or organization that you and your family are passionate about. Whether it's supporting a local shelter, cleaning up a park, or helping out at a food bank, there are countless opportunities for families to make a difference in their community. Consider the interests and abilities of your family members when sele...