Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
kunjgit authored Jul 1, 2024
2 parents 772df1c + 678820c commit 79d8e44
Show file tree
Hide file tree
Showing 852 changed files with 134,993 additions and 1,103 deletions.
78 changes: 0 additions & 78 deletions .github/workflows/pr_tags.yaml

This file was deleted.

113 changes: 113 additions & 0 deletions .github/workflows/restrict_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: Restrict Contributor to limited contributions in GameZone

on:
pull_request_target:
types:
- opened

jobs:
evaluate_and_close:
runs-on: ubuntu-latest

steps:
- name: Check merged pull requests and calculate score
id: calculate_score
uses: actions/github-script@v4
with:
github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
script: |
const owner = context.repo.owner;
const repo = context.repo.repo;
const pullRequestOpener = context.payload.pull_request.user.login;
let mergedPullRequests = [];
let page = 1;
let perPage = 100;
let response;
do {
response = await github.pulls.list({
owner,
repo,
state: 'closed',
per_page: perPage,
page: page
});
mergedPullRequests = mergedPullRequests.concat(response.data.filter(pr => pr.user.login === pullRequestOpener && pr.merged_at !== null));
page++;
} while (response.data.length === perPage);
let score = 0;
let prDetails = [];
const scoreMap = {
'level3': 45,
'level2': 25,
'level1': 10
};
for (const pr of mergedPullRequests) {
let prScore = 0;
let labelsWithScores = [];
for (const label of pr.labels) {
if (scoreMap[label.name]) {
prScore += scoreMap[label.name];
labelsWithScores.push(`${label.name} score: (${scoreMap[label.name]})`);
}
}
score += prScore;
if (labelsWithScores.length > 0) {
prDetails.push(`- [#${pr.number}](${pr.html_url}) with labels: ${labelsWithScores.join(', ')}`);
}
}
const threshold = 150;
console.log(`User score: ${score}`);
console.log(`Score threshold: ${threshold}`);
if (score >= threshold) {
const comment = `Hey @${pullRequestOpener}, You have reached your limit to contribute in GameZone with a score of ${score}. \n We believe in giving equal opportunity to everyone so you will not be able to contribute to GameZone now onwards. 💗 \n Thank you for your valuable time and contribution in GameZone 🕹️! \n\n Your merged pull requests:\n${prDetails.join('\n')}`;
core.exportVariable('comment_body', comment);
core.setOutput('close_pull_request', true);
} else {
core.exportVariable('comment_body', '');
core.setOutput('close_pull_request', false);
}
- name: Add spam label and close the pull request
if: always() && steps.calculate_score.outputs.close_pull_request == 'true'
uses: actions/github-script@v4
with:
github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
script: |
const owner = context.repo.owner;
const repo = context.repo.repo;
const pullRequestNumber = context.payload.pull_request.number;
const comment = process.env.comment_body;
if (comment.trim() === '') {
console.log('Comment body is empty. Skipping comment creation.');
return;
}
await github.issues.createComment({
owner,
repo,
issue_number: pullRequestNumber,
body: comment
});
await github.issues.addLabels({
owner,
repo,
issue_number: pullRequestNumber,
labels: ['spam🚨']
});
await github.pulls.update({
owner,
repo,
pull_number: pullRequestNumber,
state: 'closed'
});
Binary file added Games/Alien_Invasion/.DS_Store
Binary file not shown.
20 changes: 20 additions & 0 deletions Games/Alien_Invasion/README..md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# AttackAlienInvaders Game App
A cool 2D alien planet exploration steampunk-themed game application with techniques of vanilla JavaScript, HTML5, CSS3 and HTML Canvas. From sprite animation to parallax backgrounds, the game App is completely built from scratch, with no frameworks or libraries, using HTML, CSS and plain vanilla JavaScript. The game contains richful premium art assets for characters, environments and props.

### [Game Won Demo](https://github.com/KrystalZhang612/KrystalZhang-AttackAlienInvaders-Game-App/blob/main/testing-result-AttackAlienInvader-game-app/Won%20Game.mov): Most Wondrous! Well done explorer!
https://user-images.githubusercontent.com/72481348/198857930-95a5c040-1d47-4ca6-b5a6-15ac05e8e520.mov
### [Game Lost Demo](https://github.com/KrystalZhang612/KrystalZhang-AttackAlienInvaders-Game-App/blob/main/testing-result-AttackAlienInvader-game-app/Lost%20Game.mov): Blazed! Get my repair kit and try again!
https://user-images.githubusercontent.com/72481348/198857699-86d076d4-f746-435b-89ec-333ad1ba01b8.mov

# Game Premiere Storyline
***Central Computer***: <br/>
`These alien creatures have very similar physiology to the earth seahorses. Their bodies can easily cut through the thick atmosphere. They can move very fast.`<br/>
***Explorer***:<br/>
`Seahorses hives are being attacked by something. This one has been damaged. I wonder if you can hack into this creature’s central computer to control it for a while.`<br/>
***Central Computer***: <br/>
`It is surprisingly easy to override its circuits. Seems like these machines are not used by our technology. I’m getting a lot of new data.`<br/>
***Central Computer***: <br/>
`The atmosphere on this planet is thick enough to allow heavy silicon-based lifeforms to float but smoke is blocking most of the sunlight. Many creatures developed artificial lights and glowing appendages to see through the heavy clouds. The Seahorse sentinel has a basic attack that’s powerful against weak enemies, but if it absorbs energy from one of the overcharged creatures, it gets additional firepower for a short period of time and it instantly replenishes its ammo. Ammo also automatically recharges over time. It seems we just need to help it to get through these aggressive swarms in time so it can join its hive.`
- There is a stream of data about multiple different species.
- The alien creatures in the hood of their ecosystem have special movements, special abilities, and interact with the environments on other planets.

44 changes: 44 additions & 0 deletions Games/Alien_Invasion/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE-edge">
<meta name="viewport" content="width-device-width, initial-scale=1.0">
<title>AttackAlienInvader Game</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Bangers&display=swap" rel="stylesheet">
<link rel="stylesheet" href="style.css">

</head>


<body>
<canvas id="canvas1"></canvas>

<!-- characters -->
<img id="player" src="assets/player.png">
<img id="angler1" src="assets/angler1.png">
<img id="angler2" src="assets/angler2.png">
<img id="lucky" src="assets/lucky.png">
<img id ="hivewhale" src = "assets/hivewhale.png">
<img id = "drone" src = "assets//drone.png">


<!-- props -->
<img id="projectile" src="assets/projectile.png">
<img id ="gears" src = "assets/gears.png">
<img id ="smokeExplosion" src = "assets/smokeExplosion.png">
<img id ="fireExplosion" src = "assets/fireExplosion.png">

<!-- environment -->
<img id="layer1" src="assets/layer1.png" />
<img id="layer2" src="assets/layer2.png" />
<img id="layer3" src="assets/layer3.png" />
<img id="layer4" src="assets/layer4.png" />

<script src="script.js"> </script>
</body>

</html>
Loading

0 comments on commit 79d8e44

Please sign in to comment.