Game Dev Forum
September 10, 2010, 09:48:25 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Beginning Game Programming 3E is a complete rewrite with all new source code--a good starting point for anyone wanting to learn DirectX.
 
   Home   Help Media Login Register  
Pages: [1] 2 3 4 5 6 ... 10
 1 
 on: Today at 06:47:47 AM 
Started by Pilgrim - Last post by Pilgrim
I made a simple modification to the dynamic_scroll code so I could scroll the map in all directions, and in trying to further edit it, I have found I am having a difficult time getting away from having the controller affect the speed of the scrolling.

in this section, the line  DWORD result = XInputGetState( i, &state );  seems to be what actually controls the speed.

Code:
    //update controllers
    for (int i=0; i< 4; i++ )
    {
        ZeroMemory( &controllers[i], sizeof(XINPUT_STATE) );

        //get the state of the controller
      XINPUT_STATE state;
      DWORD result = XInputGetState( i, &state );

        //store state in global controllers array
        if (result == 0) controllers[i] = state.Gamepad;
    }

and if I try to completely comment out any reference to controllers at all, it will only jump to the far side in any direction, rather than scroll, unless I don't touch

           XINPUT_STATE state;
 -->     DWORD result = XInputGetState( i, &state );

I can just set i as 0, but why if I want to get away from this, and make it so that the speed is just by using SpeedX or SpeedY.

Like I said, i did try removing the controller code all together to get this working a little better.  Just can't figure out why it causes the scroller to jump from one far side of the map to the other so fast with the speed set at +=1 or -+1.

Thanks, and have a good weekend.

 2 
 on: Yesterday at 11:59:37 AM 
Started by DARKER - Last post by DARKER
I found that is deforming also vertically with some periodical repeating. See picture.

Yes, it's VB2010, this case was drawn by:

Dim TxtFormat As DrawTextFormat = DrawTextFormat.Left Or DrawTextFormat.Top Or DrawTextFormat.SingleLine Or DrawTextFormat.NoClip
fntText.DrawText(sprText, "my text", New Drawing.Rectangle(5, 100, 0, 0), TxtFormat, Color.ForestGreen)

Maybe some Video card behavior ? (compressing textures, quality, driver settings etc ?)

 3 
 on: September 08, 2010, 07:46:55 AM 
Started by Valentin - Last post by Valentin
This is how i implemented it:
Code:
bool game_init(HWND)
{
srand(time(NULL));

g_lighting = new New::CShaderLight( );
g_lighting->setAmbient( Color( 100, 0, 0, 100 ) );

g_lighting->newMaterial( "default" )
->enable( )
->setSheen( 64 )
->setAmbient( Color( 10, 0, 0, 100 ) )
->setDiffuse( Color( 255, 255, 255, 255 ) )
->setEmissive( Color( 255, 0, 0, 255 ) )
->setSpecular( Color( 100, 100, 255, 255 ) );

g_lighting->newLight( "Yellow Light" )
->enable( )
->setPos( Vector3( 0, 100, -100 ) )
->setDiffuse( Color( 255, 255, 0, 255 ) )
->setAmbient( Color( 255, 255, 0, 255 ) )
->setSpecular(Color( 255, 255, 0, 255 ) )
->setRadius( 150 );

g_lighting->newLight( "Red Light" )
->enable( )
->setPos( Vector3( 0, 100, -50 ) )
->setDiffuse( Color( 255, 0, 0, 255 ) )
->setAmbient( Color( 255, 0, 0, 255 ) )
->setSpecular(Color( 255, 0, 0, 255 ) )
->setRadius( 150 );

g_lighting->newLight( "Blue Light" )
->enable( )
->setPos( Vector3( 0, 100, -150 ) )
->setDiffuse( Color( 0, 0, 255, 255 ) )
->setAmbient( Color( 0, 0, 255, 255 ) )
->setSpecular(Color( 255, 255, 255, 255 ) )
->setRadius( 150 );

//Create the asteroid
mesh = new Mesh( );
mesh->Load( "AST_02.X", true );
g_lighting->addMesh( mesh );

//Create camera
camera = new Camera();
    camera->setPosition(0.0f, 5.0f, 130.0f);
    camera->setTarget(0.0f, 0.0f, 0.0f);
    camera->Update();
g_lighting->setCamera( camera ); //supply for matrices

    return true;
}

void game_render3d()
{
mesh->Rotate( 0.15f, 0.0f, 0.0f );
mesh->Transform( );
g_lighting->render( );
}

void game_update(float deltaTime)
{
mesh->Update( deltaTime );
g_lighting->update( );
}

As you can see it is really easy to use Cheesy
Don't let octane die!
Screenshots when i got shadow maps done
If anyone wants this send me a message



 4 
 on: September 07, 2010, 03:42:33 PM 
Started by vguniverse - Last post by vguniverse
The program won't intialize.Everytime I run it in debug mode the screen will come up and shortly after I get the "Error initializing the game" message box that I programmed.

 5 
 on: September 07, 2010, 09:56:06 AM 
Started by Shikamu - Last post by Shikamu
Hello again,

I was just doing the exercise 2 in the above mentioned chapter, and there's a behaviour that I was not expecting:
I'm drawing the ship using

Code:
Sprite_Transform_Draw(imgShip, ship.x, ship.y, ship.width, ship.height, ship.frame, ship.columns);
where ship is my structure representing the ship, and imgShip is the ship's texture.

And now when it comes to drawing the text, it seems that the position I'm giving is relative to that of my ship, i.e using :
Code:
FontPrint(font, 0, 0, oss.str());
will make the text follow my ship.

Of course fixing this was straightforward :
Code:
FontPrint(font, 0-ship.x, 0-ship.y, oss.str());

But I'd still like to understand how come. Because I can draw another ship if I want, or some asteroid as in chapter 8, and they won't be following the ship.

Thanks in advance



 6 
 on: September 07, 2010, 09:47:46 AM 
Started by Shikamu - Last post by Shikamu
I do when my computer annoys me because it's too slow ;P

but yeah I guess most people close their game using the nice EXIT menu Smiley

thanks for the answer anyway!

 7 
 on: September 07, 2010, 09:47:25 AM 
Started by DARKER - Last post by J. Harbour
That's interesting.

No, I'm not being sarcastic, but you didn't provide any information here at all, so all I can say is, that's an interesting problem. I don't know what it refers to... is that a VB program?



 8 
 on: September 07, 2010, 09:45:20 AM 
Started by bradbland - Last post by J. Harbour
You might be right, but I haven't looked at this code in 3 years. I'll go over everything for the third edition coming up in a couple months.

 9 
 on: September 07, 2010, 09:42:21 AM 
Started by Shikamu - Last post by J. Harbour
That example probably doesn't look at all of the windows messages related to closing the window, like WM_DESTROY.

Btw, who uses Alt+F4 these days?

 10 
 on: September 05, 2010, 12:09:39 PM 
Started by antrad - Last post by antrad
Hi,

here is a YouTube link for a gameplay video of my game called The Last Game Hero ( aka Serious Sam 2D ).
I used Advanced2D engine to make it.

Code:
http://www.youtube.com/watch?v=s5d1clEDz7I

So what do you think ?  Shocked


Pages: [1] 2 3 4 5 6 ... 10
Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!