Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: pygame.surface
Post: RE: pygame.surface
I read somewhere that programming with Python was easy!
Glad I'm not here on my own or computer would be in canal!
Traceback (most recent call last):
File "C:\Users\anybl\Python_Progs\shapes\Shapes.... |
|
Graham |
Game Development |
10 |
8,500 |
Nov-29-2018, 03:57 PM |
|
|
Thread: pygame.surface
Post: RE: pygame.surface
Still the same problem
Traceback (most recent call last):
File "C:\Users\anybl\Python_Progs\shapes\Shapes.py", line 143, in <module>
screen.blit(star_images, (starX, starY))# Place star on... |
|
Graham |
Game Development |
10 |
8,500 |
Nov-29-2018, 03:20 PM |
|
|
Thread: pygame.surface
Post: RE: pygame.surface
Windspar, thanks for the help.
The error code I get now is
Traceback (most recent call last):
File "C:\Users\anybl\Python_Progs\shapes\Shapes.py", line 41, in <module>
image = pygame.load(... |
|
Graham |
Game Development |
10 |
8,500 |
Nov-29-2018, 09:13 AM |
|
|
Thread: Directory path EOF
Post: RE: Directory path EOF
|
Graham |
General Coding Help |
8 |
4,700 |
Nov-28-2018, 10:13 PM |
|
|
Thread: pygame.surface
Post: RE: pygame.surface
Thanks windspar,
The
startPosX = list(range(50, 450, 50))worked.
But can't get the starpath to work.
This is fine a star falls from top of screen to bottom
starColor = pygame.image.load('purple_star.... |
|
Graham |
Game Development |
10 |
8,500 |
Nov-28-2018, 05:39 PM |
|
|
Thread: pygame.surface
Post: pygame.surface
The idea is that stars fall from top of screen to bottom.
I have this
starPosX = [50,100,200,300,400]
starPosY = [-10,-20,-40,-500]
imagelist = [filename for filename in cd.iterdir() if filename.suffi... |
|
Graham |
Game Development |
10 |
8,500 |
Nov-28-2018, 12:52 PM |
|
|
Thread: Directory path EOF
Post: RE: Directory path EOF
Larz,
Thanks very much for helping me to understand Python a little bit more, as I said in previous post I don't really need any other extension other than .png but the code is now there for future us... |
|
Graham |
General Coding Help |
8 |
4,700 |
Nov-28-2018, 09:47 AM |
|
|
Thread: Directory path EOF
Post: RE: Directory path EOF
Thanks Larz,
Here's what I ended up with
import os
for file in os.listdir("C:/users/anybl/python_progs/shapes/"):
if file.endswith(".png") or file.endswith(".jpg") or file.endswith(".jpeg"):
... |
|
Graham |
General Coding Help |
8 |
4,700 |
Nov-28-2018, 09:17 AM |
|
|
Thread: Directory path EOF
Post: RE: Directory path EOF
Thanks Larz
I had already tried that, the reason it didn't work for me was that I had the path wrong didn't realise that windows truncated username.
So changed the path and ran the program again with ... |
|
Graham |
General Coding Help |
8 |
4,700 |
Nov-28-2018, 08:18 AM |
|
|
Thread: Directory path EOF
Post: Directory path EOF
I just want to get a list of images in a directory trying this
from PIL import Image
import os, os.path
imgs = []
path = "C:\Users\me\pictures"
valid_images = [".jpg",".gif",".png",".tga"]
for f in o... |
|
Graham |
General Coding Help |
8 |
4,700 |
Nov-27-2018, 11:33 PM |
|
|
Thread: print
Post: RE: print
Thanks for that, should have spotted it, open 3, close 3 |
|
Graham |
General Coding Help |
2 |
2,490 |
Nov-26-2018, 05:33 PM |
|
|
Thread: print
Post: print
Trying this
from PIL import Image
import os, os.path
imgs = []
path = "c/users/anybloodyid/pictures/"
valid_images = [".jpg",".gif",".png",".tga"]
for f in os.listdir(path):
ext = os.path.splitex... |
|
Graham |
General Coding Help |
2 |
2,490 |
Nov-26-2018, 01:30 PM |
|
|
Thread: x_offset
Post: RE: x_offset
Thanks for the reply, when I ran the code I got the error message
Traceback (most recent call last):
File "shapes.py", line 46, in <module>
pg.draw.line(self.screen, pg.Color("red"), start... |
|
Graham |
Game Development |
2 |
3,030 |
Nov-22-2018, 08:49 AM |
|
|
Thread: x_offset
Post: x_offset
Hi All,
I am just starting with Python/pygame and am playing around with shapes.
I am trying to get some lines on screen as below (not dotted)
-----------------
---------------
------------
---------
... |
|
Graham |
Game Development |
2 |
3,030 |
Nov-21-2018, 03:00 PM |