Difference between revisions of "IB Computer Science 1"

From WLCS
(Thursday (10/24/19))
(48 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Thursday (10/24/19) ==
+
== Friday (12/6/19) ==
 
'''Agenda:'''
 
'''Agenda:'''
* Turn in Group 4 Project permission slips
+
* Complete the "Top-Down" Perspective Game (Robots / Item Collection Game)
* Functions quiz on '''Wednesday (10/30/19)'''
 
* Complete Basic Pool: Part 1
 
*# Make the background green
 
*# Create a randomly located white ball on the screen with dx and dy both set to 0 so that it is not moving; however both its x and y coordinates should be random. You can generate random numbers using [https://py.processing.org/reference/random.html random(low, high)]
 
*# As soon as the mouse button is pressed, make the ball stop where it is (set dx and dy to 0).
 
*# While the mouse button is being held down, draw a red line from the middle of the ball to the mouse pointer
 
*# Releasing the mouse changes the ball's velocity (dx and dy variables) using the differences between (x, y) and (mouseX, mouseY).  i.e. the larger the green line, the faster the ball should move.  If the speed is too fast, you can try shrinking the difference by dividing by 10 or another number
 
*# As the ball moves around the screen, it should properly bounce off the edges
 
*# Add a non-white second ball on the screen that is not moving, but randomly located. You can generate random numbers using [https://py.processing.org/reference/random.html random(low, high)]
 
*# To detect if the two balls ever collide, check the distance between their centers (x, y) and (x2, y2).  If the distance is less than the sum  of their two radii (r1 + r1), then there is a collision.  Add a collision checking if-statement that temporarily changes the fill color of the balls to red if they collide, otherwise change it back to white
 
*# Challenges:
 
*#* Play around with stroke weight and color
 
*#* Add friction (you'll need to create new variables) to slow down the ball
 
  
== Tuesday (10/22/19) ==
+
== Wednesday (12/4/19) ==
 
'''Agenda:'''
 
'''Agenda:'''
* Turn in Group 4 Project permission slips!
+
* Group 4 Project Field Trip
* Submit [https://docs.google.com/document/d/1wfVoej_7PVHquaAcugEr5YWZIzbKPNl8YYKlp7Gfouo/edit?usp=sharing Mouse Variables & Functions] notes tables to Canvas
+
** Complete the [https://goo.gl/forms/0ya5UJ6KdVJvDvJF3 Group 4 Project Reflection]
* Assignment demos:
+
* Complete the "Top-Down" Game (Robots / Item Collection Game) if you are not attending the field trip today
** [https://docs.google.com/document/d/1i6iUV20KXDF_yKr4mn5X4JQQPc4hF7lklkp5DlDpMCE/edit?usp=sharing Functions: Hover Buttons]
 
** [https://docs.google.com/document/d/1wfVoej_7PVHquaAcugEr5YWZIzbKPNl8YYKlp7Gfouo/edit?usp=sharing Mouse Variables & Functions: Part 2]
 
* Complete [https://docs.google.com/document/d/1xRSA_Ti8l5002jcAftcUtCTdujCojghzoTpUZwJvHQ4/edit?usp=sharing Bouncing Ball]
 
* Complete Basic Pool: Part 1
 
*# Make the background green
 
*# Create a randomly located white ball on the screen with dx and dy both set to 0 so that it is not moving; however both its x and y coordinates should be random. You can generate random numbers using [https://py.processing.org/reference/random.html random(low, high)]
 
*# As soon as the mouse button is pressed, make the ball stop where it is (set dx and dy to 0).
 
*# While the mouse button is being held down, draw a red line from the middle of the ball to the mouse pointer
 
*# Releasing the mouse changes the ball's velocity (dx and dy variables) using the differences between (x, y) and (mouseX, mouseY).  i.e. the larger the green line, the faster the ball should move.  If the speed is too fast, you can try shrinking the difference by dividing by 10 or another number
 
*# As the ball moves around the screen, it should properly bounce off the edges
 
*# Add a non-white second ball on the screen that is not moving, but randomly located. You can generate random numbers using [https://py.processing.org/reference/random.html random(low, high)]
 
*# To detect if the two balls ever collide, check the distance between their centers (x, y) and (x2, y2).  If the distance is less than the sum  of their two radii (r1 + r1), then there is a collision.  Add a collision checking if-statement that temporarily changes the fill color of the balls to red if they collide, otherwise change it back to white
 
*# Challenges:
 
*#* Play around with stroke weight and color
 
*#* Add friction (you'll need to create new variables) to slow down the ball
 
  
== Friday (10/18/19) ==
+
== Monday (12/2/19) ==
 
'''Agenda:'''
 
'''Agenda:'''
* Prepare to demo [https://docs.google.com/document/d/1i6iUV20KXDF_yKr4mn5X4JQQPc4hF7lklkp5DlDpMCE/edit?usp=sharing Functions: Hover Buttons] next class
+
* [https://drive.google.com/open?id=1s1zAquCP4iF_xO68JnPcziVuv-RzVOwv Group 4 Project Field Trip Logistics!]
* More advanced mouse variables and functions:
+
* "Top-Down" Perspective Game (Robots / Item Collection Game) - complete and demo this week
** Complete the table found in [https://docs.google.com/document/d/1wfVoej_7PVHquaAcugEr5YWZIzbKPNl8YYKlp7Gfouo/edit?usp=sharing Mouse Variables & Functions]
+
** This next game will use a top-down perspective and be a variation of many games that you might have played in the past
** Complete the Part 2 activity in [https://docs.google.com/document/d/1wfVoej_7PVHquaAcugEr5YWZIzbKPNl8YYKlp7Gfouo/edit?usp=sharing Mouse Variables & Functions]
+
** The keyboard will move the player around (WASD or arrow keys)
* Complete [https://docs.google.com/document/d/1xRSA_Ti8l5002jcAftcUtCTdujCojghzoTpUZwJvHQ4/edit?usp=sharing Bouncing Ball]
+
** The player must collect 5 or more items on the screen. Collecting all the items wins the game.
* Complete Basic Pool: Part 1
+
** The player must avoid colliding with at least 3 enemy robots that follow it around. Colliding with a robot loses the game
*# Make the background green
+
** There is a timer counting down, and the player must collect all the items before it hits 0. Otherwise, the player loses.
*# Create a randomly located white ball on the screen with dx and dy both set to 0 so that it is not moving; however both its x and y coordinates should be random. You can generate random numbers using [https://py.processing.org/reference/random.html random(low, high)]
+
** The screen wraps around (e.g. player moving off screen to the left appears on the right)
*# As soon as the mouse button is pressed, make the ball stop where it is (set dx and dy to 0).
+
* Additional challenges:
*# While the mouse button is being held down, draw a red line from the middle of the ball to the mouse pointer
+
** Robots that collide with each other become disabled "land mines"
*# Releasing the mouse changes the ball's velocity (dx and dy variables) using the differences between (x, y) and (mouseX, mouseY).  i.e. the larger the green line, the faster the ball should move.  If the speed is too fast, you can try shrinking the difference by dividing by 10 or another number
+
** Attack ability so that player can fight back a robot
*# As the ball moves around the screen, it should properly bounce off the edges
+
** Health meter for the player
*# Add a non-white second ball on the screen that is not moving, but randomly located. You can generate random numbers using [https://py.processing.org/reference/random.html random(low, high)]
+
** Levels that increase in difficulty (e.g. add more robots)
*# To detect if the two balls ever collide, check the distance between their centers (x, y) and (x2, y2).  If the distance is less than the sum  of their two radii (r1 + r1), then there is a collision.  Add a collision checking if-statement that temporarily changes the fill color of the balls to red if they collide, otherwise change it back to white
+
** Warp doors - the player going through the door appears at the other door
*# Challenges:
+
** An invincibility or shield power-up item
*#* Play around with stroke weight and color
 
*#* Add friction (you'll need to create new variables) to slow down the ball
 
 
 
== Wednesday (10/16/19) ==
 
* PSATs
 
 
 
== Tuesday (10/15/19) ==
 
'''Agenda:'''
 
* Group 4 Project permission slips
 
* Function definitions & return repl.it questions?
 
* Demo your completed Tic-Tac-Toe: Part 3 if you have not already done so
 
* Tic-Tac-Toe w/ Functions walk-through
 
* Complete and demo [https://docs.google.com/document/d/1u1aQNdF_V-_n_zE5gAbMbjh45IHNyrX4P4sCDzldvKs/edit?usp=sharing Functions: Emoji Assignment]
 
* Work on [https://docs.google.com/document/d/1i6iUV20KXDF_yKr4mn5X4JQQPc4hF7lklkp5DlDpMCE/edit?usp=sharing Functions: Hover Buttons]
 
 
 
'''Homework:'''
 
* Complete [https://docs.google.com/document/d/1i6iUV20KXDF_yKr4mn5X4JQQPc4hF7lklkp5DlDpMCE/edit?usp=sharing Functions: Hover Buttons]
 
 
 
== Thursday (10/10/19) ==
 
'''Agenda:'''
 
* Group 4 Project permission slips
 
* Demo your completed Tic-Tac-Toe: Part 3
 
* Introduction to Functions
 
** [https://docs.google.com/presentation/d/1W_kTmZH-qLbcFcueUBLw3skRXIDlAxLDdJB-y7AbeWM/edit?usp=sharing Functions slides]
 
* Complete repl.it assignment titled: "Function definitions & return"
 
* Work on [https://docs.google.com/document/d/1u1aQNdF_V-_n_zE5gAbMbjh45IHNyrX4P4sCDzldvKs/edit?usp=sharing Functions: Emoji Assignment]
 
 
 
'''Homework:'''
 
* Complete "Function definitions & return" repl.it assignment if you did not do so in class
 
 
 
== Tuesday (10/8/19) ==
 
'''Agenda:'''
 
* Group 4 Project permission slips
 
* Complete & demo Tic-Tac-Toe - Part 2
 
* Tic-Tac-Toe - Part 3
 
*# Be sure to create a new sketch so as not to lose your working Part 2 code, and copy over your Part 2 code to the new sketch
 
*# Add if-statements and conditionals to check if any 3 in a row match
 
*#* Don't forget to make sure that one of the slot variables is not equal to the empty string because 3 empty slots will be considered a match too
 
*# Display a text() message that indicates the winner
 
*# Call the noLoop() function to stop the game when there is a winner
 
*# Implement a mechanism/conditional to check if the game is a draw (tie)
 
* Demo a completed Tic-Tac-Toe game
 
* Challenge:
 
*# Implement an AI to play against you
 
 
 
== Friday (10/4/19) ==
 
'''Agenda:'''
 
* Group 4 Project - field trip slips
 
* Complete and demo Tic-Tac-Toe: Part 2 (see description from Wednesday)
 
* If you have completed Tic-Tac-Toe: Part 2, then proceed to adding conditionals to determine winning
 
* Don't forget about cat's games (tie-game) where the board is completely full
 
 
 
== Wednesday (10/2/19) ==
 
'''Agenda:'''
 
* Demonstrate Tic-Tac-Toe Select-a-Square
 
* Read [https://py.processing.org/reference/text.html text()] and test out its example code snippet
 
** You can use text() to draw X and O on the screen for our game!
 
* Read [https://py.processing.org/reference/globals.html global variables] and test out its example code snippet in Processing
 
** You will interact with the code snippet by hitting keys
 
** Focus on understanding the use of the global keyword
 
* Read [https://py.processing.org/reference/mouseReleased.html mouseReleased()] and test out its example code snippet in Processing
 
** You will interact with the code snippet by pressing and releasing the mouse/trackpad button
 
** The mouseReleased() function automatically runs every time the mouse's button is released
 
* What components of Tic-Tac-Toe are left?
 
** Copy your Tic-Tac-Toe code to a new Processing sketch program and save it as TTT_Part2
 
** Declare/create a global string variable named '''turn''' and initialize it to either "X" or "O"
 
** Declare/create global variables for each square in the game (e.g. b_0_0, b_0_1) -- you will use these variables to track where moves are made
 
*** Initialize all the b_#_# variables to empty strings ""
 
** Update your draw() so that all of the b_#_# variables are text()-ed onto the screen at their appropriate locations.  Test out your program by giving some of the b_#_# variables "X" and "O".  You should see them appear on the screen.  Once your testing is done, revert them back to empty string ""
 
** Define the mouseReleased() function like the example linked above.  Read all of the following guidelines for mouseReleased()
 
*** You will add/modify the mouseReleased() code block, such that you will determine where the mouse is releasing (using if-statements), and then you will change/update the corresponding b_#_# variable
 
*** You can use the same if statements and conditionals from the previous "select-a-square" lab! (i.e. copy all your if-statements from the draw() and paste them into mouseReleased(). You will not need any of the fill() or rect() in mouseReleased()
 
*** If a particular square is clicked, then save the current player's turn into that specific b_#_#
 
** Every time you release the mouse and draw "X" or "O", the turn should switch
 
** You must not allow a move to occur in a space that already has a move
 
  
 +
== [[IBCS1 - 1920 - November]] ==
 +
== [[IBCS1 - 1920 - October]] ==
 
== [[IBCS1 - 1920 - September]] ==
 
== [[IBCS1 - 1920 - September]] ==
 
== [[IBCS1 - Archives]] ==
 
== [[IBCS1 - Archives]] ==

Revision as of 09:10, 6 December 2019

Friday (12/6/19)

Agenda:

  • Complete the "Top-Down" Perspective Game (Robots / Item Collection Game)

Wednesday (12/4/19)

Agenda:

  • Group 4 Project Field Trip
  • Complete the "Top-Down" Game (Robots / Item Collection Game) if you are not attending the field trip today

Monday (12/2/19)

Agenda:

  • Group 4 Project Field Trip Logistics!
  • "Top-Down" Perspective Game (Robots / Item Collection Game) - complete and demo this week
    • This next game will use a top-down perspective and be a variation of many games that you might have played in the past
    • The keyboard will move the player around (WASD or arrow keys)
    • The player must collect 5 or more items on the screen. Collecting all the items wins the game.
    • The player must avoid colliding with at least 3 enemy robots that follow it around. Colliding with a robot loses the game
    • There is a timer counting down, and the player must collect all the items before it hits 0. Otherwise, the player loses.
    • The screen wraps around (e.g. player moving off screen to the left appears on the right)
  • Additional challenges:
    • Robots that collide with each other become disabled "land mines"
    • Attack ability so that player can fight back a robot
    • Health meter for the player
    • Levels that increase in difficulty (e.g. add more robots)
    • Warp doors - the player going through the door appears at the other door
    • An invincibility or shield power-up item

IBCS1 - 1920 - November

IBCS1 - 1920 - October

IBCS1 - 1920 - September

IBCS1 - Archives