Dynamically changing parts in GameLab?

Hello everyone!

I’ve been interested in Rubik’s Cubes for a while now. and i’ve tried thinking of how to program it in the GameLab. no luck. I need the cube to turn (faces) depending on which key I press (F R U B L D) and also rotate to different sides. is there any way I can do this?

I could read/write to arrays, but that seems too difficult.

Wish I could help … it’s beyond the scope of what students taking CS Discoveries are expected to do, but I’ve seen some amazing games, so it wouldn’t surprise me if there is a way to do that. I saw your breakout game and liked it! It would be a good project for me to look at to improve my own coding skills.


First, I don’t understand what you are trying to get at here.
If your rubik’s cube is static (which is probably what it is), meaning it doesn’t have animation involved, making it functional is simple.

I can’t explain but I made it work.
Up, Down, Left, Right to change faces
Click around the box to turn the individual collumns/rows
I have never completed a rubik’s cube and this I made in around 1.5 hours, so the code looks like a mess
However it works but keep in mind that you can change the orientation by simplying changing faces (UP, LEFT, DOWN)
It’s possible for me to make a little 3d cube that shows orientation but I think that is too much work. 3d is possible (I have my own little library)

There’s an obvious bug in it, but I don’t have the time to visualize it and solve the orientation problems.

Hello, I took your idea and changed it a bit, i reused some of your code, but the majority of it is new code, because i couldn’t really break down yours in a meaningful way.

1 Like