EECS 110 Projects 1&2 Juan Li – Project 1 Ning Xia – Project 2.

Slides:



Advertisements
Similar presentations
Introduction to Web Design Lecture number:. Todays Aim: Introduction to Web-designing and how its done. Modelling websites in HTML.
Advertisements

PART IV - EMBED VIDEO, AUDIO, AND DOCUMENTS. Find a video on Youtube.com: Search for a video, then look for the Embed code. Copy this code into the HTML/JavaScript.
JQuery MessageBoard. Lets use jQuery and AJAX in combination with a database to update and retrieve information without refreshing the page. Here we will.
KompoZer. This is what KompoZer will look like with a blank document open. As you can see, there are a lot of icons for beginning users. But don't be.
Unit 3 Day 4 FOCS – Web Design. No Journal Entry.
Editing Your Faculty Homepage  This tutorial will go through the steps for editing your Faculty homepage.  Thank you to Ryan Vyborny for letting me use.
Lets Play Catch! Keeping Score in Alice By Francine Wolfe Duke University Professor Susan Rodger May 2010.
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
Georgia Institute of Technology JavaScript part 2 Barb Ericson Georgia Institute of Technology May 2006.
This game is loosely based on the Whack-A- Mole arcade game.  Each game starts with 45 seconds of play.  Moles randomly pop out of holes on the landscape.
EECS 110: Lec 16: Projects Aleksandar Kuzmanovic Northwestern University
SVSM 2008 Mathematical Modeling.  Easy to learn  3D Interactive modeling  Python – background language  Main site
GAME:IT Junior Bouncing Ball Objectives: Create Sprites Create Sounds Create Objects Create Room Program simple game.
WinTR-20 Project Formulation Hydrology Computer Program Basic Input and Output Presented by: WinTR-20 Development Team.
WinTR-20 Project Formulation Hydrology Computer Program Basic Input and Output Presented by: WinTR-20 Development Team.
Tutorial for Arrays and Lists By Ruthie Tucker. Description This presentation will cover the basics of using Arrays and Lists in an Alice world This presentation.
© Cheltenham Computer Training 2001 Macromedia Dreamweaver 4 - Slide No 1 Macromedia Dreamweaver 4 Advanced Level Course.
GAME:IT Bouncing Ball Objectives: Create Sprites Create Sounds Create Objects Create Room Program simple game.
Making a Boat Racing Game in Alice By Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July 2010.
VIDEO GAME PROGRAMMING Video Game Programming Junior – DigiPutt INSTRUCTOR TEACHER’S ASSISTANT.
WEEK 3 AND 4 USING CLIENT-SIDE SCRIPTS TO ENHANCE WEB APPLICATIONS.
Study Guide For Test Chapter 5, 6,& 7 Test is Friday, May 15th.
Programming Games Simulated ballistic motion: cannon ball. Classwork: Final day for midterm project and all projects for first part of class. Homework:
Introduction to Arrays. definitions and things to consider… This presentation is designed to give a simple demonstration of array and object visualizations.
Forms and Server Side Includes. What are Forms? Forms are used to get user input We’ve all used them before. For example, ever had to sign up for courses.
Piñata Game: Keeping Score in Alice By Maggie Bashford Professor Susan Rodger Duke University July
1 ball, 2 ball, red ball, blue ball By Melissa Dalis Professor Susan Rodger Duke University June 2011.
Session 16 Pinball Game Construction Kit:. Pinball Version 1 Replaced the fire button with a mouse event. Multiple balls can be in the air at once. –Uses.
Mathematical Expressions, Conditional Statements, Control Structures
JavaScript - Basic Concepts Prepared and Presented by Hienvinh Nguyen, Afshin Tiraie.
Loops Robin Burke IT 130. Outline Announcement: Homework #6 Conditionals (review) Iteration while loop while with counter for loops.
1 CSC160 Chapter 7: Events and Event Handlers. 2 Outline Event and event handlers onClick event handler onMouseOver event handler onMouseOut event handler.
CIS Intro to JAVA Lecture Notes Set July-05 GUI Programming –TextField Action Listeners, JEditorPane action listeners, HTML in a JEditorPane,
MIS 3200 – Unit 5.1 Iteration (looping) – while loops – for loops Working with List Items.
Open a new Flash File Action Script 2.0. Create a button like you did last lesson and name it Click to Play.
Unit 3: Text, Fields & Tables DT2510: Advanced CAD Methods.
+ Publishing Your First Post USING WORDPRESS. + A CMS (content management system) is an application that allows you to publish, edit, modify, organize,
Computer Science I Animations. Bouncing ball. The if statement. Classwork/homework: bouncing something. Compress and upload work to Moodle.
: Information Retrieval อาจารย์ ธีภากรณ์ นฤมาณนลิณี
Today… Python Keywords. Iteration (or “Loops”!) Winter 2016CISC101 - Prof. McLeod1.
1 Agenda  Unit 7: Introduction to Programming Using JavaScript T. Jumana Abu Shmais – AOU - Riyadh.
IST 210: PHP Basics IST 210: Organization of Data IST2101.
JavaScript, Third Edition 1 SELECTION LIST Demo. JavaScript, Third Edition 2 Description This web page will edit the slection to ensure an option was.
111 State Management Beginning ASP.NET in C# and VB Chapter 4 Pages
Comp1004: Introduction III Java. Content How Java Works: The JVM Writing a Class in Java – Class – Member Variables – Method – Statement Magic incantations.
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
TechKnowlogy Conference August 2, 2011 Using GoogleDocs for Collaboration.
Martin Norris Computing Teacher/Leader at Moldgreen Community Primary School, Huddersfield
Into 3D with VPython Deepak Mishra MS-IT IIIT Hyderabad.
A little PHP.
Images, Hyperlinks, and Sound
CHAPTER 10 JAVA SCRIPT.
MOM! Phineas and Ferb are … Aims:
Aleksandar Kuzmanovic Northwestern University
Introduction To Flowcharting
Introduction to Events
This week's classes Connect 4 aiMove
This week's classes Connect 4 Player
More Selections BIS1523 – Lecture 9.
Chapter 10 Algorithms.
Chapter 10 Algorithms.
Arrays
Images, Hyperlinks, and Sound
Using Lists and Functions to Create Dialogue
Home page for CIS44..
Game Over Module 4 Lesson 2.
CSWA Provider: Program and Tech Review
Chapter 10 Algorithms.
MIS 3200 – Unit 5.1 Iteration (looping) Working with List Items
Presentation transcript:

EECS 110 Projects 1&2 Juan Li – Project 1 Ning Xia – Project 2

Option #1, vPool Table Cue (optional) Cue ball Billiard Ball (at least 2) Hole (optional)

Option #1: virtual pool VPython? Easily installable for windows… Not (really) installable for the Mac A simple example from visual import * c = cylinder() What's visual? What's c?

Option #1: virtual pool from visual import * floor = box( pos=(0,0,0), length=4, height=0.5, width=4, color=color.blue) ball = sphere( pos=(0,4,0), radius=1, color=color.red) ball.velocity = vector(0,-1,0) dt = 0.01 while True: rate(100) ball.pos = ball.pos + ball.velocity*dt if ball.y < ball.radius: ball.velocity.y = -ball.velocity.y else: ball.velocity.y = ball.velocity.y - 9.8*dt How many classes? How many objects? data members? What's the if/else doing?

Option #1: virtual pool Phunky Fisicks is welcome! Collisions with walls? Collisions with other pool balls? Pockets?

Option #1: virtual pool To start, just design your table, try to construct a scene which consists of the following objects: - table – made of walls, box objects - holes (optional) – use sphere objects - cueBall – another sphere - cue (optional) – cylinder object - billiard balls (at least 2) – sphere objects - you also should take a look at label objects to display game texts After you place all the objects you should have something similar to …

Option #1: virtual pool

Your main game loop should basically consist of: while gameOver == False: m = scene.mouse.getclick() #click event – cue hit # get mouse position and give the cue ball a direction # based on that # perform movement of the cue ball as shown before # handle collisions between different balls and # between balls and walls # check if game is over – when all balls have # been put in

Option #1: virtual pool Directing the cue ball: temp = scene.mouse.project(normal=(0,1,0), point=(0,-side,0)) this gets a vector with the projection of the mouse on the pool table. if temp: # temp is None if no intersection with pool table cueBall.p = norm(temp – cueBall.pos) The cue ball direction is now given by the vector that results from the difference of the point where we clicked projected on the pool table and the actual position of the cue ball So clicking in front of the cue ball will make it go into that direction.

Option #1: virtual pool Moving the cue ball: dt = 0.5 t = 0.0 while dt > 0.1: sleep(.01) t = t + dt dt = dt-dt/200.0 cueBall.pos = cueBall.pos + (cueBall.p/cueBall.mass)*dt We basically start with a bigger movement increment (0.5), move the ball in the direction we computed with the specific increment. Each time decrease the increment to account for drop in velocity. Stop at some point (0.1)

Option #1: virtual pool Handling collisions: With walls: if not (side > cueBall.x > -side): cueBall.p.x = -cueBall.p.x if not (side > cueBall.z > -side): cueBall.p.z = -cueBall.p.z When hitting wall, change directions

Option #1: virtual pool When is a ball in? if math.sqrt(math.pow(abs(ball1.x-hole1.x),2) + math.pow(abs(ball1.z-hole1.z),2)) <= hole1.radius*2: ballin = 1 ball1.visible = 0 ball1.y = 50 Holes are just spheres so we determine intersection between ball and hole same way as for different balls. When ball is in we do a few things: Signal that a ball has been put in (might be useful later) Make the specific ball invisible Move it out of the way

Option #1: virtual pool Handling the game logic? Need a way to keep track of players taking turns. Suggestion: use a simple variable for that which changes after every hit (take into account if balls have been sunk or not) Players need to be aware of the game flow, so show labels that display which player has turn, when the game was won and by whom The game is finished when all the balls are in, that is when all the balls are invisible. You can use that for check.

Project #2: text clouds tag cloud

Project #2: text clouds text cloud Summary of the words in a body of text, sized and painted according to their frequency. Demos: or on:

Text-cloud history

Project #2: text clouds From text… … to cloud 1.Start with entered webpage (URL) 2.Read in text 3.Create list of words out of text 4."Clean" the words 5."Stem" the words 6.Count the words 7.Return a string with frequencies 8.Add advanced features…

Text Clouds, an example project2/page1.html Spamming spammers spammed spam. Spam spam spam! I love spam! Page 2Page 2 ignore this link for now ['spamming', 'spammers', spammed', 'spam', 'spam', 'spam', 'spam', 'love', 'spam', 'page', '2'] ['spamming', 'spammers', spammed', 'spam.', 'spam', 'spam', 'spam!', 'I', 'love', 'spam!', 'page', '2'] ['spam', 'spam', spam', 'spam', 'spam', 'spam', 'spam', 'love', 'spam', 'page', '2']

Project #2: text clouds An Approach Develop the basic application the usual way (IDLE) Once you have everything working, transfer your.py files to your webspace. Set up the HTML wrapper files & go! Use our code to read HTML, but don't bother writing it yet… Personalize! The project has a number of references… Once you have things working, try writing HTML/searching beyond depth 1/etc (NEXT SLIDE)

Project #2: searching beyond depth 1 def mtcURL(url): toVisit[url] = 0 #toVisit is a dictionary visited[url] = 1 #visited is a dictionary returnText = '' while len(toVisit) != 0: [url, depth] = toVisit.popitem() [textSite, listUrls] = getHTML(url) An Approach (1/2)

Project #2: searching beyond depth 1 … for urlItem in listUrls: if visited.has_key(urlItem) == False \ and depth < DEPTH: visited[urlItem] = 1 toVisit[urlItem] = depth + 1 wordList = textSite.split() … An Approach (2/2)

Questions?