- creating the pong bat animation with various options

Similar documents
Lab 5: Descriptive Statistics

Complete Wristband System Tutorial PITCHING

How to Count Frequency of Text in Excel (Using VBA)!

ROSE-HULMAN INSTITUTE OF TECHNOLOGY Department of Mechanical Engineering. Mini-project 3 Tennis ball launcher

3. EXCEL FORMULAS & TABLES

3. EXCEL FORMULAS & TABLES

Excel Solver Case: Beach Town Lifeguard Scheduling

Multi Class Event Results Calculator User Guide Updated Nov Resource

BIOL 101L: Principles of Biology Laboratory

INSTITUTE AND FACULTY OF ACTUARIES. Curriculum 2019 AUDIT TRAIL

Course Deviation to Find Stronger Lift (No Wind)

Step 1. CoderDojo Milltown Exercise 1 Pong Page 1 of 13

PRESSURE DROP CHARTS

Nervous System: Reaction Time Student Version

In my left hand I hold 15 Argentine pesos. In my right, I hold 100 Chilean

Allocation of referees, hours and pistes User manual of Engarde - August, 2013

ME 4710 Motion and Control: Integrator Wind-up Reference: Franklin, Powell, Emami-Naeini, Feedback Control of Dynamic Systems, Prentice-Hall, 2002.

INSTRUCTION FOR FILLING OUT THE JUDGES SPREADSHEET

NCSS Statistical Software

Hydrus 1D Tutorial. Example: Infiltration and drainage in a large caisson. 1) Basic model setup. Sebastian Bauer Geohydromodellierung

FUNCTIONAL SKILLS MATHEMATICS (level 1)

EXPLOSIVE STORAGE CAPACITY CALCULATING TOOL USER MANUAL

MTB 02 Intermediate Minitab

Ping Pong Rules Legal Service

Microsoft Excel To Model A Tennis Match

INTRODUCTION Page 2 SETTINGS

You are to develop a program that takes as input the scorecard filled out by Bob and that produces as output the correct scorecard.

3. Select a colour and then use the Rectangle drawing tool to draw a rectangle like the one below.

THE 2018 ROSENTHAL PRIZE for Innovation in Math Teaching. Geometry Project: DARTBOARD

Wave Load Pattern Definition

Background Information. Project Instructions. Problem Statement. EXAM REVIEW PROJECT Microsoft Excel Review Baseball Hall of Fame Problem

BOWRAP BOWLING LEAGUE FIXTURE GENERATION

The ICC Duckworth-Lewis Calculator. Professional Edition 2008

Experimental Procedure

Tension Cracks. Topics Covered. Tension crack boundaries Tension crack depth Query slice data Thrust line Sensitivity analysis.

Activities for Measuring Acceleration and Deceleration due to Gravity and Friction. Grade Level: Middle School

Forehand Drive Table Tennis Teaching Points

Tutorial 6a Manual Digitisation

KISSsoft 03/2016 Tutorial 9

ASTER ELECTRONIC INTERACTIVE TABLE TENNIS GAME

Pythagorean Combinations for LEGO Robot Building

The ICC Duckworth-Lewis-Stern calculator. DLS Edition 2016

LEGO Engineering Conferences ROBOLAB and MINDSTORMS Education Version 4.5 March 2008

Combination Analysis Tutorial

TENNIS SPORT RULES. Tennis Sport Rules. VERSION: June 2018 Special Olympics, Inc., All rights reserved.

2012 CALIFORNIA PHYSICAL FITNESS TEST. e-template REFERENCE GUIDE

Calculation of Trail Usage from Counter Data

How to run a club night

1 Why use a Tagging Panel?

Tie Breaking Procedure

Orange County HMIS HPRP QPR Quick Reference Guide

IEEE SoutheastCon 2007

Effective Use of Box Charts

January Thank you for choosing Blackwood Tennis.

LABORATORY EXERCISE 1 CONTROL VALVE CHARACTERISTICS

Module 3 Developing Timing Plans for Efficient Intersection Operations During Moderate Traffic Volume Conditions

GUIDE TO THE ARCTIC SHIPPING CALCULATION TOOL

You are going to learn how to make a game, in which you ll use the mouse to navigate a boat to a desert island.

ORF 201 Computer Methods in Problem Solving. Final Project: Dynamic Programming Optimal Sailing Strategies

Release Notes Podium, the Performance Manager

SCHEMATIC MANOEUVRE ILLUSTRATIONS SCHEDULE F-19

Evaluation of aerodynamic criteria in the design of a small wind turbine with the lifting line model

AIRMOUNT VIBRATION ISOLATION

Advanced Hydraulics Prof. Dr. Suresh A. Kartha Department of Civil Engineering Indian Institute of Technology, Guwahati

Rules of Badminton. So make a point that you understand the Basic Badminton Rules before stepping into the Badminton Court next time...

State of Iowa Physics Competition OFFICIAL RULES FOR REGIONAL (AEA) AND STATE COMPETITIONS. Rules/Advisory Committee

Tru Flight TRUFLIGHT INSTALLATION GUIDE TRUGOLF.COM

ALGE Water Polo Scoreboard

Walk - Run Activity --An S and P Wave Travel Time Simulation ( S minus P Earthquake Location Method)

WMS 8.4 Tutorial Hydraulics and Floodplain Modeling HY-8 Modeling Wizard Learn how to model a culvert using HY-8 and WMS

Module 3: Hydrostatic forces on submerged bodies Lecture 7: Calculation of horizontal component, buoyancy. Forces on submerged bodies (continued)

BEFORE YOU OPEN ANY FILES:

2018 ASABE Student Robotics Challenge

Hot Springs Village Member Portal User Guide

Boat Race. Introduction. Scratch. You are going to learn how to make a game, in which you ll use the mouse to navigate a boat to a desert island.

TECHNICAL NOTE HOW TO USE LOOPERS. Kalipso_TechDocs_Loopers. Revision: 1.0. Kalipso version: Date: 16/02/2017.

1. OVERVIEW OF METHOD

Golden Spiral. A Chaparral grafix tutorial

Evaluation and Improvement of the Roundabouts

Class 1: Class session: 1 Class Purpose: Introduce the class and understand students Fill out the Low Risk Form

3D Inversion in GM-SYS 3D Modelling

Simple Fighting Wings 2.0

SIDRA INTERSECTION 6.1 UPDATE HISTORY

Tutorial: Setting up and importing Splat Maps from World Machine

Tutorial 2 Time-Dependent Consolidation. Staging Groundwater Time-dependent consolidation Point query Line query Graph Query

Flash Point Calculation by UNIFAC

INSTRUCTIONS FOR NAVIGATING TOPDOG

Background Summary Kaibab Plateau: Source: Kormondy, E. J. (1996). Concepts of Ecology. Englewood Cliffs, NJ: Prentice-Hall. p.96.

ADVANCED. CATIA V5 Workbook. Knowledgeware and Workbenches. Release 16. Knowledgeware. Workbenches. Richard Cozzens. Southern Utah University

Boat Race. Introduction. Scratch

The Agility Association of Canada

SG36KTL-M Quick Installation Guide. 1 Unpacking and Inspection

INDIAN INSTITUTE OF TECHNOLOGY ROORKEE NPTEL NPTEL ONLINE CERTIFICATION COURSE. Refrigeration and Air-conditioning

For clarification or assistance with TDM-web or any USTA web-based application,

Guidelines for Using the UMTRI ATD Positioning Procedure for ATD and Seat Positioning

TrackMan Operator Training

Working with Marker Maps Tutorial

1. First start a new scratch project and remove the default sprite.

09 - Choosing /sizing a cylinder and valve

Populating Custom Excel Spreadsheets: The Non-DDE Way

Transcription:

Excel PONG Tutorial #2 by George Lungu - creating the pong bat animation with various options -In this tutorial (which is a continuation of part#1) two bat input parameters are added to the model: bat size and bat stroke. - Two bats will be created and added to the chart, the opponent s bat (bat #1) and the player s (bat#2). For now, whereas the player s bat will be able to move with the mouse, the opponent s bat will be fixed in place. - While horizontally the bats are fixed, an extra condition will be added so that the bats are vertically restricted to the tennis court (or table) <www.excelunusual.com> 1

11. Add three input parameter buttons and VBA macros: - Copy and paste the worksheet. Rename the new worksheet Pong_Tutorial_2. - Write the following worksheet macros and add the following spin buttons: => Bat_Stroke with a range of [1,10] => Serve_Speed with a range of [1,20] => Bat_Size with a range[0,5] Sub Bat_Stroke_Change() [P8] = Bat_Stroke.Value End Sub -------------------------------------------------- Private Sub Serve_Speed_Change() [P10] = Serve_Speed.Value End Sub -------------------------------------------------- Private Sub Bat_Size_Change() Dim BArr As Variant BArr = Array(2, 5, 10, 15, 20, 40) [P12] = 10 * BArr(Bat_Size.Value) End Sub - Don t forget to write the parameter labels like in the snapshot above <www.excelunusual.com> 2

<www.excelunusual.com> 3 12. Upgrade the bat macro (add stroke scaling): Sub Bat_Tutorial_2() Dim Pt0 As POINTAPI - Firstly, copy the Bat_Tutorial_1 macro and rename the copy Dim Pt1 As POINTAPI Bat_Tutorial_2. In the new macro, the relative mouse position pasted RunPause = Not RunPause in cell S6 is the old value multiplied by the bat stroke. The old value GetCursorPos Pt0 (produced by the old Bat macro) was the difference between the number Do While RunPause = True of display rows of the spot the mouse was clicked at the start of the DoEvents macro (somewhere on top of the Bat button) and the number of display GetCursorPos Pt1 rows corresponding to the current position of the mouse. [S6] = [P8] * (-Pt1.Y + Pt0.Y) - This will scale the bat stroke by a number between 1 and 10 and allow Loop the player to choose a stroke adequate to his or her own playing style. End Sub 13. Allocate a cell with the opponent s bat position information: - We already used cell S6 for the player s bat coordinate (bat #2). - Allocate cell S5 for the opponent s bat position information (fill it out with a zero for now). - Use range R5:R6 to label the bat coordinate information.

14. Create court-limited bat coordinates: - Both bats vertical positions are measured from the horizontal median line of the court (ping pong table). - The limited coordinate calculations will limit the bat movements so that no bat part can exceed the limit of the court. The formulas will limit the maximum bat coordinate to the half the width of the court minus half the bat size. Similarly the minimum bat coordinate will be limited to minus half the width of the court width plus half of the bat size. U4: =SIGN(S5)*MIN(ABS(S5),(V$10-P$12)/2) U5: =SIGN(S6)*MIN(ABS(S6),(V$10-P$12)/2) 15. Create the bat geometry tables: - Cell Y12 will contain the bat thickness (chosen to 2.5 by trial and error you can change it later). - The bats are built like snakes (see next page) since we like our bats to be about three times larger than the maximum thickness of the line allowed on an Excel chart. - More details about the way the bats are build are on the next page. <www.excelunusual.com> 4

Limited Bat #1 Position Width Bat Size Limited Bat #2 Position How the bats are defined: Pong Court B C F (0,0) zero A D E Bat Thickness Players_in Length Players_in - After the bats are charted on the same chart with the court using the thickest line, the bat thickness must be increased as much as possible as to keep the block appearance (the snake gaps must be filled). <www.excelunusual.com> 5

<www.excelunusual.com> 6 16. Chart the bats on the Court chart: - Add two new series on the chart and name them Bat#1 and Bat#2 - Use the data from Bat#1_Geometry and Bat#2_Geometry tables of data respectively - After adding the series double click on them one by one and do the following operations: => increase the line weight to maximum => change the color to your preference - After you finish, run the Bat macro and while the macro is running, play with the bat settings and observe their effects. Feng Tianwei Singapore