157 reputation
7
bio website
location
age
visits member for 2 years, 1 month
seen 51 mins ago

1d
comment Converting time of day into a smooth day/night variable?
My game time isn't simulating Earth's, just emulating something ~like~ it. The plan is to support different worlds with an arbitrary number of months-per-year, hours-per-day, minutes-per-hour, etc. I do have (four) seasons and I determine which season it is by "gameMonth / monthsPerSeason". - I haven't implemented leap years or DST yet, and I'm not sure if I will; that level of simulating time is really cool, but I'm not sure if I need it to achieve the desired effect. There really is a lot to think about here, thanks for the input! :]
1d
comment Converting time of day into a smooth day/night variable?
My idea was to use the normalized day/night value elsewhere as a parameter for various effects; light color, light direction, intensity, etc.
1d
comment Converting time of day into a smooth day/night variable?
I'll make sure not to upvote that comment!
1d
awarded  Commentator
1d
comment Converting time of day into a smooth day/night variable?
Excellent, thanks again for the help. :]
1d
comment Converting time of day into a smooth day/night variable?
Works like a charm, thanks for the detailed answer! Just out of curiosity, how different would this be if the scale was from 0 (midnight) to 1 (noon)? Am I correct in understanding that you divided 'distanceFromNoon' by 6 (halfday) to get a normalized range from 0-2, then shifted that down to a -1 to 1 range by subtracting nDistance from 1?
1d
accepted Converting time of day into a smooth day/night variable?
1d
comment Converting time of day into a smooth day/night variable?
Thanks @Zehelvion, just reading through it now!
2d
asked Converting time of day into a smooth day/night variable?
Oct
28
awarded  Popular Question
Dec
16
asked Picking a suitable resolution for a modern low-res game?
Sep
11
comment SDL - Getting a single keypress event instead of a keystate?
I was thinking, because you said that type == SDL_KEYDOWN will stay true until another event arrives, I could use SDL_PushEvent after my event handling code block runs to force type == SDL_KEYDOWN to become false. Is that a bad way to go about it? Also, when you suggest checking the value returned from SDL_PollEvent, would that mean using a bitwise & to check to see if SDL_PollEvent & localEvent are the same event? I'm sorry if this is going right over my head. I'm a self-taught and very inexperienced programmer. :<
Sep
10
comment SDL - Getting a single keypress event instead of a keystate?
I'm curious.. Would it be possible (or smart) to create an SDL_UserEvent that essentially adds an empty event to the queue using SDL_PushEvent? That way, I could simply push an empty event to the queue after each keypress is registered? -- Also, would SDL_WaitEvent pause the program? I'd like to have the ability to use animated screens also, but maybe I shouldn't be looking for a one-size-fits-all solution...
Sep
10
comment SDL - Getting a single keypress event instead of a keystate?
I see! That's gotta be the issue. Thanks so much for your insight! :D
Sep
10
accepted SDL - Getting a single keypress event instead of a keystate?
Sep
10
awarded  Student
Sep
10
comment SDL - Getting a single keypress event instead of a keystate?
That seems like a way to work around this issue. But, is this the normal behavior for SDL_Events? I'm hoping to get to the bottom of this problem.
Sep
10
awarded  Editor
Sep
10
revised SDL - Getting a single keypress event instead of a keystate?
added 699 characters in body
Sep
10
comment SDL - Getting a single keypress event instead of a keystate?
Unfortunately, that didn't seem to fix my issue. =( I tried setting the SDL_EnableKeyRepeat in both the initialization of the state, as well as just before the SDL_PollEvent. It still ran the event-specific code once per tick! :(