Space Miner my first project

Post screenshots, binaries and projectfiles of the projects you have made with ZGE that you want to share!

Moderator: Moderators

Post Reply
Saint Lazarus
Posts: 3
Joined: Sat Apr 04, 2009 5:02 am

Space Miner my first project

Post by Saint Lazarus »

I wanna call it a side scroller but it goes from top to bottom! so iunno

anyway its pretty simple, you're a spaceship collecting Ore (little golden balls) collect them while avoiding the asteroids

use mouse to control it.




I know theres alot of ways improve it but it plays pretty smoothly at least :D


Couple of observations, the collision detection is pretty basic, could I make the collision field change to follow the rotation of indivual asteroids?


I couldnt make the player ship texture transparent and it has an ugly black rectangle around it ><

im sure im missing some basic command/setting but cant find it! is there an option?


I should probably make a different thread for questions actually so I'll save the rest lol, anyway enjoy I guess

and be gentle its my first attempt!


EDIT: I just seen turshija's spacer game now (need app.deltatime help thread), errily similar lol, 2 years apart aswell, guess its just an obvious starting point?, the differences are cool too
Attachments
Space Miner.zip
exe and source code
(218.02 KiB) Downloaded 617 times
User avatar
Kjell
Posts: 1876
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hello,

To make your ship texture "transparent" ( the correct term would be to "mask" your texture ) you need to do two things. The first is to either add a alpha channel in the bitmap ( using Photoshop / GIMP / etc ) or ( since your ship doesn't have any black pixels in it ) you could set the "Transparency" property of "BitmapFromFile" component of your Ship Bitmap to "BlackColor". The other thing you need to do is to set the Blend property of the Material ( "ShipMat" ) that uses the Texture to for example "Alpha/OneMinusSourceAlpha".

Additional note, instead of using a BoxMesh to render your Ship Texture on, you could just use a RenderSprite Component.

Concerning collisions, the only collision style currently implemented in ZGE that supports rotation is the "Rect2D_BB" style. This is basically a 2D rectangle that can be rotated over the Z Axis. Alternatively you could use the Sphere3D style since your Astroids are kind of round-ish.

Additional note, ideally you would want to use the Astroid Mesh as the Collision Model obviously .. but again, this collision style is not supported yet.

Good luck ~
K
Saint Lazarus
Posts: 3
Joined: Sat Apr 04, 2009 5:02 am

Post by Saint Lazarus »

Kjell wrote:Hello,

To make your ship texture "transparent" ( the correct term would be to "mask" your texture ) you need to do two things. The first is to either add a alpha channel in the bitmap ( using Photoshop / GIMP / etc ) or ( since your ship doesn't have any black pixels in it ) you could set the "Transparency" property of "BitmapFromFile" component of your Ship Bitmap to "BlackColor". The other thing you need to do is to set the Blend property of the Material ( "ShipMat" ) that uses the Texture to for example "Alpha/OneMinusSourceAlpha".

Additional note, instead of using a BoxMesh to render your Ship Texture on, you could just use a RenderSprite Component.

Concerning collisions, the only collision style currently implemented in ZGE that supports rotation is the "Rect2D_BB" style. This is basically a 2D rectangle that can be rotated over the Z Axis. Alternatively you could use the Sphere3D style since your Astroids are kind of round-ish.

Additional note, ideally you would want to use the Astroid Mesh as the Collision Model obviously .. but again, this collision style is not supported yet.

Good luck ~
K

Thankies for the help!


I'll try polish this game off before I start a new one thats less messy/more structured
Post Reply