|
-
Aug 3rd, 2008, 09:55 PM
#1
Thread Starter
New Member
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.
-
Aug 3rd, 2008, 11:06 PM
#2
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.
-
Aug 4th, 2008, 12:52 AM
#3
Thread Starter
New Member
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.
-
Aug 4th, 2008, 03:16 PM
#4
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.
-
Aug 4th, 2008, 03:54 PM
#5
Thread Starter
New Member
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.
-
Aug 4th, 2008, 04:04 PM
#6
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|