본문 바로가기
728x90
SMALL

[ChatGPT] Sample Code 샘플 코드47

[ChatGPT][SFML][2D 게임 개발] SFML(Simple and Fast Multimedia Library) 라이브러리를 사용하여 플레이어를 만들고 이미지를 표시하는 player.cpp 파일의 예제 샘플 SFML(Simple and Fast Multimedia Library) 라이브러리를 사용하여 플레이어를 만들고 이미지를 표시하는 player.cpp 파일의 예제 샘플 // Here is an example of a player.cpp file that uses the Simple and Fast Multimedia Library (SFML) library to create a player and display an image of it #include "player.hpp" Player::Player(){ if (!texture.loadFromFile("player.png")) { std::cout 2023. 1. 14.
[ChatGPT][SDL2][2D 게임 개발] EnemyAI 구조 및 관련 기능을 정의하는 enemy_ai.h 파일의 예제 샘플 EnemyAI 구조 및 관련 기능을 정의하는 enemy_ai.h 파일의 예제 샘플 // Here is an example of an enemy_ai.h file that defines the EnemyAI struct and its associated functions #ifndef ENEMY_AI_H #define ENEMY_AI_H #include "enemy.h" #define SCREEN_WIDTH 640 #define SCREEN_HEIGHT 480 typedef struct { int direction; int speed; } EnemyAI; void initEnemyAI(EnemyAI* enemy_ai); void updateEnemyAI(EnemyAI* enemy_ai, Enemy* ene.. 2023. 1. 14.
[ChatGPT][SDL2][2D 게임 개발] SDL(Simple DirectMedia Layer) 라이브러리를 사용하여 적 AI를 생성하고 적의 움직임을 제어하는 ​​enemy_ai.c 파일의 예제 샘플 SDL(Simple DirectMedia Layer) 라이브러리를 사용하여 적 AI를 생성하고 적의 움직임을 제어하는 ​​enemy_ai.c 파일의 예제 샘플 // Here is an example of an enemy_ai.c file that uses the Simple DirectMedia Layer (SDL) library to create an enemy AI and control the movement of the enemy #include "enemy_ai.h" #include void initEnemyAI(EnemyAI* enemy_ai) { enemy_ai->direction = rand() % 4; enemy_ai->speed = 2; } void updateEnemyAI(EnemyAI.. 2023. 1. 14.
[ChatGPT][SDL2][2D 게임 개발] Player 구조체 및 관련 기능을 정의하는 player.h 파일의 예제 샘플 Player 구조체 및 관련 기능을 정의하는 player.h 파일의 예제 샘플 // Here is an example of a player.h file that defines the Player struct and its associated functions #ifndef PLAYER_H #define PLAYER_H #include #define PLAYER_WIDTH 64 #define PLAYER_HEIGHT 64 typedef struct { int x; int y; SDL_Texture* texture; } Player; void initPlayer(Player* player); int loadPlayerMedia(Player* player, SDL_Renderer* renderer); void.. 2023. 1. 14.
728x90
LIST