Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
af87d8c
Update leaderboard.yaml
BenZeng04 Dec 6, 2021
4e81bb2
Update leaderboard.yaml
BenZeng04 Dec 6, 2021
272fa89
Update leaderboard.md
BenZeng04 Dec 6, 2021
656cc8a
Update _index.md
BenZeng04 Dec 12, 2021
b89f6e3
Query leaderboard from Firebase
BenZeng04 Dec 12, 2021
3fad5ce
Update game jam home page
BenZeng04 Dec 13, 2021
a13989a
draft-ify mentorship for now
BenZeng04 Dec 13, 2021
6c04477
Fix improper sorting & ranking
BenZeng04 Dec 14, 2021
d9c096f
Delete leaderboard.yaml
BenZeng04 Dec 14, 2021
204968a
Merge pull request #16 from mcpt/firebase-test
BenZeng04 Dec 14, 2021
a824148
Initial commit for powerups
ji-mmyliu Dec 14, 2021
0450c46
Add powerups template code
ji-mmyliu Dec 14, 2021
caf2e4e
Create Upgrades.md
toaster203 Dec 14, 2021
28e574b
Update logo
BenZeng04 Dec 14, 2021
6bfee00
First half of upgrades.md and currency.md
Averesoft Dec 14, 2021
e5aaec8
Create UpgradesTemplate.zip
Averesoft Dec 14, 2021
9727e74
Update Upgrades.md
Averesoft Dec 14, 2021
ff9d746
Create userInterface.md
toaster203 Dec 14, 2021
97da274
Update Upgrades.md
toaster203 Dec 14, 2021
ad0bcbd
added making levels and path creation page
V1ad20 Dec 16, 2021
adeb0c3
intro, demo & challenges
BenZeng04 Dec 16, 2021
5b51634
Merge pull request #17 from mcpt/part-iii
BenZeng04 Dec 16, 2021
6e57cfe
Rename Upgrades.md to upgrades.md
toaster203 Dec 16, 2021
904834c
Update upgrades.md
BenZeng04 Dec 16, 2021
6a50a37
Merge branch 'master' of https://github.com/mcpt/learning
BenZeng04 Dec 16, 2021
04fc981
Update introduction.md
BenZeng04 Dec 16, 2021
5aa71f2
Update userInterface.md
toaster203 Dec 16, 2021
7d5457d
adjust weights
BenZeng04 Dec 16, 2021
5265c71
Merge branch 'master' of https://github.com/mcpt/learning
BenZeng04 Dec 16, 2021
cb166a2
Update userInterface.md
BenZeng04 Dec 16, 2021
4b27304
Update challenge.md
BenZeng04 Dec 16, 2021
b2170c4
Update challenge.md
BenZeng04 Dec 16, 2021
0f83fb9
Update _index.md
BenZeng04 Dec 19, 2021
928f36e
Update game jam descriptions
BenZeng04 Dec 23, 2021
a9610b3
Update _index.md
BenZeng04 Dec 23, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ package-lock.json
package.json

.hugo_build.lock
hugo.exe
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ A platform for the various events, resources and workshops that the Learning Bra

* [Game Dev Series](https://learning.mcpt.ca/game-dev/)
* [Game Jam](https://learning.mcpt.ca/game-jam/)
* [LyonHacks](https://learning.mcpt.ca/lyon-hacks/)
* [Mentorship](https://learning.mcpt.ca/mentorship/)
* [LyonHacks](https://learning.mcpt.ca/lyon-hacks/)
18 changes: 14 additions & 4 deletions content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,22 @@ title = "Home"
---
The Learning Branch is here to help you through the ICS curriculum while also expanding your world of coding knowledge in an interactive, informative, and (most importantly) fun way!

{{% notice info "Next Event: Game Series - Part II" %}}
Join us on **Thursday, December 2nd** at **4:15pm** for our **Game Dev** series, as you’ll build your very own tower defense game! Get ready for an hour of interactive learning suited for all skill levels, preparing you for our keynote Game Jam during the Winter Break!
{{% notice info "Next Event: Holiday Game Jam" %}}
Starting **December 27th** at noon, dive into our Game Jam, the finale of our 2021 school year, where **you** and up to **3 others** will have the chance to build games for up to **$100** in **prizes**! Spanning **96 hours**, get ready for fun activities, creative workshops, and more!

More info is available on our blog post [here](game-jam).
{{% /notice %}}

{{% notice tip "Make sure to sign up!" %}}

Make sure you've signed up [here](https://mcpt.ca/gamejam) so that you will be able to participate!

Signups close on **December 26th**, at **11:59 PM!**

{{< countdown "That's in: <b>" "Dec 27 2021 00:00:00 EST" "</b>" >}}
{{% /notice %}}

### Jump To:
* [Game Series](game-dev)
* [Game Jam](game-jam)
* [LyonHacks](lyon-hacks)
* [Mentorship](mentorship)
* [LyonHacks](lyon-hacks)
3 changes: 2 additions & 1 deletion content/game-dev/leaderboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ weight = 1
{{% notice info %}}
Participate to earn **GAME DEV POINTS**, which will award you with a *surprise* during the [Game Jam](/game-jam)!

Each participation will be worth **200** points, with winners of the *special challenges* earning an extra **100** points per challenge.
Each participation will be worth **200** points, with winners of the *special challenges* earning bonus points.

{{% /notice %}}

{{< users-table >}}
Binary file not shown.
76 changes: 76 additions & 0 deletions content/game-dev/part-iii/MakingLevels.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
+++
title = "Making Levels"
weight = 5
+++

---

{{%attachments style="blue" title="Powerups Template Code" /%}}

### Making Levels

Now that we are in the 3rd session, some levels in the game are long overdue. Now that we are more familiar with the concept of arrays and arraylists, let’s see how we can implement them

{{% notice info "Key Concepts" %}}

1. How do we represent a level in code? And how do we store information for it?
2. What happens when a level is being played, and when a level isn't being played?
3. How can we generate levels easily?

{{% /notice %}}

##### Representing a level in code

Before we get to coding anything, we must understand what a level actually is. In bloons tower defense, levels are best defined by the balloon wave that you must pop. For example, in level 1, there are weak balloons that you must pop. In level 2, the balloons are stronger and more numerous. This trend continues as you move to higher and higher levels.

We already have 1 default level that starts immediately when you open the game. What we need to do now is make many distinct levels, and have some control over when each level starts.

##### Making many levels.

As you might have seen from previous lessons, a single balloon is represented by an array of floats, which is a list of values that contain information about the position and state of the balloon. These float arrays were then stored in a larger, master array, which contained all the “balloons” for the default level.

You can thing of it kind of like a folder/file system

![Interface](/img/ArrayVisual1.png)

Now, you could say we need a larger “folder” to store many level folders that contain balloon data. In other words, we need a bigger container that will store each level

![Interface](/img/ArrayVisual2.png)

To do this, we can make some new arrays similar to the default level, and put all of those arrays into a larger array, called levels. We can represent this structure using a 3D array.

```Java
ArrayList<ArrayList<float[]>> levels = new
ArrayList< ArrayList< float[]>>();
/*Main “levels folder” //A Level folder //List of balloon
which can store many which can store information that
levels many balloons defines a balloon
*/
```

We also need to control what can happen when a level is and isn't being played. For that, we have a boolean isPlaying variable, which disables certain features when false. For example, if a person is not playing yet, the code for _tower tracking_ and _projectile creation_ are essentially turned off, which makes sense since there are no balloons to turn to and shoot new projectiles at. The isPlaying variable is turned to true when the “next level” button pressed, and false when there are no more balloons in the level.

##### Levels API

Now, a way to quickly create balloons for a level would be very nice if you wanted to make a playable game. For that, we have another, very simple API which you can use in the createWaves function in Balloons.pde.

```java
void createWaves(){
//1
createLevels(numberOfLevels);

//2
createBalloons(
levelTheBalloonsAreFor,
numberOfBalloons,
delayOfTheFirstBalloon,
delayBetweenBalloons,
speedOfTheBalloons,
hP
);
}
```

The first function, **createLevels()**, will help determine how many levels there are in your game. Once you have called/used this function, you can call the **createBalloons()** function to make balloons for a specific level. First, you specify the level you want to assign balloons to (starting from 0, since we are dealing with arrays!). Then you specify the number of balloons and the first balloon’s delay, which essentially controls when this collection of balloons will appear on the screen. Then you can tell the function the delay between the balloons, which controls how spaced apart they are, and also the speed and hp of each balloon.

And there you go! Now you can create your own levels!
Binary file not shown.
80 changes: 80 additions & 0 deletions content/game-dev/part-iii/PathCreationAPI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
+++
title = "Path Creation API"
weight = 5
+++

---

{{%attachments style="blue" title="Powerups Template Code" /%}}

### Path Creation API

Before this, balloons have moved in straight lines. That’s cool and all, but what if we wanted to implement some maps like this?

![Interface](/img/PathAPI/RealPathExamples.png)

Obviously, straight lines are not going to cut it. Instead, we need a way to implement **curves**, and we need to have some tools that will make it easy for us to smoothly connect them. As a result, we developed an API (a set of useful functions) that will help us do this.

```java
//1
addLine(startPointX,startPointY,endPointX,endPointY);

//2
addArc(startPointX,startPointY,centerPointX,centerPointY, angleOfRotation);

//3
addSmoothLine(lineLength);

//4
addSmoothArc(distanceAwayFromPathTip, angleOfRotation);
```

{{% expand "addLine(startPointX, startPointY, endPointX, endPointY);" "false" %}}
This is the most straightforward function. Just define a line with 2 points - a start and end point - and it will draw it for you.

Eg. addLine(0,200,300,200); gives:
![Interface](/img/PathAPI/AddLine.png)
{{% /expand %}}

{{% expand "addArc(startPointX, startPointY, centerPointX, centerPointY, angleOfRotation);" "false" %}}

To draw a circular path segment using this function, you must first define where the segment starts - startPoint. Then, you define the center point of the arc (centerPoint), which is the point from where the arc is curved around. Finally you have an angle of rotation, which determines how much curve is in the arc.

Eg. addArc(0,200,200,100,-radians(90)); gives:
![Interface](/img/PathAPI/AddArc.png)

**Note**: The _radians()_ function simply converts angles from degrees to radians, which is perferred by Processing. Also, the point you see in the center of the arc is just for understanding - it will not appear when you are making your own path.
{{% /expand %}}

{{% expand "addSmoothLine(lineLength);" "false" %}}

This function is used to extend the paths of arcs in a smooth way. The lineLength argument (or input) is used to describe how far the arc should be extended

Eg.

addArc(0,200,200,100,-radians(90));

addSmoothLine(200);

gives:
![Interface](/img/PathAPI/AddSmoothLine.png)
{{% /expand %}}

{{% expand "addSmoothArc(distanceAwayFromPathTip, angleOfRotation);" "false" %}}

This function draws a smooth arc from an already existing line or arc. To understand it, you must imagine an arrow that starts from the path’s end, and points in a direction so that it is a +90 degree rotation from the path.

![Interface](/img/PathAPI/AddSmoothArcBefore.png)

{{% notice info "Processing Angles"%}}
Remember that Processing angles start from east and increase counterclockwise. This should be taken into account when imagining the arrows.
{{%/notice%}}

_distanceAwayFromPathTip_ describes how far away the **center** of the arc should be from the tip of the path, along the line described by the red arrow. If you would like to have the center of the arc be in the opposite direction of the arrow, simply put a negative value.

//addSmoothArc(100,radians(105)); and addSmoothArc(-100,-radians(105)); respectively give:
![Interface](/img/PathAPI/AddSmoothArcAfter.png)

As you can see, the addSmoothCurve() function can be used with other arcs to make more complex curves. You can also put many addSmoothCurve()’s together to make interesting shapes.

{{% /expand %}}
7 changes: 5 additions & 2 deletions content/game-dev/part-iii/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
+++
chapter = true
alwaysopen = false
title = "Part III"
pre = "<b>3.</b> "
weight = 3
Expand All @@ -8,8 +9,10 @@ weight = 3
### Game Series
# Part III

{{% notice info "Coming to WLMAC on December 16th, 2021!" %}}
{{% notice info %}}
*Premiere, Interactive, Tower-Defense Game Workshop for Programmers of All Levels...*
{{% /notice %}}

![Banner](/img/Game_Dev_Banner.png)
This event has ended on **December 16th, 2021**. You can find a recording of the event [here](https://drive.google.com/file/d/1Jo2fXD_-bBMKOeHWMH0GFvbqgpJ_fwa9/view)!

![Banner](/img/Game_Dev_Banner.png)
29 changes: 29 additions & 0 deletions content/game-dev/part-iii/challenge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
+++
title = "Challenges"
weight = 7
+++
---
## Challenge Prompt

Congratulations on making it to the end of the series!

To celebrate, as well as help you prepare for the Game Jam, we'd like to test your game development skills and see how well you can make this game _your own_!

{{% notice info "Challenge" %}}
Create your own spin-off of the game! This is more or less an open-ended question, you are free to do whatever you want.

The first place winner will earn **400** points, with second place earning **375**, third place earning **350**, etc... with a minimum of **100** points being awarded for successfully attempting the challenge, **on top** of the **200** points for participation.

Placements will be determined by a combination of creativity, number of features implemented / changed, as well as _balancing_ of the game; making sure the game is not too easy or too hard.

We suggest any of the following:
* Creating a new path
* Creating a new power-up
* Creating a unique set of upgrades
* Modifying balloon waves / creating new waves for progression

Submit a GitHub / Google Drive link to the form that will be provided during the workshop to earn points!

**Full Source Code (For reference):** https://github.com/mcpt/game-dev/tree/main/PartThree
{{% /notice %}}

33 changes: 33 additions & 0 deletions content/game-dev/part-iii/currency.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
+++
title = "More Currency"
weight = 2
+++

---

### Currency for Removing Towers

Sometimes, we make mistakes. Maybe you accidentally sour a relationship with a close friend, play the wrong chord in a concert after practicing for months, or you drop your lovingly handcrafted bridge for your ISP in a puddle. While we can’t help you with any of those things in this workshop, we can help you when you change your mind on keeping a tower on the board.

Recall that we used two ArrayLists to store the data for our towers: one to store the position as a PVector and the other to store data of the tower as an integer array.

```Java
//notice that we could have just included the PVectors in the towerData array as x and y values
//we decided to keep it like this since we are building off our previous workshops
ArrayList<PVector> towers; // Towers that are placed down
ArrayList<int[]> towerData;
```

To remove a tower from the board, we can simply remove the values at that specified index. Since our towers are 1-indexed, we can just take out the (i-1)th tower from our ArrayList storing the position and the ArrayList storing the tower data. When removing, we set a location to be the remove button, known as `removeLocation`. This will remove the tower and give a certain amount of currency when removing it. In our code, we decided that your current balance would go up by the level of upgrade multiplied by the tower’s price divided by two. The following is our method for checking where to remove.

```Java
void removeCheck() {
if((removeLocation.x - 35 <= mouseX && mouseX <= removeLocation.x + 35 && removeLocation.y - 12 <= mouseY && mouseY <= removeLocation.y + 12) && mousePressed && towerClicked != -1) {
int[] temp = towerData.get(towerClicked);
currentBalance += temp[upgrade] * towerPrice[temp[projectileType]] / 2;
int temp1 = towerClicked; towerClicked = -1;
towerData.remove(temp1); towers.remove(temp1);
}
}

```
Binary file not shown.
77 changes: 77 additions & 0 deletions content/game-dev/part-iii/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
+++
title = "Introduction"
weight = 1
+++

---

## Game Dev - Season IV

Welcome to the return of MCPT's Game Dev Series! Over the course of 3 workshops, we have something for everyone, whether you’re a beginner or an experienced coder. Inspired by **Bloons Tower Defense**, you will learn how to code your very own tower-defense game in Processing!

{{% notice tip "Challenges" %}}
Earn up to **400** bonus points with our open-ended challenge! Stay tuned for more info!
{{% /notice %}}

### Demo

{{< p5js-src "/content/p5-js-demo/part3.js" >}}

{{% expand "What is a tower-defense game?" %}}
{{% notice info %}}

A **tower-defense game** is a type of strategy game where players will place down "towers", usually with a form of in-game currency that will defend against a set of enemies. If you fail to defeat the enemies, you will typically lose health - when you reach zero, it's **Game Over.**

In **Bloons Tower Defense**, the towers are monkeys, and the enemies are balloons, which spawn in rounds and travel along a pre-determined path. Your goal as a player is to strategically spend your currency while placing towers in effective locations, using their special abilities to win the game!

In this workshop, we will cover the fundamental aspects of a tower-defense game, and in future workshops, we will cover special abilities and ways that you can customize your game to make it your own!

{{% /notice %}}
{{% /expand %}}

Everything will be made step-by-step allowing you to learn and see the progress of the game. The speed of the workshop is not set and will be altered at a moment's notice in order, so don’t worry if you don't get everything immediately!

This website is interactive and holds all the content that we will be going over. Flip along and test code just as we do! This site will also be accessible at any time for you to look back and review content.

### Additional Info

{{% expand "What you will learn" %}}
{{% notice info %}}
In the third part of this workshop, you will finish up the game, adding more intricate paths, as well as two finalizing features: power-ups and tower upgrades!
This includes:
* How to use a pre-built library to create circular and disjoint paths
* How to use nested ArrayLists to create multiple waves
* How to modify our code for towers and projectiles to create upgrades
* How to create spikes and a new interface for custom power-ups
{{% /notice %}}
{{% /expand %}}


{{% expand "What you will need" %}}
{{% notice info %}}

You will need to download [Processing 4.0](https://processing.org/download) from https://processing.org/download, or have Processing 3 or newer installed.

In our workshop, we will be adding code to several **templates**, which you can download below.

{{% /notice %}}

{{%attachments style="blue" title="All Templates" pattern=".*zip" /%}}

{{% /expand %}}


{{% expand "The Game Jam" %}}
{{% notice tip %}}

Ultimately, the Game Dev Series will build up to a week-long Game Jam during the Winter Break. During the Game Jam, you'll develop and create the best game you can!

There will be many prizes and awards so make sure to participate!

In addition, by participating in the Game Dev Series and completing challenges, you will earn points which will help you win awards during the Game Jam.

PS. This is the last chance to get extra points before our Winter Game Jam, so be sure to try the challenges!

{{% /notice %}}
{{% /expand %}}

Binary file not shown.
Loading