Results 1 to 6 of 6

Thread: Simple question

  1. #1

    Thread Starter
    New Member fedekun's Avatar
    Join Date
    Aug 2008
    Posts
    10

    Simple question

    Hi, i have already made some simple games with C and allegro, but i have no idea how to make a simple 2D game in VB.Net.
    I have to use DirectX or there is some built in functions or something?
    How to do double buffering? and Collision Detection?
    I'm not a vegetarian because i love animals, im a vegetarian because i hate plants.

  2. #2
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: Simple question

    2d games are simple in vb.net. I wrote a tutorial that double-buffers.

    Collision detection you should know by now if you've already written some games, is simply tracking where the objects you can hit are in relation to where you are. My snake tutorial in my signature has a simple collision detection with itself and food pellets and walls, and takes different actions for each. The vb6 wormipede game uses directx 7.1 and uses more advanced pixel location collisions because it has moving "sprites". But it all is the same really, you can track the border of your object's rectangle and use an intersectrect call to see if they touch. if so, collision.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  3. #3

    Thread Starter
    New Member fedekun's Avatar
    Join Date
    Aug 2008
    Posts
    10

    Re: Simple question

    So...DirectX is not neccesary for 2D games? Ok, i will check your tutorial thanks a lot
    I'm not a vegetarian because i love animals, im a vegetarian because i hate plants.

  4. #4
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: Simple question

    No it isn't and it is basically due to the way vb.net handles graphics. It works the same way gdi does now. You have to put all your drawing routines in the form (or control) paint event. Whenever it gets invalidated through window movement or by needing to refresh to update the info that event is triggered either by the OS or by your code and everything you need to draw is drawn along with the control/form. this includes shapes, text, sprites, what have you. there are also a couple of other vb.net examples floating around the forum. The contest submissions for the game contest are two examples, and there is also a tetris clone on here somewhere.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  5. #5

    Thread Starter
    New Member fedekun's Avatar
    Join Date
    Aug 2008
    Posts
    10

    Re: Simple question

    You can do tiles with it? Because i wanted to make something very simple like a player moving in a big map, and i would need tiles, well, i will just search around the forum :P
    Thanks a lot
    I'm not a vegetarian because i love animals, im a vegetarian because i hate plants.

  6. #6
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: Simple question

    you create the tiles in a paint program and store them in a buffer. One bitmap image with every tile on it.
    You can then paste parts of the buffer onto screen whereever you wish. that is tile graphics. You just plug into the paste routine the x and y and height/width of the source and then the x and y of the starting draw position. simple. Conceivably you could have a separate buffer for each tile but this is wasteful and harder to code for unless you only have a couple of them.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width