Sketch
Screenshots
Concept
The concept originated from my obsession with keychains. I love having silly little knicknacks dangling off the zippers on my bag, or making jingling noises as i move my house keys. I wanted to encapsulate this experience so that’s why I decided to base my midterm on this idea.
In this game, users are free to decorate their bag with any of the keychains provided. They can move the keychains around to their liking to place anywhere on their bag, while also being able to rotate the keychain to best fit their preferred orientation. And note how the keychain jingles when it’s moved!
There is also a bonus feature in which the user can get one randomly generated special keychain to add to the collection!
Code, Problems, and Favorites
- I really enjoyed illustrating some of the keychain designs (including the keychain hook) by hand on PowerPoint
- Using an array with the file names for my keychain images, and using a loop to run through the array to quickly load all of the images made it so much easier.
function preload() { // array of image names let imageNames = [ "/images/strawberryChain.png", "/images/carrotChain.png", "/images/tomatoChain.png", "/images/specialChain.png", "/images/specialChain1.png", "/images/specialChain2.png", "/images/specialChain3.png", ]; // load images and sound for (i = 0; i < imageNames.length; i++) { let newChain = new Keychain( loadImage(imageNames[i]), random(40 + 40, 320 - 40), random(150 + 50, 500 - 130), 70 ); chains.push(newChain); } }
- I used a lot of Classes in my project and I’m honestly glad I did because it made my code so much neater (albeit still messy, but it’s good enough!). I made a class for my keychains, the bag, and the background scenes depending on the game state. This way, my sketch file is less populated!
- I had a lot of troubles trying to figure out how to rotate the keychains on click, but I managed to figure it out by adding an angle attribute to my Keychain class.
function mousePressed() { for (let chain of chains) { // checks if mouse is over keychain if (chain.isMouseOver() && gameState != "end") { // tilt the keychain when clicked i = 10; if (chain.angle > -90) { chain.angle -= i; } else { chain.angle = 90; } ...
- In terms of the design, I was sure I wanted to include pinks and purples, and the whole idea of ‘decorating/personalizing’ reminded me of GirlsGoGames (GGG), an old online gaming website that I used to play when I was younger. And this is what inspired my overall design layout, style, and color palette!
For the Future
As much as I am proud of the final outcome, I still have areas of the project that I would like to improve on.
Firstly, the png images of the keychains, after resizing, looks very pixelated, so in the future I would consider this when illustrating and implementing images.
Second, there seems to be some glitch on the special keychain side. When a special keychain has been revealed, it takes the second mouse click for it to be able to be dragged, so it doesn’t drag on the first click. I’m still unsure as to how to fix this.
Third, as of right now, all of the keychains are presented when it hits the end game state. However, it would be better if I could somehow hide unselected keychains so that users can pick which keychains they want to use and which they don’t. Perhaps I could use selection statements to see if the keychains are not position on the area of the bag, then they should not be shown when it hits the end game state.
Final Thoughts
I really love how this project turned out; it’s fun, it’s cool, and it’s pink!