import Sim from "TestBlock2.js"; import { sleep } from "/src/utils.js"; import { SIMSTATE } from "/src/enums.js"; let canvas = document.getElementById("simScreen"); let imgBackground = document.getElementById("imgBackground"); let resetHighscoresButton = document.getElementById("reset-highscores"); let modal = document.getElementById("instructions-modal"); let modalButton = document.getElementById("instructions-button"); let modalCloseButton = document.getElementById("close-instructions-modal"); let ctx = canvas.getContext("2d"); const SIM_WIDTH = 1000; const SIM_HEIGHT = 800; let sim = new Sim(SIM_WIDTH, SIM_HEIGHT); ctx.clearRect(0, 0, SIM_WIDTH, SIM_HEIGHT); sim.Populate(); let lastTime = 0; function simLoop(timestamp) { let deltaTime = timestamp - lastTime; lastTime = timestamp; ctx.clearRect(0, 0, SIM_WIDTH, SIM_HEIGHT); ctx.drawImage( imgBackground, 0, -300, SIM_WIDTH + 300, SIM_HEIGHT + 300 ); sim.update(deltaTime); sim.draw(ctx); requestAnimationFrame(simLoop); } canvas.addEventListener('click', (e)=>{ sim.HitTest({x : e.offsetX, y : e.offsetY}) }); resetHighscoresButton.addEventListener('click', (e)=>{ sim.ResetHighScores(); }) modalButton.onclick = function() { modal.style.display = "block"; } modalCloseButton.onclick = function() { modal.style.display = "none"; } window.onclick = function(event) { if (event.target == modal) { modal.style.display = "none"; } } requestAnimationFrame(simLoop);

Games and Sims

Games and Sims

Cell Types

Intensity: 0%

Monkey Opsins

Back to Top

Color Vision – The Hungry Monkey

Trichromatic monkeys can find conspicuously colored food much better than dichromats. Will you be an effective forager under dichromatic conditions? Play the game and find out!
To read an abstract of the original experiment see: Caine and Mundy 2000.

Color Vision – Find the Circle… Quickly!

Dichromatic monkeys are good at shape recognition when color-interference is high. Can you find shapes when color becomes a distractor, or are you better in dichromatic conditions? Play the game and find out!
To read an abstract of the original experiment see: Saito et al. 2005.

Mouse Fur Color

Back to Top

Fur Color – Colonizing the Beach

When mice are camouflaged in their surroundings they will likely have a better chance to reproduce and pass their color alleles down to their offspring. This simulation looks at what happens when a fur color mutation occurs in different mouse populations. How might this mutation change the phenotype frequencies when the population is under predation pressure? Play the game to find out!

 

Fur Color – The Mouse Hunter

In this simulation you get to be the predator. See how quickly you can catch a white mouse in different soil environments.

The above simulations were inspired by research conducted by Kaufman (1974) and by research being conducted at the Hoekstra lab at Harvard University. For more information visit their site: http://www.oeb.harvard.edu/faculty/hoekstra/

Garden Pea Evolution

Back to Top

Pea Taste – The Selective Farmer

The round allele R is dominant and the wrinkled allele r is recessive. Question: if you were a farmer, would it be easier to selectively breed your peas to remove the allele, or the r allele? Play this classic population genetics simulator to find out.

 

css.php
Scroll to Top