본문 바로가기
728x90
SMALL

[ChatGPT] Sample Code 샘플 코드47

[ChatGPT][SDL2][커스텀 2D 게임 엔진 개발] SDL2 기반 커스텀 2D게임 엔진용 스프라이트 편집기 생성 예제 코드 샘플 SDL2 기반 커스텀 2D게임 엔진용 스프라이트 편집기 생성 예제 코드 샘플 // Here's an example of how you could move the sprite using keyboard input in SDL2 #include "SDL.h" #include int main(int argc, char* argv[]) { SDL_Init(SDL_INIT_VIDEO); SDL_Window* window = SDL_CreateWindow("Sprite Editor", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 800, 600, SDL_WINDOW_SHOWN); SDL_Renderer* renderer = SDL_CreateRenderer(window,.. 2023. 1. 13.
[ChatGPT][SDL2][2D 게임 개발] C와 SDL2 라이브러리를 사용하여 360도 회전하는 로고 회전 애니메이션을 만드는 방법의 예 C와 SDL2 라이브러리를 사용하여 360도 회전하는 로고 회전 애니메이션을 만드는 방법의 예 // Here's an example of how you can create a logo rotation animation that rotates 360 degrees using C and the SDL2 library #include int main(int argc, char* argv[]) { // Initialize SDL if (SDL_Init(SDL_INIT_VIDEO) < 0) { printf("SDL could not initialize! SDL_Error: %s\n", SDL_GetError()); return 1; } // Create the window SDL_Window* window = S.. 2023. 1. 13.
[ChatGPT][SFML][2D 게임 개발] C++ 및 SFML 라이브러리를 사용하여 360도 회전하는 로고 회전 애니메이션을 만드는 방법의 예 C++ 및 SFML 라이브러리를 사용하여 360도 회전하는 로고 회전 애니메이션을 만드는 방법의 예 // Here's an example of how you can create a logo rotation animation that rotates 360 degrees using C++ and the SFML library #include int main() { // Create the main window sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window"); // Load a sprite to display sf::Texture texture; if (!texture.loadFromFile("logo.png")) return EXIT_FAIL.. 2023. 1. 13.
[ChatGPT][SDL2][2D RPG 게임 개발] C 및 SDL2를 사용하여 2D RPG 게임에서 한 단계에서 다음 단계로의 전환을 구현 샘플 C 및 SDL2를 사용하여 2D RPG 게임에서 한 단계에서 다음 단계로의 전환을 구현 샘플 // Here is an example of how you might implement transitioning from one stage to the next in a 2D RPG game using C and SDL2 #include enum GameState { MainMenu, GameLevel }; int main(int argc, char** argv) { SDL_Init(SDL_INIT_VIDEO); SDL_Window* window = SDL_CreateWindow("My Game", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 800, 600, 0); .. 2023. 1. 12.
728x90
LIST