How To Move Object in Pygame in Urdu/Hindi
In this video I have Explained that How To Move Object in Pygame in Urdu/Hindi
-----------------------------------------------------------------------------------
**************************************************** |
For Your Personal Projects or Queries Contact me: |
WhatsApp : +923133401049 |
**************************************************** |
----------------------------------------------------------------------------------
===============
Code Github Link : pastelink
===============
***********************************
If you want to copy code directly *
***********************************
Note : Recplace (greater than) and (less than) with their sign/symbol ( Because Youtube donot allow angle brackets in description ) OR You can get this code on github by using github link
***********
* CODE : *
***********
import pygame
pygame.init()
width_of_pygame = 400
height_of_pygame = 400
window_in_pygame = pygame.display.set_mode((width_of_pygame, height_of_pygame))
pygame.display.set_caption("Your First Game")
color_of_square = (0,255,0)
x = 100
y = 100
width = 30
height = 30
run_my_game = True
speed = 0.1
while run_my_game:
for event in pygame.event.get():
if event.type == pygame.QUIT:
run_my_game = False
pygame.draw.rect(window_in_pygame, color_of_square, (x, y, width, height))
pygame.display.update()
key_pressed = pygame.key.get_pressed()
if key_pressed[pygame.K_UP]:
y -= speed
if key_pressed[pygame.K_DOWN]:
y += speed
if key_pressed[pygame.K_RIGHT]:
x += speed
if key_pressed[pygame.K_LEFT]:
x -= speed
window_in_pygame.fill((0,0,0))
pygame.quit()
#movingobjectusigpygame,#gameusingygame,#pygame,python (programming language),#youtubemarketing,pygame,# techie,# techtips,# techreview,game,# techyoutuber,#youtubecreator,pygame tutorial,#coding,example,beginner,download,#pythonprogramming,#trending,development,#instavideo,#programming,#instayoutube,rect,# tech,#viral,tutorial,python 3,platformer,#roseflower,#youtubevide,thenewboston,#youtubelikes,#youtubemusic,free,#vlog,#live,intro,lesson,python,#memes,#python,#twitch,android