Computer Science I Slingshot example. ProcessingJS example. Review for midterm quiz. Classwork/Homework: study for midterm. Work on midterm project.

Slides:



Advertisements
Similar presentations
Creative Computing. \\ aims By the end of the session you will be able to: 1.Move objects around 2.Write simple interactive programs 3.Use the mouse position.
Advertisements

IS660Z Programming Games Using Visual Basic Overview of Cannonball.
Visual Basic: ballistics
Game with US Beginner Tutorial. Welcome!! Who I am What is Processing? Basic Coding Input Methods Images Classes Arrays.
Emerging Platform#5: Processing 2 B. Ramamurthy 6/13/2014B. Ramamurthy, CS6511.
Introduction to Animation Programming Our next set of exercises will look at animation on the following link:
Aim: Use the given examples to record examples and our own ideas in our journal 1.Write technical examples in journal and/or participate in full.
CIS101 Introduction to Computing Week 05. Agenda Your questions CIS101 Survey Introduction to the Internet & HTML Online HTML Resources Using the HTML.
Programming Introduction November 9 Unit 7. What is Programming? Besides being a huge industry? Programming is the process used to write computer programs.
UWWD In our quest to eliminate bad websites, we present…. HALLELUJAH!!
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 21: Publishing Your Pages on the Web.
Creating a Web Page HTML, FrontPage, Word, Composer.
Javascript & HTML5 Intro. Why Javascript? Next big thing in online games Flash is slowly on its way out Can be coded via any text editor, flash costs.
Programming Games Computer science big ideas. Computer Science jargon. Show virtual dog Homework: [Catch up: dice game, credit card or other form.] Plan.
Create Interfaces College exercise. Continue HTML5: HTML5 logo, drawing images. Coin toss. Homework: acquire video & audio.
Foundation Programming Introduction. Aims This course aims to give students a basic understanding of computer programming. On completing this course students.
Programming games Recap. Upload work (Filezilla, index.html). Drawing lines. Drawing stars. Homework: Drawing exercises.
Programming Games Show your cannonball. HTML5 video. Miro. Classwork/Homework: Acquire video, convert to multiple formats, and produce simple (just html)
Locally Edited Animations We will need 3 files to help get us started at
1 k Jarek Rossignac,  2008 Processing  Install Processing  Learn how to edit, run, save, export, post programs  Understand.
Programming Games Simulated ballistic motion: cannon ball. Classwork: Final day for midterm project and all projects for first part of class. Homework:
Programming Games Show your simple video. More video examples. Audio. Classwork/Homework: Produce more complex video program.
Processing.js.
Programming Games Show project. Refresher on coordinates. Scaling, translation. HTML5 logo. Refresher on animation. Bouncing ball. Homework: Do your own.
Programming games Show your version of Bo the dog. Start cannonball Preview: video, audio work session (cannonball) Homework: Cannonball with ball in a.
Programming Games Reprise on drawing on canvas. Jargon (concepts): objects. Demonstrate slingshot. Mouse events. Work on your cannonball. Homework: Finish.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 02b: Tutorial for Programming in Processing Jarek Rossignac.
Notes Chapter 10—Adding Graphics. There are two kinds of graphics on the Internet: those you can use on your own Web pages, and those you cannot.  Many.
CIS 3.5 Lecture 2.2 More programming with "Processing"
Lesson Two: Everything You Need to Know
Programming games Problems. Schedule Various examples. Homework: rps, bo (don't go back to do this), cannonball, Video or Audio should be complete. Now.
Physics Projectile Motion What happens to an object when it has combined horizontal and vertical motion?
Programming games Context of what we are doing. Drawing on canvas. Homework: [Complete coin toss examples.] Do your own drawings. Upload files to website.
Programming Games Logic. Slide show. Range input. Storage. Datatypes. Binary numbers. Homework: Catch up. This includes uploading projects to your server.
Computer Science I Classes and objects Classwork/Homework: Examine and modify my examples. Make your own.
Computer Science I Programming in Java (programming using Processing IN Java, using IntelliJ IDE) Classwork/Homework: copy your Processing projects over.
Computer Science I Arrays. Parallel structures. Classwork/Homework: Build your own bouncing things.
Computer Science I Recap: variables & functions. Images. Pseudo-random processing.
Computer Science I Looping. User input. Classwork/Homework: Incorporate looping & user input into a sketch.
COP3502: Introduction to Computer Science Yashas Shankar Midterm review.
Computer Science I Share plans for virtual something. Text. Show my virtual dog. Classwork: Plans for your virtual something. Homework: start implementation.
JavaScript 101 Introduction to Programming. Topics What is programming? The common elements found in most programming languages Introduction to JavaScript.
Programming Games Reprise: credit cards. Show video projects. Demonstrate Find Daniel and Virtual Dog. Homework: [Catch up.] Post proposal for your JavaScript.
PHP Form Processing * referenced from
1 SIC / CoC / Georgia Tech MAGIC Lab Rossignac Processing  Install Processing  Learn how to edit, run, save, export,
Computer Science I Animations. Bouncing ball. The if statement. Classwork/homework: bouncing something. Compress and upload work to Moodle.
Computer Science I Looking at code: "Where did Prof. Shablinsky go" Classwork/homework: midterm projects.
Computer Science I More class examples. Paths. Jigsaw. Tolerance. Classwork/homework: Your class project. Post proposal for midterm project.
Time to upload Virtual something.
Creating User Interfaces VoiceXML. Examples. Classwork/Homework: Make proposal and start work on your VoiceXML project.
Computer Science I Libraries. Sound. Saving frames as images. Classwork/Homework: Make sketch using sound. Add saving frames.
Creating User Interfaces Reprise on guest speaker. Usability checklists. Reprise on user- centered. Semantic tags. Responsive design. Classwork/homework:
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
School of Computer Science Space School 2015 Programming a Lunar Lander Game.
Index Background Costumes Making object walk smoothly Controlling an object with the keyboard Control an object with the mouse Changing costume when hit.
Computer Science I Adding a timing feature. Classwork/Homework: finish final project. Prepare for review for final. Post on programming topic.
Programming Games Work / finish and show dice game. Extras. Timed events. ftp. index file. Homework: Catch up and do slide show.
Classwork: Examine and enhance falling drop(s) or make your own.
Loops BIS1523 – Lecture 10.
Computer Science I Fonts. Building on one jigsaw to make another.
Flight prices.
Objective Understand web-based digital media production methods, software, and hardware. Course Weight : 10%
Introduction to Problem Solving & Programming using Processing 2
Introduction to Problem Solving & Programming using Processing 2
Programming games Demonstrate cannonball
Programming games Share your plans for your virtual something.
Programming Games Reprise on drawing on canvas. Jargon (concepts): objects. Demonstrate slingshot. Mouse events. Work on animation project. Homework: Finish.
Programming Games Refresher on coordinates. Scaling, translation. HTML5 logo. Refresher on animation. Bouncing ball. Show project. Classwork/Homework:
Introduction to Problem Solving & Programming using Processing 2
Presentation transcript:

Computer Science I Slingshot example. ProcessingJS example. Review for midterm quiz. Classwork/Homework: study for midterm. Work on midterm project.

Slingshot Background: I have done cannonball and then slingshot examples in Visual Basic, Flash, JavaScript and now Processing. Historically: determining ballistic paths for weapons was one of first applications for computers (computer-like machines).

Basic approach Determine initial horizontal and vertical displacements. Each iteration, in simplest model, horizontal displacement does not change. Each iteration, determine new vertical displacement based on gravitational pull. – Average vertical displacement at start and end of interval. That is the displacement used. – Change old vertical displacement to new value. Determine if rock (missile) hits target. Determine if rock hits ground.

Note Certain variables (gravity, adjust) defined to make a nice arc…. I could, with some work, really simulate gravity.

Slingshot Player uses mouse to pull back on slingshot. Upon release, calculation of initial horizontal and vertical displacements. Continue with ballistic simulation. – Check for hitting the chicken. – Check for rock traveling outside of window. This could be changed to hitting the ground. Note: this is done using just the vertical value.

Planning Used classes EVEN THOUGH I just had one of everything: – Slingshot – Rock – Picture Each of child classes of a Thing class. Each subclass has its own show method. An array, named scene, holds all the things in a scene.

Examine code Defined [my] Thing, Rock, Slingshot, Picture classes. Defined setup, draw, mousePressed, mouseReleased – Note: the draw uses the current values of mouseX and mouseY to pull back on the slingshot. My code does not use mouseDragged. Defined [my] calculateSpeeds, simulateRockInAir – Note these functions called from just one place.

My iterations Wrote Thing class and then Slingshot extends Thing, but not with all the methods. – Decided to define a slingshot by 5 points, with one center tx, ty and the others all relative to the base. This took a few times. Added Rock. Added scene array. Added Chicken, but didn't do much with it for a time. Did plan ahead to swap in feathers. Worked to get mouse to pull back moving both "pocket" of slingshot and rock. Calculation of initial speeds and then iteration. – Took time, adjusted adjust and gravity values! Added hits method for Picture, so hit requires rock to be really on the chicken! Added simple test for rock to stop at bottom of window. – Had idea of adding Turf class to be pieces of ground—to make ground lumpy. Changed order of objects in scene array so myRock is visible on the chicken.

Processingjs Way to run Processing on (in) a browser. Sister project to Processing. Note: there was an older way to produce applications that was discontinued.

Steps Produce Processing sketch in normal way. – You will be uploading the.pde file and anything in the data folder Download latest file(s) from processingjs.org – I used processing.min.js Create a small html file (see next) Use ftp program such as Filezilla to upload files to your website

The minimum html file <canvas data-processing-sources ="makePathThenImageTravel.pde">

My html file: imageTravel.html Biker chick <canvas data-processing-sources ="makePathThenImageTravel.pde">

Files to be uploaded makePathThenImageTravel.pde processing.min.js bikerchickWGrant.jpg imageTravel.html

Access on the web … usual way, by a URL ocessingJS/imageTravel.html ocessingJS/imageTravel.html

Aside The slingshot program does not work in ProcessingJS!!!! The chicken is not hit… Extra credit opportunity for anyone figuring out the problem. I have posted on a Processing Forum.

p5js Something else: Different language combining Processing and JavaScript – Weak typing: var statements, not datatypes. – Claim: faster executing code – An IDE in development. Now use Sublime, other text editor

Questions for midterm quiz Study guide Review lecture charts ?

Classwork/Homework [Post proposal. Look for my response.] Work on midterm project.