Jump to content
  • Advertisement
Sign in to follow this  
JordanCameron

Help with keeping track of sprites

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm having endless problems trying to do this assignment, if someone could help that would be great. What I'm wanting to do is draw tiles on the screen based on a map array. I have a class for the tiles which containing and x and y variable, an HBITMAP var for the image and a var the type (0 for air, 1 for a floor block etc), a function that loads in the bitmap for an object of the class and a function that draws said object. I know I've went the wrong way about this as the map is going to have 64*64 tiles in it and I can't have a separate object for every tile. I'm probably sounding stupid, but am I meant to create an array of the tile objects? How would I go about doing this? I know this probably doesn't make much sense but I'm stressing out over this way too much, if you need more info to help me I'd be happy to try my best to explain a bit better. I'm in my second year of a games dev course at a good university and I feel I haven't learnt a thing, everything I have learnt has been from sitting in the library reading and constantly experimenting with ideas, my lecturers more or less dismiss you when you try and approach them with a question like this so I'm really hoping someone could give me a hand. I feel like if someone helps me with these smaller aspects that I don't understand I'd be on my way to being a lot better at this, it's just the small things that get me confused... I know the title is a bit misleading but I honestly have no idea what to put for it. Once I get this out the way, I think I have the knowledge to get the rest done. Thanks for your time.

Share this post


Link to post
Share on other sites
Advertisement

I'm having endless problems trying to do this assignment, if someone could help that would be great. What I'm wanting to do is draw tiles on the screen based on a map array. I have a class for the tiles which containing and x and y variable, an HBITMAP var for the image and a var the type (0 for air, 1 for a floor block etc), a function that loads in the bitmap for an object of the class and a function that draws said object. I know I've went the wrong way about this as the map is going to have 64*64 tiles in it and I can't have a separate object for every tile. I'm probably sounding stupid, but am I meant to create an array of the tile objects? How would I go about doing this? I know this probably doesn't make much sense but I'm stressing out over this way too much, if you need more info to help me I'd be happy to try my best to explain a bit better. I'm in my second year of a games dev course at a good university and I feel I haven't learnt a thing, everything I have learnt has been from sitting in the library reading and constantly experimenting with ideas, my lecturers more or less dismiss you when you try and approach them with a question like this so I'm really hoping someone could give me a hand. I feel like if someone helps me with these smaller aspects that I don't understand I'd be on my way to being a lot better at this, it's just the small things that get me confused... I know the title is a bit misleading but I honestly have no idea what to put for it. Once I get this out the way, I think I have the knowledge to get the rest done. Thanks for your time.


Okay, I have managed to make this array and I think I'm on the right track, the problem I'm having now is that the sprites only stay on the screen for a millisecond then disappear, why would this be? I'm blitting everything to the hDC then displaying the hDC (I think?) in a continuous loop (double buffering) if that helps?

Share this post


Link to post
Share on other sites
It's going to be pretty much impossible for anyone to help you bug hunt without posted code to look at. Could you post what you've written"

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!