Class Notes (811,169)
CMPT 166 (9)
Lecture

# CMPT 166 May 27.docx

2 Pages
116 Views

School
Simon Fraser University
Department
Computing Science
Course
CMPT 166
Professor
John Edgar
Semester
Summer

Description
CMPT 166 Gravity and Elasticity Objects accelerate under gravity  9.8 m/s^2  speed to increase  add a constant value to dy each time we dy  To bounce, we can reverse dy Elasticity is a measure of how much something is going to bounce Float y = 0; Float x = 0; Float easing = 0.06; Float diameter = 0; Void setup(){ Size(500, 500); Smooth (); } Void draw (){ // easing(); speed1 (); Background (0); Float targetX= mouseX; Float targetY= mouseY; //if (abs(target – x) >1) x += (target –x); y += (target –y); fill (153); ellipse(mouseX, mouseY, 20, 20); fill(225); ellipse(x,y,40,40) // } Changing the value of easing will change the behavior of the white ball
More Less

Related notes for CMPT 166

OR

Don't have an account?

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Join to view

OR

By registering, I agree to the Terms and Privacy Policies
Just a few more details

So we can recommend you notes for your school.