Archive for October, 2010

8WeekGame – Competition 2 – 3D Collisions – Oh My….

 

 

 

 

Right, i have a week off this week to:

 

1) Code lots

2) But a Windows Phone 7 HTC HD7

3) Fable 3 of course…..

 

The “Code Lots” statement  couldnt ring more true. Im now doing to move onto 3D Collisions. I have an asteroid and ship model loaded, and i was going to move onto spawning lots of asteroids that moved in random directions, but i thought i would do the hardest part first – 3D Collisions! Now the recently launched App Hub (AKA Creators Club), has a particular sample im interested in here. This sample displays the 3D models name when the players cursor is crossing the models BoundingSpere.

 

Now in 2D games, the basic theory of collisions (Per Pixel or Intersection), is that if two objects (Say a PLayer and Enemy) share the same screen space (Your preference on how much should be specified as a “Collision”) or intersects a bounding oject (usually a rectangle) – then a collision is detected and you perform your own game logic depending on what you want to do (Like a player loosing a life if it hits an Enemy). Screen space is made up of X & Y coordinates of the screen and XNA uses the Right Handed Cartesian Coordinates:

 

 

 

Its little different in 3D, because you are dealing with World Space, which is the area of the game that is used to determine where to render your models. And models are composed of lots of Triangles within a 3D coordinate syste, ie the Z coordinate (X,Y,Z), in terms of the depth. What the sample from the App Hub teaches you is to convert the World Space of the models to screen space (Top left of the screen to bottom right), and check a BoundingSphere intersect between two objects. This is how ive intrepreted it, but please tell me if im wrong!

SO thats what im doing today!  Good luck to me! Hopefully once this is done i can build my HUD for lives and start to actually build some game play, because at the moment ive just been experimenting with ideas.

 

 

 

 

 

3D coordinate system
Image via Wikipedia

 

Enhanced by Zemanta

8WeekGame – Competition 2 – 3D Model Loaded….Just!

The game im doing is a 2D sidescrolling space shooter, with 3D Models. Im using free models from Turbosquid, and to be fair, there are not alot of free ones, and the one i wanted, i couldnt get the textures to load, so it just looked black:

As you can see, in the blackness of space, no one can hear (or see) you scream. So i decided to to change the model to something else, and what do you know, it works! All i changed was the model name i was loading to the Model class in XNA, so the original ship1.X file must of been corrupt somewhere. All i know is this 3D malark is stressful!

Now i need a fixed orthogonal view, then move onto the movement of the ship!  Anyway, here is a quick but boring vid:

Enhanced by Zemanta

8WeekGame – Competition 2 – Starts Today!

Its finally started! For 8 Weeks me, Shaw and Martin will be fighting it out to see who can make the best XNA game, the only brief, side scrolling + 1 playable level (Yes Gareth, playable!). Unfortunately our matey Paul Ledger has pulled out for being too overworked, “All Work, NO Play….” and all that!

Anyway we will be posting more information on our games and our progress on the offical 8WeekGame website, so please check there. I will be posting here also, so please stop by! Once the 8Weeks are up, the games will be downloadable on the 8WeekGame website and playable on PCs.
This will be my last 8WeekGame as a competitor. I want to actually release a Xbox Live Indie Game (XBLIG) using Creators Club membership,  so i wont have the time to competite in the 3rd comp. I will though be hoping to create a whole new website to be released Feb 2011, when the next competition starts, which will hopefully allow other members of the public to sign up and participate. Watch this space on that one….

Microsoft XNA
Image via Wikipedia
Enhanced by Zemanta