Game of Cells: CIS405 sp24 last update: 2/26/24 Current Features: Basic environment(Jared Wilson) *one cell(white) *five glucose(yellow) Movement of the Cell(Zachary Den Bleyker) *The glucose moves around the cell *as opposed to the cell moving around the glucose *to give the illusion that the cell is moving *if the glucose moves off the screen, it is moved *to a random location opposite of where it left "Eating" of Glucose (Nathan Christie) * when collision is detected glucose is removed from array * collision detection is actually a square surrounding the circle * moved player and glucose diameter to variables so they can be changed in one spot * modified for loop logic in movement to use array.length instead of constant numbers Scoring of the game(Jaylene Laurel) * When the game starts a timer also starts to keep track of how long the user has been playing. * When the cell eats a glucose a scoring count is kept, glucose has a value of 5. Game Over(Osagie Owie) * When the score is 15 or more the game ends. When 3 glucose is eaten the game is over. # changes Week 2 * code hierarchy * this allows running the game from public/index.html instead of requiring the online p5.js editor * various folders each with a specific use case, these are not set in stone and some may be added/removed as need be * config file for parameters that are likely to change * player has been moved to own class * player position is now an object of its own * player.pos = {x: number, y: number} * currently set to display at center (height/2, width/2) * player diameter and color are set by config parameters * previous global score variable is now in player.score * has a player.energy parameter but not currently used * starting energy has a config parameter * has a player.health parameter that is not currently used * player object is displayed by calling player.display() * glucose has been moved to own class * the glucose object itself contains the array of positions * glucose.add(number) will add a number of glucose objects to random positions * glucose.addAbsolute(x,y) will add a single glucose object to a specific x,y position * glucose.move(x,y) will move all glucose objects by the x and y amount * glucose.collectGlucose is the "eating" method that checks collision * this method will return a number representing how many glucose objects were collected that call * this fixes a bug where consuming 2+ glucose on a single "tick" only incremented the score by 1 * glucose.checkPositions() will check the positions of glucose and spawn them on the opposite side of the screen in a random position * checkPositions() is automatically called after movement * config object * used to store parameters that are likely to change * config.environment.worldWidth and .worldHeight to change size of playable area * config.player for player related parameters * config.glucose for glucose related parameters * config.colors for colors of objects * config.controls for control scheme, not actually implemented but I see that in a later backlog item * config.energyBar for colors and location of energy bar * Add parameters as need be * sketch.js * updated various parameters to use config parameters * movement now uses the glucose.move() method * displaying glucose and player logic have been reduced to player.display() and glucose.display() * removed many global parameters * updated to create an EnergyBar object to be displayed * EnergyBar object * Connects the energy bar to the players energy for dynamic changing of the energy bar * Displays a Two rectangles overlapping each other representing a background and foreground of the energy bar * update sketch.js (Jaylene Laurel) * updated the draw function to display the energy of the cell in the screen * updated the gameOver condition to end the game when the cell dies from starvation, that is, once the cell eats all five glucose available in the environment the cell will die after a period of time. * when the energy equals or is less than 50, it will be notified to the user that the cell is dying. * update player.js (Jaylene Laurel) * updated "this.energy" in the constructor to match its defined in the config.js so, "this.energy = config.player.defaultEnergy" * updated "this.health" in the constructor to match its defined in the config.js so, "this.health = config.player.defaulthealth" * added two new fields to the constructor to keep track of of when was the last energy update and when the energy should be updated, in this case is every 6 seconds. * updateEnergy() every 6 seconds it will decrease the cell energy by 3 Glucose to ATP Conversion (Osagie Owie) * Changed glucose value from 5 each to 1 each. * Created glucose to ATP conversion method in glucose. * Created ATP Value in sketch. # changes Week 3 (Jaylene Laurel) * continuation of code hierarchy * new folder Notification created in src folder containing the files notification.js * code clean up within classes, all .js files contain a description * update player.js * new variables added, to implement notification system. * creation of notification.js * When cell eats first glucose a pop up will be displayed * When the cell energy <= 20 it will be notifies to the user * A welcome banner is displayed when the game start * A pause banner is displayed when the game is paused * A reset game banner is displayed if the user would like to restart the game Play/Pause (Osagie Owie) * Added a Menu Screen to play from - Menu resets the game * Added a Pause feature that pauses the game * implemented a timer that plays, pauses and resets Energy Threshold Action (Osagie Owie) * Added a notification that shows when energy is over 60 Energy Cap (Jared Wilson) * Made it so that both the energy bar and the actual energy value could not go above 100% Wake (Jared Wilson) * Creates circles in front of and behind the player that pushes glucose out of the way * Ellipses can be toggled on/off in constructor and are purely visual and not functional * Added config values to adjust wake size and speed in which it pushes glucose Gradients(Zach Den Bleyker) * Creates a visual radial gradient in the background * Can be traveled over by the player * Will be used to spawn food for the cell on Glucose spawning (Nathan) * added a buffer zone to the world edges (config.environment.buffeZone) * ensure some glucose is in visible area at start * have new glucose spawn outside of the visible area * glucose.addNonVisible(n) will spawn n glucose in the buffer zone * glucose hit detection now uses straight line distance instead of (x,y) coordinates * glucose now has a new parameter: collisionDistanceSquared - the straight line distance that glucose can be from player center to detect collision * note: uses the distance squared instead of plain distance, avoid calculating square root * ie compares c^2 < a^2 + b^2 instead of c < sqrt( a^2 + b^2) * added 2 new related functions * updateDistance() updates the distance for each glucose * updateSingleDistance(index) only updates a specific glucose object distance * updateSingleDistance() is intended to be used when creating a single glucose, as the other function will check every glucose along the way * glucose.checkPositions() updated to reflect buffer zone * starting glucose will no longer spawn on top of the player when game starts textStrings.js (Nathan) * added a config/textStrings.js file * used for the various text based messages to display to user * currently only used for play/pause, "menu", and first collected glucose * when organelles start being implemented their descriptions should go into textStrings.organelles.organelleName * moved a few pre existing text strings into textStrings.js # changes Week 4 * Player (Jared) * added the ability to upgrade size using sizeUpgrade function * added the ability to get a mitochondria using mitochondriaUpgrade function * displays two red dots as the mitochondria if it has it * Wake (Jared) * Made Wake increase with size of Player * Energy Over x, Enables Eligibility to Upgrade (Osagie) * Added functionality as the player hits 60 energy, you can press 'U' to upgrade. * When upgrade is selected, the game resumes. * updated that class player.js (Jaylene) * The energy decreases by 1 with every 120 frames when the cell is not moving * The energy decreases by 1 with every 60 frames when the cell is moving # changes Week 5 * Player (Jaylene) * Added a look alike of flagella. * Cause of Death (Osagie) * added a cause of death - also added more causes of deaths but its just not being used * Wake (Jared) * Made wake be able to be constantly same size as player * EnergyBar (Jared) * Made Energy bar aligned based on canvas size * Player (Jared) * Made changes in size affect the energy drain * Player (Zach) * Organelles scale to the size of the cell * Organelle positions scale to size of the cell * Gradient (Zach) * Added a second off screen gradient * Glucose respawns on gradient off screen # changes Week 6 * Death animation (Osagie) * Added death animaiton For now, it just decreases in size * Notification (Jared) * Adjusted notifications so that individual notifications can have more variability like text size, location, and notification size * Made Menu pop up larger to fit gameplay gif * Sketch (Jared) * Added a preload function for preloading assets * Added showGameGif function for displaying gif on menu * Player (Jaylene) * Made a flagella look alike. So, whenever the player decides to upgrade a tail lookalike will appear. * organelles are read from a file and can have their function defined * minimal error checking # changes Week 7 * Player (Jaylene) * Updated the flagella movements, so now flagella takes the shortest path to align with the cell movements, has a smooth movement when following the cell. * NEW FILE: * negativeGradient.js (Zach) * shows a negative gradient on the Screen * green * spawns randomly * will cause harm to the player * two gradeints in environment * organelle File: * gives alert() for various errors with line number * name not known errors (ie cost → cst) * blank organelle name * blank organelle description * if both name and description are misssion name missing takes priority * an expected number is not a number (ie cost=randomTextThatIsntANumber) * effect's effect is not a + or * * generic error when the line is not understood (ie a line with random text) → this line gets ignored in parsing * game will attempt to recover and will use various default values but there are no promises the game will run and the user acknowledges this * tree menu: * cost and size are color coded green and red * new variables treeMenu.goodColor and treeMenu.badColor are used to define these 2 colors (Osagie) * Death Animation fade fix * Tree Menu Future organelle implementation (Jared) * Added cell membrane health display * Added ability to heal the cell using "h" (Zach) * Cell takes damage from green Gradients * Death display screen has popped reason