Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Visual Basic simple game Help Needed Please.

Options
  • 22-04-2012 7:57pm
    #1
    Registered Users Posts: 1,024 ✭✭✭


    I am trying to write the code for a simple game in VB. I am looking for the best place to find code examples. The books I have just give one or two examples for code for buttons and mainform code is not there. If a web link or some advice on where to find code for games would be great. I am sure I could better understand if I could see the code of other games.

    Many Thanks gar32


Comments

  • Registered Users Posts: 2,465 ✭✭✭SweetCaliber


    Very easy Tic Tac Toe, should help you out :P

    http://visualbasic.about.com/od/usingvbnet/l/aa093002a.htm


  • Registered Users Posts: 1,024 ✭✭✭gar32




  • Site Banned Posts: 104 ✭✭Readyhed


    It depends on the type of game you want to write. Are you using VB6 or VB.net? You can go a long way using the basic controls provided by either product assuming your game does not involve too much animation(graphics acceleration)

    With VB6 you can write code using DirectX 8 and I can let you have some samples I wrote years ago but the technology is now obsolete.


    This is however obsolete now and the way to go with VB.Net seems to be XNA. This seems to be a kind of modular approach to the subject which lets you build simple games quickly without too much technical knowledge but you lose flexibility.

    http://www.xnadevelopment.com/tutorials/gettingstartedwithxnadevelopment/GettingStartedWithXNADevelopment.shtml

    If you want more control then DirectX is the way to go.Here are a few Links:

    http://www.riemers.net/eng/Tutorials/DirectX/Visual_Basic/Series1/The_first_triangle.php

    http://www.drunkenhyena.com/cgi-bin/dx9_net.pl

    http://www.euclideanspace.com/software/games/setup/dx9vb/installation/index.htm

    http://www.codeproject.com/Articles/159586/Starting-DirectX-with-Visual-Basic-NET


  • Registered Users Posts: 7,157 ✭✭✭srsly78


    DirectX is not supported with managed languages anymore, only via XNA. So most of those links are also obsolete. If you want real directx you gotta use c++.

    That said however, the latest version of xna is pretty good. Not that limiting at all.


  • Registered Users Posts: 2,022 ✭✭✭Colonel Panic


    srsly78 wrote: »
    DirectX is not supported with managed languages anymore, only via XNA. So most of those links are also obsolete. If you want real directx you gotta use c++.

    That said however, the latest version of xna is pretty good. Not that limiting at all.

    http://slimdx.org/

    Third party .Net wrapper for Direct X. Use it a lot (well, a custom branch of it) in work for visualisation.


  • Advertisement
  • Registered Users Posts: 7,157 ✭✭✭srsly78


    Is also not supported, hasn't been updated in ages. Also is very limiting. I wrote my own high level wrapper using c++/cli, but all my directx is still in pure c++.

    edit: Seems there is a new managed wrapper superceding slimdx: http://code.google.com/p/sharpdx/ Still can't see the point of this when you could use XNA.


  • Registered Users Posts: 2,022 ✭✭✭Colonel Panic


    What are you talking about? It was updated in 2012 and it's hardly limiting when it's a 1:1 mapping of calls to Direct X interfaces.

    I've seen you mention many times that your DX is pure C++, what's that got to do with anything in this context? Will the OP go and write some C++ and then call it from VB? I don't think so! :D

    XNA doesn't support anything beyond DX9 and isn't being updated either.


  • Registered Users Posts: 7,157 ✭✭✭srsly78


    We are getting off topic here, but you are quite wrong on many of your points. XNA is officially supported, and up to date. It does seem to be quite slow tho (see link below). If speed isn't an overriding concern then go with XNA tbh - this is relevant to the OP.

    SlimDX is quite limiting, if you try anything advanced you will realise this (swapchain management etc). Also see this: http://code4k.blogspot.co.uk/2011/03/benchmarking-cnet-direct3d-11-apis-vs.html In fairness slimdx did get updated in january so it isn't abandonware after all, but there was a big lapse before that, with many bugs unfixed. This caused many people to abandon it - probably why the other bloke has written sharpdx.


  • Registered Users Posts: 2,022 ✭✭✭Colonel Panic


    Well, I dunno if things are off topic. I just suggested an alternative and it's now being discussed.

    What points am I wrong on? That XNA is supported and up do date? Does it support DX11? There are lots of reasons to use XNA, but it's up to dateness is not one of them.

    What's the deal with Swapchains and SlimDX then?

    Also, thanks for that link from a year ago you just Googled. SlimDX does all right!


  • Registered Users Posts: 7,157 ✭✭✭srsly78


    Yes, xna is officially supported and up to date. It's actually quite good - try the latest version. It does support dx11.

    With SlimDX you simply do not have the low level access to windows internals, it's not just about directx function calls. Thus you cannot setup many advanced interop scenarios - many of these are on the slimdx buglist (hint: WPF).

    SlimDX is pretty damn slow from that benchmark (takes x2.5 times as long as native c++ for test to run), as are all the managed wrappers.


  • Advertisement
Advertisement