Jump to content

  • Log In with Google      Sign In   
  • Create Account


wraith811

Member Since 21 Dec 2009
Offline Last Active Jan 07 2013 03:36 PM
-----

Topics I've Started

Hexagonal tile highlighting/picking

01 January 2013 - 09:53 PM

I've been trying to learn how to highlight a hexagon when the cursor is over a hexagonal tile. I've read several articles that explain it using a "mouse map" texture image that helps to determine if the cursor/mouse is within a hexagon on a tile map. However, I can't seem to get it to work. I originally tried using the tutorial from Kurt Jaeger's xna resources but its mainly for isometric tiles. I then found an explaination on gamedev.net but my puny brain can't seem to comprehend it. If someone could help explain this concept of using a "mouse map" or maybe an easier method would be great. Unfortunately, it won't let me upload my solution.  If you need to see my project, let me know a way of posting it.  Thanks.

 

I forgot to mention, this is in XNA 4.0


Issues with header files

29 March 2010 - 09:07 PM

I've tried to put together this text based game and I'm having trouble trying to get it to work. Every time I try to use a weapon.h the game will not compile; however, when I comment it out the game works fine. I just can't use weapons as objects. Here is the output build at pastebin.com: http://pastebin.com/Dw3kQMwc The complete game is at pastebin.com as well here: http://pastebin.com/UfkKJ8FT Thanks, let me know what you think.

InvalidCallExceptionUnhandled

12 February 2010 - 01:44 PM

This is in visual basic 2008. I'm unfamiliar with this error and the only clue its giving me is this line of code: device.StretchRectangle(image, source_rect, backbuffer, dest_rect, 0) Here is the whole code: Imports Microsoft.DirectX Imports Microsoft.DirectX.Direct3D Public Class Form1 REM define some useful constants Const SCREENW As Integer = 800 Const SCREENH As Integer = 600 Dim BLACK As Integer = RGB(0, 0, 0) REM Direct3D device variable Dim device As Direct3D.Device REM create image from a Direct3D surface Dim image As Direct3D.Surface Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) _ Handles Me.Load REM resize the form Me.Size = New Size(SCREENW, SCREENH) Me.Text = "Bitmap Loading Demo" Me.Setstyle(Controlstyles.AllPaintingInWmPaint Or _ Controlstyles.Opaque, True) REM get the desktop display mode Dim adapterNumber As Integer = Manager.Adapters.Default.Adapter Dim mode As DisplayMode mode = Manager.Adapters.Default.CurrentDisplayMode REM set up the presentation parameters Dim params As New PresentParameters params.Windowed = True params.SwapEffect = SwapEffect.Copy params.AutoDepthStencilFormat = DepthFormat.D16 params.EnableAutoDepthStencil = True params.MultiSample = MultiSampleType.None params.BackBufferCount = 1 params.BackBufferWidth = SCREENW params.BackBufferWidth = SCREENH REM check video card capabilities Dim flags As CreateFlags flags = CreateFlags.HardwareVertexProcessing flags += CreateFlags.PureDevice REM Create the Direct3D device device = New Device(adapterNumber, DeviceType.Hardware, _ Me, flags, params) REM load the bitmap file image = device.CreateOffscreenPlainSurface(SCREENW, SCREENH, _ Format.A8R8G8B8, Pool.Default) SurfaceLoader.FromFile(image, "sky.bmp", Filter.None, BLACK) End Sub Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs) REM begin rendering device.BeginScene() REM clear the back buffer device.Clear(ClearFlags.Target + ClearFlags.ZBuffer, Color.Green, 1.0, 0) REM specify the drawing rectangles for the image Dim source_rect As New System.Drawing.Rectangle(0, 0, SCREENW, SCREENH) Dim dest_rect As New System.Drawing.Rectangle(0, 0, SCREENH, SCREENW) REM get reference to the back buffer Dim backbuffer As Direct3D.Surface backbuffer = device.GetBackBuffer(0, 0, BackBufferType.Mono) REM draw the image device.StretchRectangle(image, source_rect, backbuffer, dest_rect, 0) REM stop rendering device.EndScene() REM copy back buffer to the screen device.Present() End Sub Private Sub Form1_KeyDown(ByVal sender As Object, _ ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown REM check key code for ESC key If e.KeyCode = Keys.Escape Then REM destroy the Direct3D device device.Dispose() REM destroy the image image.Dispose() REM end the program End End If End Sub End Class Thanks!

fatal error LNK 1104

11 February 2010 - 02:53 PM

For some reason I'm getting this error that says it cannot open file 'kernel32.lib'. And I'm running the simplest program ever. Hello world. #include <iostream> using namespace std; int main() { cout << "Hello world!"; return 0; } Not sure whats going on.

LNK 1104 error dxerr9.lib

08 February 2010 - 06:39 PM

I'm having trouble trying to figure this problem out. I'm using a program from Jonathan Harbour's Beginning Game Programming that shows an example of using sound in a program. However, I tried to find the "dxerr9.lib" file and all I could find was a "dxerr" file. I'm using VS 2008, is that too new for this program. Here is the output build: Build started: Project: Play_Sound, Configuration: Debug|Win32 Command Lines Creating temporary file "c:\Users\DeeDubb\Documents\Visual Studio 2008\Projects\Play_Sound\Play_Sound\Debug\RSP00000D10321296.rsp" with contents [ /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Gm /EHsc /RTC1 /MDd /Fo"Debug\\" /Fd"Debug\vc90.pdb" /W3 /c /ZI /TP ".\DirectSound.cpp" ] Creating command line "cl.exe @"c:\Users\DeeDubb\Documents\Visual Studio 2008\Projects\Play_Sound\Play_Sound\Debug\RSP00000D10321296.rsp" /nologo /errorReport:prompt" Creating temporary file "c:\Users\DeeDubb\Documents\Visual Studio 2008\Projects\Play_Sound\Play_Sound\Debug\RSP00000E10321296.rsp" with contents [ /OUT:"C:\Users\DeeDubb\Documents\Visual Studio 2008\Projects\Play_Sound\Debug\Play_Sound.exe" /INCREMENTAL /MANIFEST /MANIFESTFILE:"Debug\Play_Sound.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\Users\DeeDubb\Documents\Visual Studio 2008\Projects\Play_Sound\Debug\Play_Sound.pdb" /SUBSYSTEM:WINDOWS /DYNAMICBASE /NXCOMPAT /MACHINE:X86 d3d9.lib d3dx9.lib dxguid.lib dinput8.lib xinput.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ".\Debug\DirectSound.obj" ".\Debug\MyWindows.obj" ".\Debug\MyGame.obj" ".\Debug\MyDirectX.obj" ".\Debug\Play_Sound.exe.embed.manifest.res" ] Creating command line "link.exe @"c:\Users\DeeDubb\Documents\Visual Studio 2008\Projects\Play_Sound\Play_Sound\Debug\RSP00000E10321296.rsp" /NOLOGO /ERRORREPORT:PROMPT" Output Window Compiling... DirectSound.cpp Linking... LINK : fatal error LNK1104: cannot open file 'dxerr9.lib' Results Build log was saved at "file://c:\Users\DeeDubb\Documents\Visual Studio 2008\Projects\Play_Sound\Play_Sound\Debug\BuildLog.htm" Play_Sound - 1 error(s), 0 warning(s) Thanks, let me know if you want to see the whole program.

PARTNERS