Jump to content
  • Advertisement
Sign in to follow this  
  • entries
    3
  • comments
    5
  • views
    1697

Entries in this blog

 

My town is famous!

I was watching this movie a few days ago called "Harold and Kumar go to White Castle". This is a very hilarious movie and I suggest to all of you to watch it. Anyway, the movie supposedly took place in Hoboken, New Jersey.

The movie is about these two guys who get stoned and see a commercial for White Castle and want it since it is "the perfect meal". They go all over Jersey, including New Brunswick (my friend goes to school there) and they end up at the White Castle in Cherry Hill (my town). But there are a few problems with this movie:


They show mountains in what is supposedly Cherry Hill, yet I have never seen a mountain in my town (not even a hill, ironically).
They show a lot of farm land. This might've been true about Cherry Hill 60 years ago when my town was all farm land. But everything is developed now, so there is no farm land (except Barclay Farm which is a historical farm, meaning no current farming going on).
Probably the biggest problem is the fact that there is no White Castle in Cherry Hill. None.



This was a very good movie, though, even with these problems I pointed out. They are not really problems. I just wanted to fill up a journal entry. If you are going to see the movie, make sure to get the Unrated DVD edition. You will absolutely love it, I guarantee it. So long for now.


--robpers2003

robpers2003

robpers2003

 

First Post EVER!!!!!!!!!!!

Hello everyone and welcome to my world. This is my first entry on my journal. I do want to talk about a few things I am working on. Lets start.


Game Engine Development

Well, I have been working on a 2D DirectX game engine. So far it is looking pretty good. I did have one problem with it. I created the engine in a C++ class and that made it difficult for many reasons to actually use the engine.

My goal in this engine is to have the user of the engine not have to worry about DirectX code. All they would have to do is just include the header file of the game engine and start coding. I remade the engine so it wouldn't use C++ classes. Instead it uses C style functions such as the #define and many other things. I have not released the engine to the public yet, because I am still adding things to it. I am thinking, though, about putting up some articles on GameDev.net on how I created the engine. I think that would be pretty cool. Let me now show you a bit of how easy it is to use this game engine of mine.

First, after you added the game engine files to your project (I used Visual C++ .Net 2003 for my projects), you add a source file and include the header "lage.h" at the top of the source file. There are three main functions you have to use here:


void GameInit()
void GameLoop()
void GameEnd()


The GameInit() function is for when the game or program first starts. It is only called once. In here is where you initialize the Game Engine and load up your resources, such as sprites and backgrounds (more on that later).

The GameLoop() function is where the meat of your code goes. This function is constantly called.

The GameEnd() function is where you release the resources you loaded up in the GameInit() function. I made this process especially easy so I know I released my images right.


Game Initialization and Resource loading

To initialize DirectX and set up the window, you would use this function I created in the GameInit() function to do that:

int InitD3D(int width, int height, bool fullscreen);

This function takes as parameters the width and the height of the window. The last parameter is a boolean value determining whether the application is run full-screen or windowed. "true" means fullscreen and "false" means windowed. I believe you would be able to run this application with only the InitD3D() function. All you would see is a black screen, but it is a DirectX app.

To load images, I defined two DirectX variables and gave them a new name. For instance, LPDIRECT3DSURFACE9 can be called by the variable name SURFACE. The second variable was LPDIRECT3DTEXTURE9, but I later defined it as SPRITE. You should declare the image variables globally. Here is an example:

SURFACE background;


SPRITE sprite1;


SURFACE will mainly be used for just backgrounds. The SPRITE though is obviously going to be used for sprites with support for transparency.

In the GameInit() function, here is an example of how you would load up a SURFACE and a SPRITE:

void GameInit()


{


InitD3D(640,480,true);


background = LoadBmp("background.bmp");


sprite1 = LoadSprite("sprite1.bmp",255,0,255);


}

The LoadBmp() function is only used for surfaces and takes as a parameter the filename. The LoadSprite() function is only used to load sprites and takes as parameters the filename and the RGB color value for transparency. In the example above I used RGB(255, 0, 255) which is a sort of pink color for transparency.

Well, my hands are getting tired now. Most likely in the next post I will show you how I would draw the sprites and the background. I also want to put updates on my game projects here. So till next time, have an excellent day. Bye bye.

--robpers2003 (http://www.liveartsnet.com).

robpers2003

robpers2003

Sign in to follow this  
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!