[.net] My Game Maker Help?

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

Recommended Posts

Ok guys, i have been working on my game maker in vb for a long while now. But it works and i am happy. But i am lacking one feature i need "Blocks" to keep users from walking throught stuff now i have them tackled some what. The way it needs to work is simple. I need to save pictureboxes in a list of pictureboxes into the C:/ drive and then load them back into a list of pictureboxes. I know you can do this using xml. But is there another way. And if you could provide a code that would help a ton. Please Help. Thanks - civil

Share on other sites
Don't use PictureBoxes, they're extra memory overhead that is completely unnecessary. For whatever object your drawing area is (your window, a panel control), call the CreateGraphics method and use the Graphics.DrawImage method to draw Bitmap objects that you load from BMP, PNG, or whatever image type files with either the Stream or String version of its constructor.

Share on other sites
Yes, or perhaps even just BitBlt. I used that all the time when I programmed VB.
You can always abstract the geometry into some variables, and avoid pictureboxes.
As Cpt. Midnight said, they are extra memory overhead. I had a 32Mb Pentium machine
back in 2000 which I created a simple crafting game on, inspired by runescape.

It contained around a hundred pictureboxes, and ultimately, not all of the form would load:
The VB Designer would leave out some of the pictures... :/

It's common, good practice to seperate a game into more layers of graphics, business logic and backend storage. (And many, many variants of this.)

Share on other sites
Guys, i am not using pictureboxes for images. I am using them for the control. For example when i figure out how to save them and load them back in i can use a code to tell if one picturebox hit another. Thats why i am using it. Just as a maker. Thats all. Please help me on how to save and load them. Thanks - civil

Share on other sites
Could you explain to us how you are creating the maps? Are you using tiles? are the tiles moving on the map? In other words do you need the blocking areas to be moveable too?

Share on other sites
Still, this
Quote:
 Original post by civilwarrock i can use a code to tell if one picturebox hit another.

sounds a little suspicious.

You don't actually need to use pictureboxes for collision detection.
Do you have one for the bounding box of every sprite?
Maybe I'm just misunderstanding you.

Share on other sites
Ok guys, well my game maker draws images onto a picturebox witch i use as a map. Then from there i save it and open it up in my game player. The map deos not move at all. But you have the option to put down blocks. Your char witch will be drawn on a form in game play just like the map. Now a emty picturebox follows the char were ever he geos. This is why i need to use pictureboxes so that if my picturebox following the char hits a standing still picturebox i can code a block. This all works ecept for the fact i need to be able to save pictureboxes and load them back in. Thanks - civil

Share on other sites
Quote:
Original post by SuperVGA
Still, this
Quote:
 Original post by civilwarrock i can use a code to tell if one picturebox hit another.

sounds a little suspicious.

You don't actually need to use pictureboxes for collision detection.
Do you have one for the bounding box of every sprite?
Maybe I'm just misunderstanding you.

Can you please explain this bounding box methed for a sprite? Cause i think that may salve some problems. But how do i save them? - civil

Share on other sites
Yes, alright.

Ok first thing would be to know how to blit a sprite or other 2d feature

Secondly, the bounding boxes i mentioned can be used for instance if you have
Type MyBB  left  top  width  heightEnd Type

You check for overlapping instances of MyBB.

For instance, if the left component one corner of BB1 is higher than left of BB2, but lower than left+width of BB2
AND
the top component of same corner of BB1 is higher than the top of BB2,
but lower than top+height of BB2,
-then there's a collision. (Test for all corners to see if the rectangles overlap)

After that, you could test the masks of the sprites, or alpha values to do pixel-perfect collision test.

Am I making sense to you?

Share on other sites
Unfortuinitly no, i dont get the

Type MBB
Left
Right
Top
Bottom
End Type

I dont get what this code deos and how to use. Thanks- civil

• 18
• 11
• 20
• 9
• 52
• Forum Statistics

• Total Topics
631397
• Total Posts
2999812
×