CPC_Practicals

Workshop 07 - state machines

Hello and welcome back!

This final optional task is a little test for you to take the training wheels off and figure out steps on your own. We will build a nice little template for having multiple states in your project…

Here’s what you can make, click on the buttons and interact with the dat.gui panel to see how it all works…

Where code is provided, you are expected to write it out yourself rather than copying and pasting it. We know this is tempting, but the point of a university education is for you to learn the necessary skills for your field, and copying and pasting code will not be on any job descriptions.

Task 1 - Having a Go

Right, it’s up to you to have a go at adapting this starter code. You can put your own states in or try and do the same as the above example.

That’s it for this week

Ideally you’ll have completed your own state machine now. Hopefully the template will come in useful for your Mini Project assignment. Nice one! 😀

Back up your work

Super important task: go to file->export to .zip in your codesandbox and download your project as a zip.

Remember, files in the cloud are just files on someone elses computer. It is critical to keep a good backup.