Need some help in my game. (can close this now)
- Joakim Christiansen
- Addict
- Posts: 2452
- Joined: Wed Dec 22, 2004 4:12 pm
- Location: Norway
- Contact:
Need some help in my game. (can close this now)
http://www.myhome.no/joakims_gamemaker_page/Game.zip
When i load a background the player sprite gets white, just run it and you will see.
Can someone help me with this? (i'm a noob)
Edit:
Is it also best if i free the sprites and sounds (resources) when i end the game?
When i load a background the player sprite gets white, just run it and you will see.
Can someone help me with this? (i'm a noob)
Edit:
Is it also best if i free the sprites and sounds (resources) when i end the game?
Last edited by Joakim Christiansen on Tue Jan 11, 2005 8:44 pm, edited 3 times in total.
- Joakim Christiansen
- Addict
- Posts: 2452
- Joined: Wed Dec 22, 2004 4:12 pm
- Location: Norway
- Contact:
- Joakim Christiansen
- Addict
- Posts: 2452
- Joined: Wed Dec 22, 2004 4:12 pm
- Location: Norway
- Contact:
CreateSprite3D(spr_player, spr_player)Paul wrote:So you see your error now?
I must make that global?
Code: Select all
Global spr_player3d
;Sounds
LoadSound(snd_shoot, "data\sounds\shoot.wav")
;Sprites
LoadSprite(spr_player, "data\sprites\player.bmp", #PB_Sprite_Texture)
CreateSprite3D(spr_player3d, spr_player)
TransparentSpriteColor(spr_player, 255, 255, 255)
LoadSprite(spr_background, "data\images\background.bmp")
Here is your updated file...
http://www.reelmedia.org/test/gm.zip
You have not defined spr_player or spr_background so the are both 0. Sprites must have unique numbers, they cannot share. Personally I would make then constants since they never change anyway and then you don't have to worry about making them global. (see update file)
Also, for the least amount of problems, use pure black as your transparent color. TransparentSpriteColor() is not reliable.
http://www.reelmedia.org/test/gm.zip
You have not defined spr_player or spr_background so the are both 0. Sprites must have unique numbers, they cannot share. Personally I would make then constants since they never change anyway and then you don't have to worry about making them global. (see update file)
Also, for the least amount of problems, use pure black as your transparent color. TransparentSpriteColor() is not reliable.
- Joakim Christiansen
- Addict
- Posts: 2452
- Joined: Wed Dec 22, 2004 4:12 pm
- Location: Norway
- Contact:
- Joakim Christiansen
- Addict
- Posts: 2452
- Joined: Wed Dec 22, 2004 4:12 pm
- Location: Norway
- Contact:
-
- User
- Posts: 64
- Joined: Mon Jun 30, 2003 5:36 pm
- Location: Michigan
- Contact:
Can you please expand on this? I'm working on a project with a lot of graphics and I've been using hot-pink (255,0,255) as transparent. Am I going to have "pink background" problems on some systems?Paul wrote:Also, for the least amount of problems, use pure black as your transparent color. TransparentSpriteColor() is not reliable.
Matthew
From my personal experiences... YES
The only color I have never had problems with is the default transparency (0,0,0) pure black.
I prefer using pure black anyways... I make my graphics on a layer in Photoshop. When done, I raise the output level of that layer by 10, set the background layer as 0,0,0 and then save. Works great!
The only color I have never had problems with is the default transparency (0,0,0) pure black.
I prefer using pure black anyways... I make my graphics on a layer in Photoshop. When done, I raise the output level of that layer by 10, set the background layer as 0,0,0 and then save. Works great!
