Chopper Assault

Chopper Assault Chopper Assault is an adrenaline-pumping game that puts you in the cockpit of a state-of-the-art helicopter. With a focus on t

Your mission is to recover stolen technology from enemy hands, navigating through challenging terrains and hostile environments.

09/24/2024

Making some fun progress on the game today. I had chatGPT keep moving the crosshairs after a direction button press. The enemy looks a little better. A score system was added, along with hit detection for the lasers.

"uh-oh, something went wrong. All I see now is a black square in my browser!
ChatGPT said:
ChatGPT
It looks like the code might have gotten cut off while I was adding the updates for the score and laser collision detection. Let's correct that and ensure the game functions properly. Here's the fixed version of the full code, with all the updates:"

We had some problems with the code, chatGPT was re-writing the entire thing every time I had a change. I instructed it to just provide me with new code for whatever function it was updating, like:

// Update the rotor animation by cycling through rotor states
function updateRotor() {
rotorIndex = (rotorIndex + 1) % rotorCycle.length; // Move to the next state in the cycle
rotorState = rotorCycle[rotorIndex];
}

And now we've got a score keeping and an explosion animation!

Try it out here, arrow keys and spacebar are all you need.

https://chopperassault.com/code-tests/chopper.html

09/16/2024

Alright ChatGPT: "I'm ready for more. Press the spacebar to shoot laser beams at the reticle (the cross), from both bottom-left and bottom-right corners. The laser should just be a line from each corner, flashing quickly twice."

Great! Let's add a laser-shooting feature triggered by pressing the spacebar.

Plan:
Laser Beams: When the player presses the spacebar, two laser beams will shoot from the bottom-left and bottom-right corners of the screen toward the reticle (crosshair).

Flash Twice: The lasers will flash twice, quickly.

Laser Visuals: We’ll use ctx.stroke() to draw the laser beams as lines.

Implementation Steps:

Listen for the spacebar key press to trigger the lasers.

Draw two lines, one from the bottom-left and one from the bottom-right corners, to the current location of the crosshair (reticle).

Implement a flashing effect by quickly showing and hiding the lasers twice.

09/06/2024

What does working with ChatGPT look like?

Me:
I have a different idea for the enemy helicopter design, should I describe it or draw it for you?

ChatGPT:
You can describe it or draw it—whichever works best for you! If you choose to describe it, I’ll do my best to interpret and implement your vision in code. If you'd rather draw it, feel free to upload an image, and I can use that as a reference to design the enemy helicopter.

Me:
The enemy is facing me, the player. So the body would be a square, the rotor on top would be seen from a flat perspective, so not rotating. The illusion of rotation could look like this: - to --- to ------ going back and forth from 1 block, to 3, to 5, to 7, back to 5, 3, and 1. I guess we wouldn't need to draw the rear rotor, since we wouldn't see it from that perspective. Does that makes sense?

ChatGPT:
That makes perfect sense! Here's a breakdown of your idea:

Enemy Helicopter Design:
Body: A square representing the front of the helicopter facing the player.
Rotor: From the player’s perspective, the rotor would be flat. The animation will simulate rotation by increasing and decreasing the width of the rotor, transitioning between different states (1 block, 3 blocks, 5 blocks, 7 blocks, and then back to 5, 3, and 1).
No Rear Rotor: Since the player is viewing the helicopter head-on, there’s no need to show the rear rotor.
Animation of the Rotor:
The rotor width will change over time to create the illusion of spinning.
We’ll cycle through the following states:
1 Block: -
3 Blocks: ---
5 Blocks: -----
7 Blocks: -------
And back down to 5, 3, and 1.
I'll update the code to implement this design. Give me just a moment to tweak it!

The code:

// Rotor animation variables
let rotorState = 1; // Controls the width of the rotor
const rotorCycle = [1, 3, 5, 7, 5, 3]; // Cycle of rotor widths
let rotorIndex = 0; // Index to track rotor cycle

This worked!

What's amazing to me is I remember going through the same process with myself back then in 1983. Instead of ChatGPT coming up with instant fixes though, I often had to spend a lot of time sitting on the floor at lunch with my notepad writing down code ideas, then coming home and typing them in. Fun times!

We went through a few more changes, and here's the test code now:

And now we're on Apple!
09/06/2024

And now we're on Apple!

Album · 2024 · 13 Songs

With the incredible riches I gained from selling Chopper Assault I bought a fishing rod.
08/31/2024

With the incredible riches I gained from selling Chopper Assault I bought a fishing rod.

08/30/2024

We have a long term goal here at Chopper Assault HQ. First is to get the original game up and running on any modern phone or browser. Already ChatGPT is hard at work translating and helping us out.

Second: Storyboard and plan what will become the modern Chopper Assault. We have some ideas, we'll share them as we develop.

Third: Design the game(s)

Forth: Code.

Along the way we'll need help from your and everyone else, which should be fun, because it's a game!

Day 1: Type in old Color BASIC code from the magazine scan into notepad.
08/30/2024

Day 1: Type in old Color BASIC code from the magazine scan into notepad.

Address

Penticton, BC

Website

https://layer666.rocks/

Alerts

Be the first to know and let us send you an email when Chopper Assault posts news and promotions. Your email address will not be used for any other purpose, and you can unsubscribe at any time.

Share

Category