Jump to content

  • Log In with Google      Sign In   
  • Create Account


Alphablackwolf

Member Since 23 Apr 2012
Offline Last Active May 08 2012 01:26 PM
-----

#4937248 Loading a tiled map

Posted by Alphablackwolf on 03 May 2012 - 05:07 PM

As far as I can tell, you will need to make the following changes:

1) Add a routine for drawing your tiles, and call that from your draw routine.
2) Call the grass draw event from that new routine for any tile object that needs grass drawn on it.
3) remove the spritebatch.begin/end calls in the grass draw routine.
4)remove your grass load procedure. Change it so that you load in tile information from your file and set an enum or property so that you know what tile object needs what type (grass, dirt, whatever you have) then you will 'load' in the type without drawing it. Unless I am much mistaken, you are not going to want to draw your grass when you load the content, only on the draw event.

Slynk is correct in pointing out the draw.begin/end inside of your grass draw loop is causing a lot of your lag.

You are also calling your grass draw routine inside of a loop that calls LoadWorld each time. you call and use loadworld once to find it's length and then again for every single loop in the if statement to see if it is the first time. So if the LoadWorld function returns a char array of length 30, you read the entire file 30 times. Load it once before your loop, and save it. call the saved value instead of the actual function over and over again.


#4934246 Graphic Display for Card Game

Posted by Alphablackwolf on 23 April 2012 - 03:37 PM

I am working on making a card game in vb.net. It's not a playing card game; but that's poor wording... hmm, think more 'Magic: The Gathering', less poker cards. Anyway, I have physical cards, which have text on them that will need to be readable when I scan them in and add them to the game.

What I am hoping to find out is if anyone knows the best choice for the object type to use to hold these images. I am hoping to have a graphic for a table (the background) and then individual cards that may be re-sized and moved around during the course of the game. I want to make sure I can scale the cards and leave the text readable, and be sure I can do smooth transitions for card movement, etc.

I am currently only aware of system.drawing.image, and using a picture box in my form in order to display it all. Are there any better alternatives out there? Some assembly that you would recommend for use? I do plan to make custom buttons to display over the cards for the user to make gameplay choices, if that would change anything.

I did google around a good bit, but having the words 'card, game, and graphics' in a search tends to lead me around to the wrong kinds of results.

Any thoughts would be much appreciated, thanks!


PARTNERS