wyrd Posted March 13, 2004 Posted March 13, 2004 I've already made a minor class library that helped when it came to getting a game up and running ASAP. Unfortunately, I constrained it too much for my own needs, and it wasn't generic enough for others to use without making their own modifications. I've decided to correct this. I'm making a new class library for gamers, that will make game programming a snap (well, let's hope). C# already makes it easier, but I want to make it even easier. For this to happen, I need help. I need people to help me test what I already have, provide feedback (can I make something easier, is it missing something, etc) and what-have-you. Right now, I have the basic functionalities finished; Pheonix.Game namespace - GameBase, Rand, Timer. Pheonix.Graphics namespace - Display, Sprite. Pheonix.Input namespace - Mouse, Keyboard. Each class not only makes it easy to get a game up and running, but still allows you full access to the DX objects. I plan on adding a full AI namespace and Scripting namespace, that way you can get bots up and running in no time. Also, a windowing system will be provided as well (all games have windows, you know?). And of course, a Sound namespace will eventually be provided. Creating a game is literally a snap; 1. Create an empty project. 2. Reference Pheonix and DirectX libraries. 3. Create a file called Game.cs. 4. Copy the below template into the Game.cs file. 5. Fill in the code where appropriate. 6. Set Game.cs as your start-up project. Basically what you're doing is inheriting the GameBase class, which handles everything from accessing game input to performing your game loop. All you have to do is worry about handling game logic and drawing graphics. Game template; using System; using System.Windows.Forms; using Pheonix.Game; using Pheonix.Graphics; using Pheonix.Input; using Microsoft.DirectX.DirectDraw; using Microsoft.DirectX.DirectInput; using System.Drawing; public class Game : GameBase { [sTAThread] static void Main() { // In this template, we're using a form as the game window. You can use ANY control you want. Form window = new Form(); window.WindowState = FormWindowState.Normal; window.FormBorderStyle = FormBorderStyle.None; window.Show(); // Start the game. Game game = new Game(); game.Start(window); // Cleanup. game.Dispose(); frm.Dispose(); } override protected void Initialize(Display display) { // Initialize graphics and game here. } override protected void ProcessInput(Pheonix.Input.Keyboard.State keyState, Pheonix.Input.Mouse.State mouseState) { // Process game input. In this case the game ends upon hitting escape. if (keyState[Key.Escape]) { this.End(); } } override protected void UpdateLogic(float frameTime) { // Update all game logic here. } override protected void DrawGraphics(Surface backbuffer, Control window) { // Draw all graphics here. In this case we're simply clearing the screen over and over again. backbuffer.ColorFill(Color.Brown); } override protected void Closing() { // Cleanup all resources here. } } Pheonix.zip Quote Gamer extraordinaire. Programmer wannabe.
wyrd Posted March 13, 2004 Author Posted March 13, 2004 Some more notes... You can access any of the protected members of GameBase at any time. For convenience, and to make things easier for those who are new, it passes them to the paremeters where they are required. _display, _timer, _mouse, _keyboard, and _window. Creating & Destroying Surfaces; // GameBase passes the display as a parameter via Initialize() method. Surface surface = _display.CreateSurface("sprite.bmp"); surface.Dispose(); Creating & Destroying Sprites; Sprite sprite = new Sprite(_display.CreateSurface("sprite.bmp"); sprite.FrameSize = new Size(32, 32); sprite.SetTransparency(0x00RRGGBB); sprite.Dispose(); Drawing Sprites; // GameBase passes the backbuffer as a paremeter via DrawGraphics() method. backbuffer.DrawFast(x, y, sprite.Surface, sprite.Area(0), DrawFastFlags.DoNotWait | DrawFastFlags.SourceColorKey); Quote Gamer extraordinaire. Programmer wannabe.
rifter1818 Posted March 13, 2004 Posted March 13, 2004 Im Doing a simular thing with D3D So far there is still allot being fixed however, i have made initialising and manipulating a 3d world easyer, Vertex Buffer controls are now easyer, Along with Static and Animated (Tweening) meshs, and Some Animating Vertex Buffer code, Once it gets to a workable level i may post the DLL here, with of course usual rules use for your projects anything that will be marketed youll need to contact me for... same old same old.. Quote
ThePentiumGuy Posted March 13, 2004 Posted March 13, 2004 wyrd: you should check out DirectXTools and GameTools in http://www.createdbyx.com/ maybe you could refer to that for some examples, hope that helps, pent Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
wyrd Posted March 17, 2004 Author Posted March 17, 2004 (edited) I made several design changes and enhancements. New updates attached. Documentation: http://www.danpeverill.com/pheonix/doc/Pheonix.zip Edited March 17, 2004 by wyrd Quote Gamer extraordinaire. Programmer wannabe.
Kavan Posted March 18, 2004 Posted March 18, 2004 Speaking of game engines you can check Artificial Heart at http://www.3dlevel.com/artificialheart.php. Quote
wyrd Posted March 22, 2004 Author Posted March 22, 2004 Major update and design changes. :) The library is now D3D, and also provides easy-to-use classes for 2D. Hopefully it'll provide an easier method for those looking to do 2D in D3D. Also, all input is now done through multithreading (as opposed to polling), and is provided via a callback function (delegate). Documentation; http://www.danpeverill.com/phoenix/doc/ Latest source & test proj (shows a sprite rotating and moving around); http://www.danpeverill.com/phoenix/dl/Phoenix.zip The following classes are finished; Phoenix.Game - GameBase, Rand, Timer Phoenix.Graphics - Display, Graphic, SpriteEx Phoenix.Input - Keyboard, Mouse, DeviceBase Quote Gamer extraordinaire. Programmer wannabe.
RobyDx Posted March 22, 2004 Posted March 22, 2004 Also I've started to write a 3D graphics engine oriented on vertex and pixel shader 2.0. My graphics engine is called Enginet Is at first fase of development but support: lightmap stencil shadows device lost management vertex shader tweening animation lens flare fire noise 3D collision detection skin mesh animation raylight detection bump sky input and audio interface (in future also network interface). 2 tools for assemblies level and animation It has one defect: is documented in Italian. If you want to help me to debug the first version I'll thank. You can find it on my website robydx.altervista.org in section project enginet. I need debbuger help to accellerate the development of it. Quote Come to visit
*Experts* Nerseus Posted March 22, 2004 *Experts* Posted March 22, 2004 Not sure if this will help, but just found this site. Might help with DirectX if you need it... By the way, you spelled Phoenix as "Pheonix" in your first post. Might distract those just reading the thread for the first time. -Nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
wyrd Posted March 22, 2004 Author Posted March 22, 2004 Yeah I fixed the spelling already. :) Thanks though. Quote Gamer extraordinaire. Programmer wannabe.
Illusion Posted September 6, 2004 Posted September 6, 2004 Hi Your website isn't working.. just thought I would let you know. As I wanted to get the new update.. Quote
Mykre Posted September 6, 2004 Posted September 6, 2004 Hi Your website isn't working.. just thought I would let you know. As I wanted to get the new update.. I saw the same thing, Is the project still being worked on ? Quote Glenn "Mykre" Wilson, DirectX MVP Inner Realm Managed DirectX and Game Programming Resources
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.