Skip to content

Commit

Permalink
update bot template for js
Browse files Browse the repository at this point in the history
  • Loading branch information
bradenhs committed Dec 14, 2023
1 parent 6a20584 commit c918326
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
17 changes: 3 additions & 14 deletions assets/templates/javascript.node.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,7 @@
node main.js
```

```json file=/.devcontainer.json hidden=true
{
"name": "Zilch Bot",
"postAttachCommand": "./connect --welcome",
"customizations": {
"codespaces": {
"openFiles": ["bot.js"]
}
}
}
```

```md file=/README.md hidden=true
```md file=/README.md
Check if you have Node.js installed on your system like this:

\`\`\`
Expand Down Expand Up @@ -118,7 +106,8 @@ send("ready");
```

```js file=/bot.js
// 👉 Run "./connect" (or "connect.cmd" on Windows) in the terminal to get started.
// 👋 Hello there! This file contains ready-to-edit bot code.
// 🟢 Open "README.md" for instructions on how to get started!

class Bot {
constructor(config) {
Expand Down
2 changes: 2 additions & 0 deletions src/play.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ interface Velocity {
y: number;
}

// TODO sometimes ball suddenly changes direction in the middle of the table - not sure why
// or how to reliably reproduce.
function moveBall(state: State, p1Velocity: Velocity, p2Velocity: Velocity) {
if (
handlePaddleHit(state, p1Velocity, "p1") ||
Expand Down

0 comments on commit c918326

Please sign in to comment.