I just started beginner game development series.
i made one reticle big and it changes shape to a small one after releasing shape key.
i made it so that it won't crash when they reach edge of framework.
But whenever i release my shape changing key(Shift key) at the edges of framework my program crashes.
HELP PLEASE.
i have attached my files.
need help!! Beginner mistake. but can't find it.
need help!! Beginner mistake. but can't find it.
- Attachments
-
- Chili Framework 2016.zip
- as said in the forum i remove the cached files.
- (100.19 KiB) Downloaded 131 times
Gold ain't good I need Platinum
Re: need help!! Beginner mistake. but can't find it.
Your problem is your placement of this line
ShapeKeyIsPressed = (wnd.kbd.KeyIsPressed(VK_SHIFT));
Remember that the code in the update function will be read from the top down. Go over your Update function and see if you can figure out why the placement of that line causes an issue and why moving it to some other place will solve the issue
ShapeKeyIsPressed = (wnd.kbd.KeyIsPressed(VK_SHIFT));
Remember that the code in the update function will be read from the top down. Go over your Update function and see if you can figure out why the placement of that line causes an issue and why moving it to some other place will solve the issue
Re: need help!! Beginner mistake. but can't find it.
Thank you very much!!! it worked.Yumtard wrote:Your problem is your placement of this line
ShapeKeyIsPressed = (wnd.kbd.KeyIsPressed(VK_SHIFT));
Remember that the code in the update function will be read from the top down. Go over your Update function and see if you can figure out why the placement of that line causes an issue and why moving it to some other place will solve the issue
but why it caused the issue?
Gold ain't good I need Platinum
Re: need help!! Beginner mistake. but can't find it.
1. the code that makes sure the reticle isnt outside of the screen gets executed
2. the code changing the shape of the reticle gets executed. (going from a small reticle at the edge of the screen to a big one means that it will now be outside of the screen.
3. your reticle is drawn
can you see how flipping the order of 1 and 2 would solve the issue?
2. the code changing the shape of the reticle gets executed. (going from a small reticle at the edge of the screen to a big one means that it will now be outside of the screen.
3. your reticle is drawn
can you see how flipping the order of 1 and 2 would solve the issue?
Re: need help!! Beginner mistake. but can't find it.
thank you very much i understoodYumtard wrote:1. the code that makes sure the reticle isnt outside of the screen gets executed
2. the code changing the shape of the reticle gets executed. (going from a small reticle at the edge of the screen to a big one means that it will now be outside of the screen.
3. your reticle is drawn
can you see how flipping the order of 1 and 2 would solve the issue?
Gold ain't good I need Platinum