Latest Uploads
Platdude Spotting

Jayenkai

Nom nom nom

Jayenkai

Rainbow Trout

Pakz

King Salmon

Pakz

Snooker

Jayenkai

You've ... o have you

Jayenkai

Forum Home

Python Sprites

UserMessage
Posted : Wednesday, 29 April 2015, 08:18 | Permalink
Hotshot


I got myself Raspberry pi 2 and just need 32GB Mirco SD Card

I will be learning about Sprites on the screen then moving round

I learn from this one http://programarcadegames.com/

There is one things that I am stump on is that when I create folder where my code and images in the same folder. It always keep getting error saying it cant find my image!

for example

I decide have know name like background image instead of calling saturnfamily1.jpg!

background_image = pygame.image.load("background.jpg").convert()

What wrong with this one above!?
Posted : Wednesday, 29 April 2015, 08:21 | Permalink
Jayenkai


WW Entries : 106
Is the compiler compiling to the same folder? And if not, does it copy the .jog image to the right folder?

-----
"Load, Next List!"
Homepage : http://AGameAWeek.com
Posted : Wednesday, 29 April 2015, 09:07 | Permalink
Hotshot


Is the compiler compiling to the same folder? Yes
does it copy the .jog image to the right folder? they all are in the same folder....

I think the reason why it got error is because I think the images is too big. The window I put is 800 x 600 where the images is 959 x 732.

I trying to resize the image in grafx2 but I cant seem find any icons that can resize the image!

I going have look gimp if they do it
Posted : Wednesday, 29 April 2015, 09:57 | Permalink
Hotshot


I have try Gimp 2.8 but graphics files is awful as they only save as

XCF Image files!

That suck!

I have notice you can do export files which is good...

I going post the code shortly
Posted : Wednesday, 29 April 2015, 10:01 | Permalink
Jayenkai


WW Entries : 106
Nah, Gimp's better than that. Change the filetype in the file selector.

-----
"Load, Next List!"
Homepage : http://AGameAWeek.com
Posted : Wednesday, 29 April 2015, 10:13 | Permalink
Hotshot


-->

I dont see anythings wrong with the code and graphics, sound, code all in the same folder but still get errors like

Traceback (most recent call last):
File "/home/pi/My Python/Game.py", line 25, in <module>
backgroundimage = pygame.image.load("background.png")
pygame.error: Couldn't open background.png
Posted : Wednesday, 29 April 2015, 10:15 | Permalink
Jayenkai


WW Entries : 106
Im sorry, I honestly can't hazard a guess at what the issue might be. This is one of those "have to be there" issues.

-----
"Load, Next List!"
Homepage : http://AGameAWeek.com
Posted : Wednesday, 29 April 2015, 10:24 | Permalink
Hotshot


FInally got Images on screen !

I used Jpg for background and png for player

I think PNG is better where JPG is image can sometime be blur....
Posted : Wednesday, 29 April 2015, 11:45 | Permalink
rockford


WW Entries : 3
If it's not the path, perhaps it was the case sensitivity of the image's name. Some languages and OSs require specific and exact case matching. Perhaps you tried to load "fred.png" but the file was called "fred.PNG"
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 672|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Latest Posts
Jeremy Bloody Kyle
steve_ancell Mon 09:45
GamerBlock
Jayenkai Mon 09:06
Laptop Aaargh...
Jayenkai Mon 07:06
Changing Thumbnail Sizes
Jayenkai Mon 05:27
Technology on Planes
therevillsgames Sat 17:00
London Car/Stab Incident
steve_ancell Sat 12:10
A New Korg Gadget!
Jayenkai Sat 04:53
Happy Birthday, Spinal
Jayenkai Fri 08:40
Watch Switch - Fitbit Blaze
rockford Fri 03:52
Happy Birthday Evil Roy Ferguson
rockford Wed 16:21
More

Latest Items
Blog : My Arduino experience.
steve_ancell Fri 13:45
Snippet : Skylines
spinal Fri 06:13
Showcase : Infinitron
rychan Tue 03:02
Dev-Diary : PS2 to N64 Adapter
spinal Sun 10:49
Link : Vector Tutorials/Help page.
Pakz Thu 23:00
Blog : mini project
spinal Sun 10:13
Showcase : Blockman Returns
Jayenkai Fri 03:04
Snippet : Wall Tracing on Random Maps (rpg)
rskgames Wed 22:48
Snippet : Path Following
Pakz Mon 16:25
Snippet : Flowers (Jan 2017)
Kuron Thu 01:13
Showcase : Clusters of Hex
therevillsgames Mon 15:01
Article : Maths 101 - Episode 1: Basic Trigonometry
shroom_monk Sun 14:07
Article : Maths 101 - Episode 5: Line Intersection
shroom_monk Sun 14:02
Dev-Diary : Normals and Dot products
Pakz Sat 20:37
Pets : Molly On The Couch
Jayenkai Thu 04:32
More

Who's Online
Jayenkai
Tue, at 00:11
rskgames
Mon, at 22:25
9572AD
Mon, at 20:48
Evil Roy Ferguson
Mon, at 17:56
steve_ancell
Mon, at 17:22
zzoom
Mon, at 16:39
Pakz
Mon, at 14:26
spinal
Mon, at 14:18
Afr0
Mon, at 13:08
shroom_monk
Mon, at 12:43
Link to this page
Site : Jayenkai 2006-Infinity | MudChat's origins, BBCode's former life, Image Scaler.