Left-Right Joycon buttons dont work
-
I genuinely think you need to spend some time going through the tutorials.
Similar to my example above, yes, the setShapeLocation command does indeed require you to later call the drawShape() command. You would do something along these lines:
x = 50 y = 50 width = 50 height = 50 myBox = createBox(x, y, width, height) loop clear() // Call a routine to modify X and Y as desired setShapeLocation(myBox, x, y) drawShape(myBox) update() repeat
Thats if you want to use shapes.
If not, how about:
x = 50 y = 50 width = 50 height = 50 loop clear() // Call a routine to modify X and Y as desired box(x, y, width, height, red, false) update() repeat
-
I think you're right, I do need to go through the tutorials more than once....
-
Up front, my apologies if I have the wrong idea about where you're struggling...
Games can be a bit of a strange concept at first and I have a feeling this is what's tripping you up. Actually not just games, anything that constantly dynamically changes and never stops, but whilst Fuze is certainly not limited to game creation, it's seems to be the thing it's most used for so I'll stick to that here.
So you need to get into the frame of mind that your code is never going to stop. You will always have a loop and in it's most simplest form, at least until you hit performance problems, assume that 60 times a second you are going to be expected to completely erase the screen and re-draw it. Like I say, try and do too much that won't fit into that 60fps time frame and you'll have to think about not clearing the entire screen, but forget about that for now.
So your program will be a loop, or a series of loops. Consider this "pseudo-code":
loop loop until gameStarted // Draw attract screen repeat loop until gameOver // Do gameplay // Update game state // Clear and redraw screen repeat // And so on repeat
All of that is very high level and not really anything to do with your specific questions. BUT, I have a feeling that understanding that concept a bit better may remove some of the questions that you're having? (I may be wrong of course). The thing is that is never stops. It's unusual to have sleep commands. I'm sure they have their uses but I personally wouldn't miss then if they were not in the language and you seem to have quite a lot of them.
The other thing then is the question of this selection box:
Mabe I could put in another if command to put a box over the previous box and then clear the previous selection box.....
So, you shouldn't really need to be worrying about clearing the previous selection box, or any of that jazz. I'm sorry, I've not followed exactly what you are wanting to do. But let's say that you have 5 cards laid on the table in a row and you want a red box around the first card. When the player moves right the selection box moves to card number two, then 3, or press left and it's back to card 2 and so on.
All you need to do is track two things: 1) is the selection active at all (are we in selection mode), if so 2) which card is selected (1, 2, 3, 4 or 5). You would increment the selection when the user presses left or right.
So now, you have the info you need to just draw a box if selection is active and you know which card it has to be drawn around. And you draw it EVERY frame (every time the loop repeats), regardless, but only as long as selection is enabled. And remember that you do this without any pauses or sleeps, forever, or until the game progresses to the next phase (the user selected a card perhaps?)
Again, my apologies if I have got the wrong end of the stick. Or rather, I've misunderstood where you are getting stuck (or coming unstuck).