Box overshot and I don't know

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
guiballa
Posts: 3
Joined: February 9th, 2017, 12:56 am

Box overshot and I don't know

Post by guiballa » February 9th, 2017, 1:03 am

Hey guys, I am in the fifth episode of the beginner C++
I was trying to follow every step, however every time I try to run and test the box overshooting I get x < int( Graphics::ScreenWidth )
Attachments
Game.h
(2.03 KiB) Downloaded 93 times
Game.cpp
(4.19 KiB) Downloaded 103 times

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Box overshot and I don't know

Post by chili » February 9th, 2017, 2:34 am

I see you testing and adjusting only for the case where the reticle is overshooting on the right side of the screen, but not for any of the other cases. So when you hit the left it's gonna shit the bed (and x < int( Graphics::ScreenWidth ) indicates you were moving the reticle to the left).
Chili

guiballa
Posts: 3
Joined: February 9th, 2017, 12:56 am

Re: Box overshot and I don't know

Post by guiballa » February 9th, 2017, 5:49 pm

I wrote the code for the left, up, and bottom, however I thought that if I start again
I will make it right

I was testing on the right

guiballa
Posts: 3
Joined: February 9th, 2017, 12:56 am

Re: Box overshot and I don't know

Post by guiballa » February 9th, 2017, 6:14 pm

Thanks for trying, i already figured out

Post Reply