Source code: bitbucket.org/prjoh/chatgpt-g...
You can try the game here: prjoh.itch.io/chatgpt-shooter
Lex Fridman’s interview of Andrey Karpathy: • Andrej Karpathy: Tesla...
0:00: Intro
1:09: Create a window and render a sprite onto the screen using C++.
1:52: Instead of loading a “sprite.bmp” I want to load a file called “player.png”.
2:10: To load the “player.png” image from the previous example, create a path variable that stores the base path and appends “res/player.png”.
2:23: Can we modify the code to render the image with its original size?
2:44: Write an Entity Component System.
3:01: Can you integrate this code with our previous SDL code and add an input component for the player?
3:27: Can you create a RenderComponent and a RenderSystem to render the sprites of entities?
3:45: I would like to refactor the previous code. Instead of passing references to our component maps in the game loop, I would like to store the references at initialization. Can you show me how to do that?
4:06: You made a mistake in the MovementSystem. Since the velocity components are initialized as 0, the position never changes. Can you fix this bug?
4:17: Can you show me hot to calculate delta time and make the MovementSystem depend on it?
4:38: How can we create an AI for the enemy?
4:49: Please create an AISystem and AIComponent that uses state machines.
4:56: That seems too complex. Let’s forget about it. Instead, create an AISystem that follows the player position. If the AI has reached a certain range it stops chasing the player.
5:34: Modify the enemy AI such that the enemy shoots a projectile at the player once it is in range.
6:02: Show me how to render the projectiles on screen.
6:19: Show me how to implement an attack cooldown for the enemy.
6:34: Can you add a rotation component to the player, which rotates the player sprite and gets modified by the left and right input keys?
6:54: Please change the velocity based on the current rotation.
7:13: How can I calculate the rotation of the enemy sprite based on the difference of the positions between player and enemy?
7:44: Please show me how to implement a ShootingSystem that lets the player spawn Projectiles once the spacebar key was pressed.
8:04: How can we change the code such that we only spawn one projectile once we switched from keyup to keydown state for space bar?
9:04: Let’s add a HealthComponent to the player and reduce health if a collision happens between an enemy projectile and the player.
9:42: Show me how to render a health bar.
10:11: How can we modify the code to show a game over text once the player has reached 0 health?
10:45: How can I play sound effects using SDL?
11:05: Closing remarks
Негізгі бет Ғылым және технология How I Used ChatGPT to Make a Game from Scratch
Пікірлер: 48