Theres this thing that i dont fully understand. Im using this tutorial: http://lazyfoo.net/SDL_tutorials/lesson08/index.php and i in here we first set up some surfaces with text and then asign their value to the message and then for some reason we have to reset the message value to 0 in order for the program to quit properly, but if i dont set up the surfaces with text from the start and just set up the message myself when coding the event itself, i dont need to reset it and everything works just fine, whats the deal? I think i wasnt very clear but i think it should not be hard to understand if you see the tutorial i gave you.
nuclear
-9
Junior Poster in Training
Recommended Answers
Jump to PostHi nuclear, sorry I've been so long getting back to you.
I think I finally understand what you're talking about, and agree it generally doesn't make sense to call fps.start() each time through the loop, but I see why LazyFoo is doing it: the work that is done between …
Jump to PostCool! :)
Jump to PostNo worries. Looks like what's going on is: you're moving a dot around on a "large" level (1280 x 960, but can be arbitrarily large), then you're also moving the smaller "camera" window (640 x 480) around to view just a piece of the level at a time. Since both …
Jump to PostDon't worry about it. It might be obvious what you want it to do, but that doesn't mean it's "simple." :)
And yeah, you don't want weird "magic numbers" in your code to fix logic problems. Instead, you need to get your logic correct. Let's state your logic for …
Jump to PostYeah, without digging too deeply into potential logic issues (and admittedly looking really fast, so forgive me if I missed something that should have been obvious), it looks like you loop over the entire set of tiles twice, once after updating your x position, and once after updating your y …
All 49 Replies
sfuo
111
Practically a Master Poster
nuclear
-9
Junior Poster in Training
sfuo
111
Practically a Master Poster
nuclear
-9
Junior Poster in Training
raptr_dflo
48
Posting Pro
nuclear
-9
Junior Poster in Training
sfuo
111
Practically a Master Poster
nuclear
-9
Junior Poster in Training
raptr_dflo
48
Posting Pro
nuclear
-9
Junior Poster in Training
raptr_dflo
48
Posting Pro
nuclear
-9
Junior Poster in Training
nuclear
-9
Junior Poster in Training
raptr_dflo
48
Posting Pro
nuclear
-9
Junior Poster in Training
raptr_dflo
48
Posting Pro
nuclear
-9
Junior Poster in Training
raptr_dflo
48
Posting Pro
nuclear
-9
Junior Poster in Training
nuclear
-9
Junior Poster in Training
raptr_dflo
48
Posting Pro
nuclear
-9
Junior Poster in Training
raptr_dflo
48
Posting Pro
nuclear
-9
Junior Poster in Training
nuclear
-9
Junior Poster in Training
raptr_dflo
48
Posting Pro
nuclear
-9
Junior Poster in Training
raptr_dflo
48
Posting Pro
nuclear
-9
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.