I have done everything as you said. My code is fine, but when I run the code it starts a black windows and then says programe is not responding. By the way I have windows 7.
@Geordan271 It is because you don't have the file called "bg.jpg". This is your programs background, make it in paint or something for now. It must be in the same folder as your program and you need to name it "bg.jpg". Or if you look at the code, you can change what it is named through that in order to use whatever file you want as a background.
how do you run it? when i click run and go run module it come up with a "Python shell" and says import error no module named pygame. can anyone help please
Blit , blit meaning , definition of blit , meaning of blit -
/blit/ vt. 1. [common] To copy a large array of bits from, one part of a computer's memory to another part, particularly when, the memory is being used to determine what is shown on a display, screen.
Please help me. I did all the steps but all it is, is a big black screen. Is there a probem in my code? please help. I have a 64 bit computer. and my backround image was 5000x3500. Was that too big?
@ItsaUFOduh you have to have a transparent image to start with.. If you have GIMP(photo editor), you can make an image transparent like I did, and also resize it to like 60x60 which worked like a charm for me
@whatsajaymo maybe try changing the screen command to: screen=pygame.display.set_mode((640,360),0,24)
or if that doesn't work try this: screen=pygame.display.set_mode((640,360),0,16)
and if that fails as well than go through your code again character by character from the start all the way to the end and just keep on trying until you'll finally get it ;)
@trevonturner double-check the name of your pictures and the format extensions they have. Small things like that can be really annoying. And maybe try making a new folder on your desktop and throw everything in there. The worst part in programming is when you get an error but the best part is when you solve it ;)
Whenever I try and install the newest Pygame it says I need Python version 2.4 or something. I have 2.7 on my computer, and pygame is already installed. Python says there's no pygame module.
@TheMarioMan1 you have to download the pygame for 2.7 that is your version. i first encounter the same problem, because i download the wrong version, what you have to do is looking for file named this: "pygame-1.9.2a0.win32-py2.7.msi", sized 6.4 MB. You can see the syntax -py2.7.msi which refers to your python version
@1chapper I get an error saying it can't open the background. It's called bg.jpeg, and I can't save it as jpg. Could that have anything to do with it? Does it need to be saved as a jpg? Please respond.
I've used to code by Basics and C++, I got shocked when I saw that in python there's no damn if...end if sections at all. That all seems very confusing... But when you've learned indenting code it's pretty easy.
@asfadasfa1234 Make sure that it is compatible with your version of Python. If you have Python 2.7, then download and install the version of Pygame that has 2.7 at the end of it.
@ben1996123 I got that error once but from the information it displayed on the terminal, I figured out that I made a typo for the screen.blit for the mouse. What I did "screen.blit(mouseImage (x,y))" What your supposed to do "screen.blit(mouseImage, (x,y))".
in order for it to load, the file has to be in the python directory. if not give bif or mif the image file location first example: mif="c:\.....\.....\......"
this is the file location. then you can load it by doing the following:
For the images to work, you need to put the pictures in the directory that your save file is in. For example I named this "simple program" which is located in C:\Python26\Programs for me. So, I put both image files in the same location and it worked like a charm.
Thumbs up since this is a common problem and reply to this post if it still does not work
@1chapper I created a folder and i saved it in my own directory called Programs and have the 2 pictures The Background picture is bg.jpeg and Player is ball.png. I had the save file on there and run it and had no sprites still D:
Guy's i know how to get it to work!(the pic's) What you do is just put full details so like of me in was. For bg.jpg: C:\Users\Toby\Desktop\Python 2.6/bg.jpg. For the ball is was: C:\Users\Toby\Desktop\Python 2.6/ball.png. On windows 7 just click the arrow and is will change copy it and paste it in where is says: bif= or for the ball mif=. Hope this helped! RATE UP TO KEEP IT ALIVE!
@nick114245 Guy's i know how to get it to work!(the pic's) What you do is just put full details so like of me in was. For bg.jpg: C:\Users\Toby\Desktop\Python 2.6/bg.jpg. For the ball is was: C:\Users\Toby\Desktop\Python 2.6/ball.png. On windows 7 just click the arrow and is will change copy it and paste it in where is says: bif= or for the ball mif=. Hope this helped! RATE UP TO KEEP IT ALIVE!
@nick114245 Guy's i know how to get it to work!(the pic's) What you do is just put full details so like of me in was. For bg.jpg: C:\Users\Toby\Desktop\Python 2.6/bg.jpg. For the ball is was: C:\Users\Toby\Desktop\Python 2.6/ball.png. On windows 7 just click the arrow and is will change copy it and paste it in where is says: bif= or for the ball mif=. Hope this helped! RATE UP TO KEEP IT ALIVE!
@HighTechPanda Guy's i know how to get it to work!(the pic's) What you do is just put full details so like of me in was. For bg.jpg: C:\Users\Toby\Desktop\Python 2.6/bg.jpg. For the ball is was: C:\Users\Toby\Desktop\Python 2.6/ball.png. On windows 7 just click the arrow and is will change copy it and paste it in where is says: bif= or for the ball mif=. Hope this helped! RATE UP TO KEEP IT ALIVE!
@HighTechPanda Guy's i know how to get it to work!(the pic's) What you do is just put full details so like of me in was. For bg.jpg: C:\Users\Toby\Desktop\Python 2.6/bg.jpg. For the ball is was: C:\Users\Toby\Desktop\Python 2.6/ball.png. On windows 7 just click the arrow and is will change copy it and paste it in where is says: bif= or for the ball mif=. Hope this helped! RATE UP TO KEEP IT ALIVE!
@VietHuynhMate you have to make it transparent in gimp or something, so like layer, transparency, add or alpha or whatever it is. loop up crosshair tutorial or something that needs transperancy if you don't understand :)
If you are wondering why he uses a "-=" when placing the cursor, here is an explanation of how -= works: lets say you have a statement that says "x -= y"... this can be re-written mathematically as "x = x - y"... or can be understood as "change the value of x by subtracting y from it"... he does the formula in his program to subtract half of the total hight (and width) from the actual cursor location (bottom right of object) to find the center. keep this comment alive if you found it helpful :)
@greenguitar28 I have a question. Are you sure the cursor location is bottom right and not top left? Because, when I blitted the image right at x,y, it showed the mouse pointer at the top left of the image. Tad confused now.
hmm, i like, but this crap of indentation pisses me off. I rather the punctual way since there is less ways of causing errors, and indentations can sometimes decide not to indent to the position they did before.
Awesome! I looked at those lame tutorials which are linked ate pygame.org and they were all incomplete and amateurish. but ur ones are awesome!!! Thanks .
My computer can't find the images when I use bif="C:\Users\Name\Pictures\img.jpg" or when I put them in the same directory and just use bif="img.jpg"
In computing, the Blit was a programmable bitmap graphics terminal designed by Rob Pike and Bart Locanthi Jr of Bell Labs in 1982.
Bit BLIT (which stands for bit-block [image] transfer but is pronounced bit blit) is a computer graphics operation in which several bitmaps are combined into one using a raster operator.
@ajspingvin, transparency is a characteristic of the .png or .gif file. I used .gif instead of .png because Irfanview can make them.
Make a 32x32 .bmp file in Microsoft Paint, with a red circle. Make the circle touch the edges of the 32x32 square on all 4 sides, fill the circle with red, fill each corner with blue. Save as ball.bmp.
Open ball.bmp in Irfanview. Save As GIF, check "Show options dialog," check "Save transparent color" & choose "Choose transparent color during saving," then Save.
@ncdave4life, BTW, if you don't already have Irfanview, then GET IT! It is awesome, and free. What's more, believe it or not, in an age when program sizes are measured in the hundreds of megabytes, the entire Irfanview program folder is less than 2 MB, total. Its Bosnian author, Irfan Skiljan, is an incredible software developer. (Sorry, Mac folks, it's for Windows only.)
Also BTW, don't worry about the fact that you're using a ball.gif file instead of a ball.png file. Both work fine.
don't know how this worked for him but when i ran this program i eventually ended up having to add an els: loop inside the for loop, just something to keep in mind im runing python 2.6 and the pygame is 1.9.1release-svn2575 in 32 bit sys on ubuntu
i wanted to know what a good book for a person who is new completely new to game development that could help me learn how to do this and understand all this. is therea good book that starts from scratch
I did it!! After a two tedious hours of trying to get pygame to work and to find out how I actually open it. I haven't watched your python tutorials yet. I'm planning too, but right now I felt like making games. I have no idea why I am feeling so proud just from something so simple... Perhaps because I've tried "programming" before and never got it, and now I made someting without game maker or anything like that where everythings already done for ya, basically.
Anyone who is having problems with locals not importing like I did, make sure your program is named something OTHER than a module, such as pygame (which is what I did) If you name the file pygame.py, it will find that file first and never look for the actual pygame lol.
fixed it. Thank you.
TheManManolo 2 days ago
I have done everything as you said. My code is fine, but when I run the code it starts a black windows and then says programe is not responding. By the way I have windows 7.
TheManManolo 3 days ago
I downloaded the program, the newest version, and I can't find where to open the app, any help?
Vryonette 2 weeks ago
@Vryonette u mean pygame? u dont open it u just use python idle and import it
S2totalwarfan 2 weeks ago in playlist More videos from thenewboston
@Vryonette Every browser has a default location to download files. Try c:\users\USERNAME\downloads
sharpiedyourwhat 5 days ago
how can i run the program?
AlexTheBulgarianMan 2 weeks ago
Comment removed
coyaOMEGA 3 weeks ago in playlist Computer Game Development Tutorial
For everyone experiencing a "couldn't open ___.jpg" error, here are some possible solutions:
Make sure that the image is actually a JPG
Make sure you have the name correct and in the correct case.
Make sure that the JPG file is INSIDE of your Python folder.
Hope this helps.
MatthewBWyatt 1 month ago
lol, I made almost exact pictures in gimp. Thanks for these tutorials Bucky. Everything works perfectly.
dreagoenthemaster 1 month ago in playlist Computer Game Development Tutorial
keep geting this error
TypeError: 'pygame.Surface' object is not callable
oxynecrophobia 1 month ago
@oxynecrophobia make sure when you blit you remember your comma after each parameter "screen.blit(mouse_c,(x,y))" VS "screen.blit(mouse_c(x,y))"
RiamuDiMentis 2 weeks ago in playlist Computer Game Development Tutorial
how do i run the program?
oxynecrophobia 1 month ago
can someone please help me?, when i try to run it, it keeps saying on shell "error:couldnt open bg.jpg" any help????????????
Geordan271 1 month ago
@Geordan271 It is because you don't have the file called "bg.jpg". This is your programs background, make it in paint or something for now. It must be in the same folder as your program and you need to name it "bg.jpg". Or if you look at the code, you can change what it is named through that in order to use whatever file you want as a background.
Dylanschannelodoom 1 month ago
when i run the program, the pygame window doesnt respond... can someone help me??
ajr4265979 1 month ago
@ajr4265979 does it say on python shell that you cant find the jpg image? because thats happening to me :(
Geordan271 1 month ago
your smart bro.. lol
Geordan271 1 month ago
my IDLE closes as soon as i run this, wtf is wrong?
metfankrizz 1 month ago
it says it coldnt load bif how do i fix it
jdude61 1 month ago
@jdude61 hey, just replying to uou because ihave the same problem. and i was wondering if you got it fixed?
Geordan271 1 month ago
When I try to run it, I get an error in line 4 saying: import pygame, sys
ImportError: No module named pygame
Help would be much appreciated.
Prototype9511 1 month ago
@Prototype9511 did you find the anwser?
PorifersAnims 1 month ago
it says pygame.display.update() is invalid syntax, at pygame
14koder 1 month ago in playlist Computer Game Development Tutorial
@14koder try pygame.display.flip()
it does the same thing
austinewunclerful 1 month ago
cant get it to work I get this error
TypeError: 'pygame.Surface' object is not callable
lostsh0t1 2 months ago
In case anybody is interested, you can put the following line in your while loop to make the cursor inside the ball disappear:
pygame.mouse.set_visible(0)
llewgnolm 2 months ago in playlist More videos from thenewboston
how do you run it? when i click run and go run module it come up with a "Python shell" and says import error no module named pygame. can anyone help please
juve1010101 2 months ago
@juve1010101 this happens to me too idk what it is il try looking for it
zoomer328 2 months ago
Blit , blit meaning , definition of blit , meaning of blit -
/blit/ vt. 1. [common] To copy a large array of bits from, one part of a computer's memory to another part, particularly when, the memory is being used to determine what is shown on a display, screen.
dan1ie 2 months ago 2
Comment removed
TheSdcoolio 2 months ago
Comment removed
TheSdcoolio 2 months ago
I put both files in the same location that my program is but doesn't work!!
MexicanAkatsuki 2 months ago
it says that pygame is an invalid syntax!?
Imagewicked 2 months ago in playlist Computer Game Development Tutorial
Blit = BLock Image Transfer
8bitnespunk 2 months ago
So for some reason I can't get my background image to load it can you help me?
MrWhenlifeislemon 3 months ago
ok nvm i solved it xD
turns out i typed geet instead of get in
for event in pygame.event.get():
XxDahamonnahxX 3 months ago
i did everything right even deleted the whole thing and made it again
i get the same problem
when i run the pygame window is black and theres no sprites no background no nothing
and when i click anything it goes "not responding"
plz help
i have windows 7 and pygame 2.5 and pythong 2.5.4
i need help ASAP!
XxDahamonnahxX 3 months ago
Comment removed
TheSdcoolio 2 months ago
@XxDahamonnahxX same with me
the files have to be in the same directory, although that doesn't seem to work for me
TheSdcoolio 2 months ago
@TheSdcoolio i got it working i noticed that i typed "geet" instead of "get"
XxDahamonnahxX 2 months ago
@XxDahamonnahxX
Same here dude. Idk whats wrong. :\
phobos001 1 month ago
get position is it
zik1zik 3 months ago
thanks but its the line b4 that it is screen.blit( backround, (0,0) ) *it says the error is rite here*
x,y = pygame.mouse.get_pos()
jjobros 3 months ago
can some1 help me
rite where this vidoe start that line of code it says unindent does not match any outer identation level
jjobros 3 months ago
@jjobros
maybe u made one space indentation;
it's not obvious sometimes, so make sure u check the indentation is similar errors occur
elbnderi 3 months ago in playlist Computer Game Development Tutorial
now if only somebody could help me make the cursor arrow disappear
QuentinWatt 3 months ago
@QuentinWatt pygame.mouse.set_visible(0)
39unknown93 3 months ago
It says it cant load my background...
bulceus 4 months ago
I am getting an error message saying that I have no available video device. I have no idea what this means
IrishCowboy87 4 months ago in playlist pygame
Please help me. I did all the steps but all it is, is a big black screen. Is there a probem in my code? please help. I have a 64 bit computer. and my backround image was 5000x3500. Was that too big?
MukiemukMC 4 months ago
i'm using python 3.1 and everything works except the edges on my mouse aren't transparent. Does anyone know how to fix this?
ItsaUFOduh 4 months ago
@ItsaUFOduh you have to have a transparent image to start with.. If you have GIMP(photo editor), you can make an image transparent like I did, and also resize it to like 60x60 which worked like a charm for me
ZzZeroRespectzZ 4 months ago
I get an error screen=pygame.display.set_mode((640,360),0,32)
error: No available video device, not sure whats wrong :(
whatsajaymo 5 months ago
@whatsajaymo maybe try changing the screen command to: screen=pygame.display.set_mode((640,360),0,24)
or if that doesn't work try this: screen=pygame.display.set_mode((640,360),0,16)
and if that fails as well than go through your code again character by character from the start all the way to the end and just keep on trying until you'll finally get it ;)
Kamilk12l 5 months ago
@Kamilk12l thanks so much, the first one I tried worked. :)
whatsajaymo 5 months ago
@whatsajaymo I'm glad I helped ;)
Kamilk12l 5 months ago
@whatsajaymo Im getting the same error and have no idea whats wrong with it
IrishCowboy87 4 months ago
whenever i try to run the program pygame stops responding, any ideas why ?
Tauronos 5 months ago
@Tauronos are there any error messages displayed in IDLE ? Post them here so we can try figuring it out ;)
Kamilk12l 5 months ago
It wont find the background picture...even if its in the exact same file as the other programs....this is very discouraging.
trevonturner 5 months ago
@trevonturner double-check the name of your pictures and the format extensions they have. Small things like that can be really annoying. And maybe try making a new folder on your desktop and throw everything in there. The worst part in programming is when you get an error but the best part is when you solve it ;)
Kamilk12l 5 months ago
whenever i try to run my program my pygame window turns white so I tried reducing the size but it still won't work
hamrwolf 5 months ago
So is it normal that even though the program works fine, I get an error in the shell when I quit?
bleachfan44 6 months ago
@bleachfan44 Are you exiting the program before the shell? You have to exit pygame first, or it will ask you if you wish to kill the program.
UnchainTheNight1 5 months ago
awesome, but im having problems with the QUIT part of the code any ideas?
monawoka97 6 months ago
When I think of POS, I automatically conclude it means Primary Operating System. I need to go outside more...
AMcKeeCT 6 months ago
I need help making the boundaries for my game! can anyone help?
pobah341 6 months ago
Whenever I try and install the newest Pygame it says I need Python version 2.4 or something. I have 2.7 on my computer, and pygame is already installed. Python says there's no pygame module.
TheMarioMan1 6 months ago
@TheMarioMan1 you have to download the pygame for 2.7 that is your version. i first encounter the same problem, because i download the wrong version, what you have to do is looking for file named this: "pygame-1.9.2a0.win32-py2.7.msi", sized 6.4 MB. You can see the syntax -py2.7.msi which refers to your python version
hope this help
SuperAvailable123 6 months ago in playlist newboston-gamedev tutorial
@1chapper I get an error saying it can't open the background. It's called bg.jpeg, and I can't save it as jpg. Could that have anything to do with it? Does it need to be saved as a jpg? Please respond.
IsisNiko 6 months ago
@IsisNiko
You could use set the variable as:
bif="bg.jpeg"
instead of .jpg.. it should work that way ;)
Jon998 6 months ago
screen.blit(background, (0,0))
i keep getting an error on this line!
"unindent does not match any outer indention level"
txchen123 6 months ago
convert_alpha() did not work for me at all
andreyfschoier 6 months ago
@Flargleful You can use Photoshop to create your own ball image, or you can search on google for a .png image
remixxproduction 6 months ago
when i try to run it, it says pygame not responding and then it says unable to open bg.jpg. HELP!
MichaelS0305 6 months ago
I've used to code by Basics and C++, I got shocked when I saw that in python there's no damn if...end if sections at all. That all seems very confusing... But when you've learned indenting code it's pretty easy.
Maketsup 7 months ago
"In the corner of the ball" i did not know that balls had corners xD
bence657 7 months ago
convert_alpha() didnt do anything my ball.png, you see the ball and the box i made it in it isnt transparent? why?
disneyfannrkrb 8 months ago
my mouse isnt in the middle -_-
xXBlackNinja228Xx 8 months ago
it says no module named pygame... but ive installed pygame 4 times now
asfadasfa1234 9 months ago
@asfadasfa1234 Mine has the same error.
pivmaster01 8 months ago
@asfadasfa1234 Make sure that it is compatible with your version of Python. If you have Python 2.7, then download and install the version of Pygame that has 2.7 at the end of it.
ImTheBatchMan 7 months ago
@asfadasfa1234 If ImTheBatchMan's suggestion didn't help, make sure you installed it in the same directory as python.
Curly7714 7 months ago
mine just crashes...
TypeError: 'pygame.Surface' object is not callable
ben1996123 9 months ago
@ben1996123 I got that error once but from the information it displayed on the terminal, I figured out that I made a typo for the screen.blit for the mouse. What I did "screen.blit(mouseImage (x,y))" What your supposed to do "screen.blit(mouseImage, (x,y))".
werecatOmega 8 months ago
in order for it to load, the file has to be in the python directory. if not give bif or mif the image file location first example: mif="c:\.....\.....\......"
this is the file location. then you can load it by doing the following:
mouse_c=pygame.image.load(mif).convert_alpha()
bibieification 9 months ago
@1chapper
I finaly fixed that frggin bg, but now the ball/cursor wont load! Help?
Kangosjarvi97 9 months ago
About the not being able to load image problem..... Make sure the dimensions of the pic u entered were correct (example: (640,300)
whalesquid413 10 months ago
For the images to work, you need to put the pictures in the directory that your save file is in. For example I named this "simple program" which is located in C:\Python26\Programs for me. So, I put both image files in the same location and it worked like a charm.
Thumbs up since this is a common problem and reply to this post if it still does not work
1chapper 10 months ago 32
@1chapper ive done what youve said but every time i attempt to run module it keeps coming up with "There's an error in your program:
expected an indented block"
it then highlights pygame in pygame.quit() section of my code
any idea how to fix this?
i'm on 2.7
AShiftyDealer 6 months ago
@1chapper I created a folder and i saved it in my own directory called Programs and have the 2 pictures The Background picture is bg.jpeg and Player is ball.png. I had the save file on there and run it and had no sprites still D:
iananimatorpro 1 month ago in playlist Computer Game Development Tutorial
i copied it exactly and wen i click run it says
background=pygame.image.load(bif).convert()
error: Couldn't open bg.jpg
and then the pygame window doesnt even start because it freezes and says not responding
some1 help please:(
migitman195 10 months ago
@migitman195 Same problem with me.. :/
SlipAllCityToy 9 months ago
@SlipAllCityToy dude u must have a file with that name,i ts not only copying.Go to google find a file save it as ''bucky.jpg'' then bif=bucky.jpg
background=pygame.image.load(bif).convert()
Starcraft2Rogue 9 months ago
@migitman195 same thing happened to me
MichaelS0305 6 months ago
When ever I start the window it is always black
Can anyone help?
VRCkid11 10 months ago 2
Guy's i know how to get it to work!(the pic's) What you do is just put full details so like of me in was. For bg.jpg: C:\Users\Toby\Desktop\Python 2.6/bg.jpg. For the ball is was: C:\Users\Toby\Desktop\Python 2.6/ball.png. On windows 7 just click the arrow and is will change copy it and paste it in where is says: bif= or for the ball mif=. Hope this helped! RATE UP TO KEEP IT ALIVE!
themincraftkid 10 months ago 6
5:40 I think blit may be a play on letters of the C function BitBlt from windows api
74SteveG 10 months ago
@74SteveG my bad 5:11 my timing was off
74SteveG 10 months ago
what does pos stand for?
PurexOvvnage 11 months ago
@PurexOvvnage Possy???
HighTechPanda 11 months ago
@PurexOvvnage Position
VRCkid11 10 months ago
@PurexOvvnage position
DeathFrikinChikin 9 months ago
...why wont my bg.jpg load?
nick114245 11 months ago
@nick114245 same :(
themincraftkid 10 months ago
This has been flagged as spam show
@nick114245 Guy's i know how to get it to work!(the pic's) What you do is just put full details so like of me in was. For bg.jpg: C:\Users\Toby\Desktop\Python 2.6/bg.jpg. For the ball is was: C:\Users\Toby\Desktop\Python 2.6/ball.png. On windows 7 just click the arrow and is will change copy it and paste it in where is says: bif= or for the ball mif=. Hope this helped! RATE UP TO KEEP IT ALIVE!
themincraftkid 10 months ago
PICS WONT WORK!!!!! i was so excited to make a program to!
nick114245 11 months ago
This has been flagged as spam show
@nick114245 Guy's i know how to get it to work!(the pic's) What you do is just put full details so like of me in was. For bg.jpg: C:\Users\Toby\Desktop\Python 2.6/bg.jpg. For the ball is was: C:\Users\Toby\Desktop\Python 2.6/ball.png. On windows 7 just click the arrow and is will change copy it and paste it in where is says: bif= or for the ball mif=. Hope this helped! RATE UP TO KEEP IT ALIVE!
themincraftkid 10 months ago
Images didn't work for me.... :(
HighTechPanda 11 months ago
@HighTechPanda same... how do u get it to work!!, wait probably shouldn't be asking you...
nick114245 11 months ago
This has been flagged as spam show
@HighTechPanda Guy's i know how to get it to work!(the pic's) What you do is just put full details so like of me in was. For bg.jpg: C:\Users\Toby\Desktop\Python 2.6/bg.jpg. For the ball is was: C:\Users\Toby\Desktop\Python 2.6/ball.png. On windows 7 just click the arrow and is will change copy it and paste it in where is says: bif= or for the ball mif=. Hope this helped! RATE UP TO KEEP IT ALIVE!
themincraftkid 10 months ago
This has been flagged as spam show
@HighTechPanda Guy's i know how to get it to work!(the pic's) What you do is just put full details so like of me in was. For bg.jpg: C:\Users\Toby\Desktop\Python 2.6/bg.jpg. For the ball is was: C:\Users\Toby\Desktop\Python 2.6/ball.png. On windows 7 just click the arrow and is will change copy it and paste it in where is says: bif= or for the ball mif=. Hope this helped! RATE UP TO KEEP IT ALIVE!
themincraftkid 10 months ago
does this all work for mac?
cheeseitjn 11 months ago
The edges of my ball isnt transparent, any help please?
VietHuynhMate 11 months ago
@VietHuynhMate you have to make it transparent in gimp or something, so like layer, transparency, add or alpha or whatever it is. loop up crosshair tutorial or something that needs transperancy if you don't understand :)
OCoptimusconvoy 11 months ago
@OCoptimusconvoy Thanks a lot!
VietHuynhMate 11 months ago
@VietHuynhMate no prob!
OCoptimusconvoy 11 months ago
@VietHuynhMate remember to put convert_alpha or aelse it won't work
jeromsavestheworld 11 months ago
If you are wondering why he uses a "-=" when placing the cursor, here is an explanation of how -= works: lets say you have a statement that says "x -= y"... this can be re-written mathematically as "x = x - y"... or can be understood as "change the value of x by subtracting y from it"... he does the formula in his program to subtract half of the total hight (and width) from the actual cursor location (bottom right of object) to find the center. keep this comment alive if you found it helpful :)
greenguitar28 11 months ago 46
@greenguitar28 I have a question. Are you sure the cursor location is bottom right and not top left? Because, when I blitted the image right at x,y, it showed the mouse pointer at the top left of the image. Tad confused now.
urbanejack 5 months ago
@greenguitar28 also known as an augmented assignment operator
FutureComputing 5 months ago
hmm, i like, but this crap of indentation pisses me off. I rather the punctual way since there is less ways of causing errors, and indentations can sometimes decide not to indent to the position they did before.
gm3dgames 11 months ago
wont open my .jpg...redone this thing like 5 times......
robertaholea 1 year ago
it gives me an error and wich say that it couldn't open my bg.jpg
By the way nice videos!!!
321Caliente123 1 year ago
it says :unindent does not match any outer indentation level
can someone help plzzz
Thehimo2 1 year ago
blit is norwegian for "flash" which might have to do with this.
randomlyunknown2012 1 year ago
@randomlyunknown2012 nei nå lyger du "Blitz" er flash men blit er vel nereme became
lagemegnorsk 11 months ago
@lagemegnorsk I don't actually speak norwegian, I just looked it up, but did you say that blit also means became, or to become?
randomlyunknown2012 11 months ago
@randomlyunknown2012 It is preteritum for become
lagemegnorsk 11 months ago
It can't load my ball and bg images. . . What did I do wrong?
ImTheBatchMan 1 year ago
@ImTheBatchMan The images have to be in the same folder as your program.
FatalNova 1 year ago
@FatalNova they are
ImTheBatchMan 1 year ago
@ImTheBatchMan You maybe saved the pictures as something else than the program is looking for. If not, then I'd say re-do.
FatalNova 1 year ago
@ImTheBatchMan
lagemegnorsk 11 months ago
I did what you did and it didn't work...
SolidSulfur 1 year ago
I hear only Pie Game xD
idvhfd 1 year ago
Awesome! I looked at those lame tutorials which are linked ate pygame.org and they were all incomplete and amateurish. but ur ones are awesome!!! Thanks .
smatiscool1995 1 year ago
Nice man this is really helpfull
TheRedMoonProject 1 year ago
My computer can't find the images when I use bif="C:\Users\Name\Pictures\img.jpg" or when I put them in the same directory and just use bif="img.jpg"
Cycyryable 1 year ago
BLIT:
In computing, the Blit was a programmable bitmap graphics terminal designed by Rob Pike and Bart Locanthi Jr of Bell Labs in 1982.
Bit BLIT (which stands for bit-block [image] transfer but is pronounced bit blit) is a computer graphics operation in which several bitmaps are combined into one using a raster operator.
Here it is is this good eanugh?
Dexdix2 1 year ago
XD, it kept not working because of one stupid error.
It's always something stupid...always...
=Math
MathsVlog 1 year ago
How to make your edges transparent? Please heeeelp!!!
ajspingvin 1 year ago
@ajspingvin mouse_c=pygame.image.load([your image]) .convert_alpha()
alpha = transparency in webdesigning, liek here :)
XanthaPrograming 1 year ago
@XanthaPrograming Thanks... Okey. Dont know what to say anymore. Okey. Yay?
ajspingvin 1 year ago
@ajspingvin worked? :D
XanthaPrograming 1 year ago
@XanthaPrograming AAAAAAAAAAAAAAAAAAAAAAAARRRRRRRRRRRRRRRRRRRGGGGGGGGGGGGGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
YES!!! NOW I GOTTA GO POO! PEOPLE, I NEED PRIVACY, I NEED TO POO!
ajspingvin 1 year ago
@ajspingvin äh. ya? ;D
XanthaPrograming 1 year ago
@ajspingvin, transparency is a characteristic of the .png or .gif file. I used .gif instead of .png because Irfanview can make them.
Make a 32x32 .bmp file in Microsoft Paint, with a red circle. Make the circle touch the edges of the 32x32 square on all 4 sides, fill the circle with red, fill each corner with blue. Save as ball.bmp.
Open ball.bmp in Irfanview. Save As GIF, check "Show options dialog," check "Save transparent color" & choose "Choose transparent color during saving," then Save.
ncdave4life 1 year ago
@ncdave4life, BTW, if you don't already have Irfanview, then GET IT! It is awesome, and free. What's more, believe it or not, in an age when program sizes are measured in the hundreds of megabytes, the entire Irfanview program folder is less than 2 MB, total. Its Bosnian author, Irfan Skiljan, is an incredible software developer. (Sorry, Mac folks, it's for Windows only.)
Also BTW, don't worry about the fact that you're using a ball.gif file instead of a ball.png file. Both work fine.
ncdave4life 1 year ago
@ncdave4life OKEY!!! JUST STOP!!! I asked a question like a month ago and I figured it out and got help with another youtuber. No need to reply more.
ajspingvin 1 year ago
This has been flagged as spam show
don't know how this worked for him but when i ran this program i eventually ended up having to add an els: loop inside the for loop, just something to keep in mind im runing python 2.6 and the pygame is 1.9.1release-svn2575 in 32 bit sys on ubuntu
bmanzana13 1 year ago
lol mine kept crashing because i forgot a comma somewhere
Deadly699 1 year ago
this is very similar to PSPlua
super0393 1 year ago
Comment removed
super0393 1 year ago
make sure you save your game script in the same directory a the pictures. :P
therebels13 1 year ago
Doesnt the "/2" just divide the X and Y axis by 2 so the mouse will be perfectly in the middle of the edges of the image? Apples...
JumpingJoop95 1 year ago
it's ok i found the problem was not the code
Tayudoo 1 year ago
I having a problem in the line screen=pygame.display.set_mode((640,360),0,32)
my python program is 2.6 and the pygame is 1.9.1release-svn2575 in 32 bit
and i having problem with alpha section too.
Tayudoo 1 year ago
I having problem in the line screen=pygame.display.set_mode((640,360),0,32) is giving me a error
Tayudoo 1 year ago
i wanted to know what a good book for a person who is new completely new to game development that could help me learn how to do this and understand all this. is therea good book that starts from scratch
silentkilla238 1 year ago
I keep getting this:
@linux03:~$ python pg1.py
open /dev/sequencer or /dev/snd/seq: No such file or directory
The second line is the error message that is being thrown to me...
A window then appears that it totally black, and there is no image at all...
11889music 1 year ago
nvm i fixed it
mariomodguy 1 year ago
it gives me a syntax error where i say import pygame but when i tested it out on the python shell gui thingy it worked
mariomodguy 1 year ago
I did it!! After a two tedious hours of trying to get pygame to work and to find out how I actually open it. I haven't watched your python tutorials yet. I'm planning too, but right now I felt like making games. I have no idea why I am feeling so proud just from something so simple... Perhaps because I've tried "programming" before and never got it, and now I made someting without game maker or anything like that where everythings already done for ya, basically.
Naihatsu92 1 year ago
@Naihatsu92 awwwwwwww. im jusyt like you lol. forget learning the basics i wanna doo the cool stuff now.
MsKhadijahCamille 1 year ago
Anyone who is having problems with locals not importing like I did, make sure your program is named something OTHER than a module, such as pygame (which is what I did) If you name the file pygame.py, it will find that file first and never look for the actual pygame lol.
dagarath 1 year ago
A small reminder: Don't call your file pygame.py and save it in your Python folder. Python will try to import from your own file. I did this xD
stefanhyltoft 1 year ago
Comment removed
stefanhyltoft 1 year ago
Comment removed
stefanhyltoft 1 year ago
i kepp getting pygame.error: Couldn't open pic.jpg
selectguygl 1 year ago
@selectguygl
is the picture in the same folder as the program?
Corbenik 1 year ago
when i tried to preview it, it said "error: Couldn't open bg.jpg" please help
randOmazing 1 year ago
@randOmazing It either means that the background pic you made isnt in the same folder as your program or that you didnt make the picture
XAutomatedOwnerX 1 year ago
@XAutomatedOwnerX the pygame folder or python?
randOmazing 1 year ago
@XAutomatedOwnerX THANK YOU SO MUCH!!!
randOmazing 1 year ago
why did you put -= instead of just = ?
nathan8BIT 1 year ago
Comment removed
Jonte135 1 year ago
This has been flagged as spam show
What's The Purpose of life ?
Here you will get the answer :
islamtomorrow (DOT) com/purpose.htm
converts
converts-ahmd.blogspot (DOT) com/
((( Acquainted With Islam )))
aslam-ahmd.blogspot (DOT) com/
acquaintedwithislam.maktoobblog (DOT) com/
ahmd1431 1 year ago
Why do all these tutorials use older version of python >=(
I tried downloading 2.6.1 and it always gave me a download error. Does anyone have a 3.1 tutorial?
Bethefisher 1 year ago