I got several really good prompts from Gemini.
3 Prompts that we will use…
LLM Prompt: Getting Started with My Web Game
"Hey there! I'm completely new to game development, but I'm excited to build a simple web game. I want to use only HTML, CSS, and plain JavaScript – no fancy frameworks or libraries yet, just the basics.
I already have a good idea of the game in mind...
To help you guide me, please tell me:
What key information about my game do you need to know so you can give me the best advice?
(Think about things like game type, target audience, core mechanics, etc.)
<<If you know any of these, share it with the LLM!>>
Once you have that info,
2. can you suggest a few typical 'screens' or 'states' my web game might need (e.g., a start screen, game over screen, main gameplay area)?
Finally, based on all of this,
3. what are the very next steps I should take to start building this game, broken down into simple, actionable points?"
Prompt 1
I will give you my game idea and before anything. I want you to rewrite it for me. This is the game that is played geometry game that is played on a 2d Canvas 2 dimensional canvas rectangle. There is a smaller Square inside this rectangle that represents a chair. We are looking at the chair from the top. So it just looks like a square the square has four corners which represent the four legs of the chair the aim of the game. Is to move this chair to a different location set by the game in the fewest number of moves. There are some rules around how the chair can move basically the chair is so heavy that it can only pivot around one of the four corners. Okay now rewrite this game as you understood it for me.
Gemini version of the Pivot Game
Okay, I understand your game concept! Here’s how I’ve interpreted it:
You’re envisioning a 2D puzzle game played on a rectangular canvas. The primary object is a square, representing a chair viewed from above. This chair has four distinct corners, which act as its pivot points (legs).
The objective of the game is to maneuver this chair from its current position to a pre-determined target location on the canvas. The challenge lies in achieving this goal using the minimum number of moves possible.
The core gameplay mechanic revolves around the chair’s unique movement: due to its immense weight, it can only move by pivoting or rotating around one of its four corners (legs) at a time. This means players will need to strategically choose a pivot point and rotate the chair to incrementally shift its position and orientation towards the target.
Ram: Yes, that is correct. What are my next steps to build this game?
Agent: At this point, it already started to give me vast amounts of code. I am not ready for that yet. Here were the useful parts that I picked up…(Ram)
Get Canvas Context: In script.js, get a reference to your canvas and its 2D rendering context. Implement the Game Loop The game loop continuously updates the game state and redraws everything. Implement Chair Pivoting Logic This is the trickiest part, involving some geometry. When you pivot around a corner, that corner’s position remains fixed. Explanation: This function is the core of your game’s mechanics. It uses trigonometry to calculate the chair’s new position (x, y) and angle after pivoting around a specific corner. The calculateChairCorners function becomes vital here to get the precise coordinates of the pivot point.
Step 5: User Input for Movement Step 6: Win Condition Check Determine when the chair has reached its target.
Step 7: Refinement & Game State Management Add polish and ensure the game handles different states.
Reset Button/Logic: How does the player restart the game after winning? Difficulty: Randomly generate starting and target positions. Visual Feedback: Clearly highlight the currently selected pivot corner.
At this point, I felt that Gemini had sort of over-complicated matters! I don’t want the user to get into the weeds.
This tells me that my follow up prompt was not sharp! I will come back to another LLM tomorrow and try.