Skip to content

Commit

Permalink
Update canvas.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ntn16104 committed Dec 5, 2020
1 parent 3ae6104 commit 3403e26
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ canvas.height = window.innerHeight;
var ctx = canvas.getContext('2d');

var dddState; //global variable for DDD state
var sliderVal; //global speed for packet(s)

function drawEntities(allEntities) {
// Given a list of entities in the system, draw them to the screen
Expand Down Expand Up @@ -44,7 +45,6 @@ function runSim(packetArray, allEntities) {
}

function animatePacket(packets, allEntities) {
let sliderVal = document.getElementById('myRange').value;
let map = new Map();
map[1] = 20;
map[2] = 30;
Expand Down Expand Up @@ -129,6 +129,7 @@ async function startSimulation() {
dddState = document.getElementById('DDDstate').checked; //global variable for DDD state
let nPorts = document.getElementById('nports').value;

sliderVal = document.getElementById('myRange').value; // global speed

// Initialize the entity objects
let garbage = new Garbage(700, 400);
Expand Down Expand Up @@ -181,7 +182,6 @@ async function startSimulation() {
break;
}


// Metadata list that the animation uses to animate
let packets = [];

Expand Down

0 comments on commit 3403e26

Please sign in to comment.