Skip to content

Commit

Permalink
Merge pull request #556 from mrboiisthebest/main
Browse files Browse the repository at this point in the history
fix hack 1 for conditional lesson
  • Loading branch information
jm1021 authored Nov 1, 2024
2 parents 0b47c15 + 08bf84e commit 06e138e
Showing 1 changed file with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Popcorn Hack 1: Create a Simple Combat System for Your RPG Game"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### <span style=\"color: #ADD8E6; text-shadow: 3px 3px 8px #4682B4; font-weight: bold; font-size: 2em;\">Popcorn Hacks: Create a Simple Combat System for Your RPG Game</span>\n",
"#### <span style=\"color: #ADD8E6; text-shadow: 3px 3px 8px #4682B4; font-weight: bold; font-size: 2em;\">Popcorn Hacks:</span>\n",
"Develop a basic combat system that allows characters to engage in battles with enemies. This will help you practice using functions, conditionals, and basic game mechanics in JavaScript.\n",
"\n",
"---\n",
"##### <span style=\"color: #FF6347; text-shadow: 2px 2px 6px #8B0000; font-weight: bold; font-size: 1.5em;\">Popcorn Hack Part 1 - 1: Using <code>initializeData</code> Function</span> \n",
"\n",
"1. Add `speed` to the <code>initializeData(data = null)</code> function and give it a default value.\n",
"2. Add `seed` to the HTML output.\n",
"3. Add `speed` to the JSON data.\n",
"4. Test calling <code>initializeData</code> with no argument, and then using a `data` JSON object as an argument.\n",
"\n",
"##### <span style=\"color: #FF6347; text-shadow: 2px 2px 6px #8B0000; font-weight: bold; font-size: 1.5em;\">Popcorn Hack Part 1 - 2: Adding IJKL Key Conditions in <code>handleKeyDown</code></span> \n",
"\n",
"##### <span style=\"color: #FF6347; text-shadow: 2px 2px 6px #8B0000; font-weight: bold; font-size: 1.5em;\">Popcorn Hack 1: Using <code>initializeData</code> Function</span>\n",
"1. Add an <code>if</code> statement to compare two values.\n",
"2. Use <code>console.log()</code> to print an output.\n",
"3. Create a <code>boolean</code> variable, and use it in another <code>if</code> statement.\n",
"1. Add a `case` statement for each of the IJKL keys in the `handleKeyDown({ keyCode })` switch statement.\n",
"2. Send the key code for each IJKL key to the <code>gameObject.handleKeyDown</code> method.\n",
"3. Use <code>console.log()</code> to output `gameObject`.\n",
"\n",
"---\n",
"\n",
Expand Down

0 comments on commit 06e138e

Please sign in to comment.