Archived

This topic is now archived and is closed to further replies.

Ethereal Gate's (DFG's 2D engine) first demo

This topic is 4982 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Note: Requires DirectX 9 to run. This is my first game engine that I've actually gotten anywhere on. I've gotten alot done in the past few days on it and I figured I'd show it off. The demo has 4 things: FPS display 2 textured quads (with transparency) moving/bouncing mouse cursor with trail selection box The cursor was stolen from HGE's (Haaf's Game Engine) tutorial 6. The other two graphics are programmer art. To exit the app press escape, to take a screenshot(which are saved in the screenshot folder) press F1. The app has an output file, but it doesn't say much right now. http://x4.invisionfree.com/DXGameProgramming/index.php?showtopic=1&st=0& Note: I tried linking directly to the file, but it's not working. Any feedback would be appreciated, thanks! /* I use DirectX 9 and C++ (Microsoft Visual C++ 6.0 Professional edition) */ [edited by - Programmer16 on April 21, 2004 3:08:39 AM] [edited by - Programmer16 on April 21, 2004 3:11:47 AM]

Share this post


Link to post
Share on other sites
Hi,
It looks like a good start. It all worked fine for me. My only suggestion would be to make the mouse trail ''catch up'' to the cursor when the mouse stops moving, but otherwise, well done.

Share this post


Link to post
Share on other sites
I tried making it catch up, but it didn't work. Right now I'm keeping 4 previous positions, and then each time I update the mouse I update the prev. positions first. Like so:
g_vPrevMouse[3] = g_vPrevMouse[2];
g_vPrevMouse[2] = g_vPrevMouse[1];
g_vPrevMouse[1] = g_vPrevMouse[0];
g_vPrevMouse[0] = g_MouseCursor.m_vPosition;
g_MouseCursor.SetPosition(HIWORD(lParam), LOWORD(lParam);

Then I tried, before returning, setting them all to the g_MouseCursor position, but that didn't work. Could I set a bool to false (g_bRenderTrail) and when the mouse isn't moving don't render it? Thanks for the reply!

/*
I use DirectX 9 and C++ (Microsoft Visual C++ 6.0 Professional edition)
*/

[edited by - Programmer16 on April 22, 2004 9:42:29 AM]

Share this post


Link to post
Share on other sites
quote:
Original post by Programmer16
Then I tried, before returning, setting them all to the g_MouseCursor position, but that didn''t work.
[edited by - Programmer16 on April 22, 2004 9:42:29 AM]


What exactly didn''t work about that? Although if you were just going to set them all to the mouse cursor position, then your idea for just not rendering the trail when the mouse is stopped would look the just same, so I guess you could try that too.
What I thought would look nice though, but be a little more work is , when the mouse stops moving, to scale the previous positions towards the current position, so they kinda spring towards it when it stops, but it''s late here, and I can''t think how you would do that at the moment

Share this post


Link to post
Share on other sites
I'll work on that, as for the file not opening, I've fixed the link in my forums and reuploaded it to this site:
http://www.angelfire.com/games5/dragonfire_games/EGateDemo1.zip Thanks for the help guys!

/*
I use DirectX 9 and C++ (Microsoft Visual C++ 6.0 Professional edition)
*/

[edited by - Programmer16 on April 22, 2004 1:39:44 PM]

Share this post


Link to post
Share on other sites
I tried modifying the program so that the selection box is used as the bounds for the quads, but it only works sometimes. When it doesn''t work, it just hits the wall and slides up and down (or left and right). This is my code:

if(m_bBoundToWindow)
{
if(m_vPosition.x + m_iWidth <= m_rBounds.right && m_vPosition.x >= m_rBounds.left)
{
if(m_vPosition.x + m_iWidth == m_rBounds.right && m_vVelocity.x > 0)
m_vVelocity.x = -m_vVelocity.x;

if(m_vPosition.x == m_rBounds.left && m_vVelocity.x < 0)
m_vVelocity.x = -m_vVelocity.x;

m_vPosition.x += m_vVelocity.x;
}
if(m_vPosition.y + m_iHeight <= m_rBounds.bottom && m_vPosition.y >= m_rBounds.top)
{
if(m_vPosition.y + m_iHeight == m_rBounds.bottom && m_vVelocity.y > 0)
m_vVelocity.y = -m_vVelocity.y;

if(m_vPosition.y == m_rBounds.top && m_vVelocity.y < 0)
m_vVelocity.y = -m_vVelocity.y;
m_vPosition.y += m_vVelocity.y;
}
}
else
{
m_vPosition.x += m_vVelocity.x;
m_vPosition.y += m_vVelocity.y;
}


/*
I use DirectX 9 and C++ (Microsoft Visual C++ 6.0 Professional edition)
*/

Share this post


Link to post
Share on other sites