5/20/2023 0 Comments Coding courses khan academyplaces an ellipse at a random location on screenĮllipse(this.x,this.y, this.diameter,this. strokeWeight(1) //causes lag when over 1įill(this.red,this.blue,een,this.alpha) setsoutline to a pinkish purple with 20% seethrough (80% alpha) I've pasted the constructor in here, but it'll likely be easier to read if you click on the link or if I could get code formatting to work on here or KA's main site. If you nest functions inside of a function then it would be considered a constructor. Learn how to program drawings, animations, and games using JavaScript & ProcessingJS, or learn how to create webpages with HTML & CSS. Was a nice vector library, however he should have done it as a single constructor. If I'm jacking it up on syntax and it is viable then please let me know. needs to be a better way than me manually calculating everything. Shows all these as viable functions of vectors. so I could put it in a function for shooting, even tried tMag(20) I was simply told that it wasn't a function. ShotTrajectory = location.add(mouseX, mouseY). I then attempted to start implementing what I learned by typing Velocity.Limit(5) or create a vector to create a target trajectory by using I took notes and everything.Īt this point I've created the var player = new PVector(x,y) etc for player, velocity, location, acceleration and target. I dedicated a couple of hours of watching videos outside of Khan Academy because there was a lack of documentation on PVector. However, I was 6 episodes by "The Code Train" on Vectors and found myself trying to impliment it into the code of a program. So I was on youtube today and I was greatly interested in PVector.
0 Comments
Leave a Reply. |