We have finished with the basic requirements for the lab.
Everyone should now have a working game.
At this point, we will each choose our path for the completion of the lab.
We have 3 paths to choose from. You may choose whatever you want, but for full credit, you must complete just 1 of the 3 tasks listed below:
- Programming
- Design
- Art
Programming
We’ve got it working, but there are some pieces that are a little klunky.
When we drag an object on the scene, it just snaps from location to location. Let’s have it move smoothly and snap into place at the end.
When you drag something around, it should remember where you grabbed it, and that point should act like a handle for the object.
Like if you grab the top-left corner and start dragging, the object should move so that your finger is still in the top-left corner.
- In the Dragable class
- In
OnBeginDrag()take note of the initial finger position - In
OnDrag()update the position of the object relative to the original finger position - Update the object’s position smoothly so it feels more connected to the user’s finger.
- Add
IEndDragHandlerandOnEndDrag()to snap the object into position
- In
- In the Playfield and Dragable classes
- Change it so that the rotations happen smoothly instead of snapping from one angle to the next.
Design
We don’t really have a game yet, but let’s start laying the foundation.
- Create a resource similar to the gold in Clash of Clans
- Indicate the player’s accumulated total of that resource in the UI
- Designate some of the buildings to generate that resource over time
- Create a graphical representation of that resource being generated by those buildings
- Give each building hit points as well
- Create some way to show the statistics for each building while editing the City
- Add a Play/Edit toggle button to the UI
- In play mode, resources accumulate, and the user cannot edit the City
- In edit mode, resources do not accumulate, and the user can edit the City as we’ve set up already
Art
In Clash of Clans, the buildings are meant to be destroyed.
Let’s create destroyed versions of the buildings.
- Create a destroyed model for each of the buildings
- You don’t need destroyed copies of the roads or trees
- For now, just swap in the destroyed versions so that we can see them
- Also create a complete background to cover up the blank blue background that’s showing through
Be sure to commit and push everything.
Fill in the conclusion report Conclusion Report