Breaks, speeding into the up direction.
-
- Posts: 363
- Joined: March 12th, 2013, 6:06 am
- Location: "Keep Louisville Weird"
Breaks, speeding into the up direction.
Hi I'm just wondering why the code breaks when I push the space button while traveling in the up direction. Only happens when space is pushed.
- Attachments
-
- Chili DirectX Framework - Copy.zip
- (22.71 KiB) Downloaded 117 times
Re: Breaks, speeding into the up direction.
this seems to be key ghosting issue? (tho i find it weird that it would happen on 2 keys when it normally happens with 3 or more)
always available, always on, about ~10 years c/c++, java[script], win32/directx api, [x]html/css/php/some asp/sql experience. (all self taught)
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat --
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat --
-
- Posts: 363
- Joined: March 12th, 2013, 6:06 am
- Location: "Keep Louisville Weird"
Re: Breaks, speeding into the up direction.
I guess I'll rewrite the clamping code or use the up dated framework anyway moving on. If its not a problem with the logic.
Re: Breaks, speeding into the up direction.
I ran this on my machine and all was well except for the same issue i had, was when i press left - up - space, the space key gets nulled and doesn't respond but only with that 3 key combo. I since used the "S" key to replace the space in my code and all 3 key combos work now. I did a little digging and it seems to be the keyboard mappings on the keyboard its self.
Curiosity killed the cat, satisfaction brought him back
Re: Breaks, speeding into the up direction.
MrGodin wrote:I did a little digging and it seems to be the keyboard mappings on the keyboard its self.
http://www.microsoft.com/appliedscience ... ained.mspxLuisR14 wrote:this seems to be key ghosting issue?
I wonder if that test app could be embedded on the FAQ page or something.
ʕ •ᴥ•ʔ
Re: Breaks, speeding into the up direction.
Yes that's a good page actually. I'mma gonna bookmark that one ..http://www.microsoft.com/appliedscience ... ained.mspx
I wonder if that test app could be embedded on the FAQ page or something.
Cheers
Curiosity killed the cat, satisfaction brought him back
-
- Posts: 363
- Joined: March 12th, 2013, 6:06 am
- Location: "Keep Louisville Weird"
Re: Breaks, speeding into the up direction.
((D3DCOLOR*)rect.pBits)[ x + (rect.Pitch >> 2) * y ] = D3DCOLOR_XRGB( r,g,b );
Not sure why this is pushing the reticle north of the border into the forbidden zone.
is this >> dividing by 4. i'm just guessing.
Not sure why this is pushing the reticle north of the border into the forbidden zone.
is this >> dividing by 4. i'm just guessing.
-
- Posts: 363
- Joined: March 12th, 2013, 6:06 am
- Location: "Keep Louisville Weird"
Re: Breaks, speeding into the up direction.
well this seems to wrap upwards correctly when I stuck a 12 in there.
The debugger showed a neg 2 for y so perhaps that explains 12 working, but what about the other 5 positions plus the height of the reticle.
// 12 is the magic number
if(y<12)
{
y=594;
}
if(x>794)
{
x=5;
}
if(y>594)
{
y=12;
}
The debugger showed a neg 2 for y so perhaps that explains 12 working, but what about the other 5 positions plus the height of the reticle.
// 12 is the magic number
if(y<12)
{
y=594;
}
if(x>794)
{
x=5;
}
if(y>594)
{
y=12;
}
Re: Breaks, speeding into the up direction.
I checked your code. It's all about logical ordering: You want to first move, then clamp, and not the other way round. Plus it's not really "clamping" if you teleport to the other side. The original code should work perfect if you'd just switch to move first, then clamp.
ʕ •ᴥ•ʔ
-
- Posts: 363
- Joined: March 12th, 2013, 6:06 am
- Location: "Keep Louisville Weird"
Re: Breaks, speeding into the up direction.
Thanks Lux your the man. And now I am free to teleport across the cosmos which is 800x600. Yea, I wrote that from memory so I got it backwards and thought about why it didn't and did work. and now I am tired cause thinking is hard. Winky face.