C++

1. 적 개체 여러개를 백터배열로 구현 2. 총알 구현 2.1 bullet.h와 bullet.cpp로 구조를 만듦 2.2 방향을 일단 오른쪽 방향으로 쭉 발사하게 구현 GIt Hub https://github.com/KangSukW00/DribbleTheSpaceship.git
Day2까지 구현한 내용들을 player, enemy로 나눠서 클래스화 시켰음 GIT주소 https://github.com/KangSukW00/DribbleTheSpaceship/tree/8c03431c25a3b8a21040ac3cb35ac1f6d50139fe/Day3
1.동적할당과 메모리 누수 확인 2.적우주선이 플레이어를 따라가게 하기 3. 적우주선 위치값을 스택에서 힙메모리로 변환시키기 #define _CRTDBG_MAP_ALLOC #include #include #ifdef _DEBUG #define DBG_NEW new ( _NORMAL_BLOCK , __FILE__ , __LINE__) #else #define DBG_NEW new #endif #include #include void UpdatePlayerPosition(sf::Vector2f& playerPossition) { bool dPressed = sf::Keyboard::isKeyPressed(sf::Keyboard::D); bool aPressed = sf::Keyboard::isKeyPress..
DAY 1 완료한 작업 1) 플레이어 생성 2) 다수의 적 생성 / 위치 랜덤으로시작 3)플레이어 키보드로 조작 기능
게임명 : Dribble The Spaceship 개발 환경 : windows10 / visual studio 2022 / SFML 사용언어 : C++ 게임 내용 : 우주선을 조작해서 따라오는 적 우주선으로부터 도망간다. 일정 간격마다 조작하는 우주선에서 미사일이 제일 근접한 적 우주선을 격침시킨다. 적 우주선과 충돌하면 게임이 끝난다. 특정 버튼을 눌러 다시 시작한다.
Spring Force Hooke's Law, 질점이 1개일 때 L0 : 용수철 원래 길이 L : 용수철 나중 길이 K : 용수철의 경직 정도 Fspring : 원래 길이로 돌아가려는 용수철의 힘 ∝ K Hooke's Law, 질점이 2개일 때 Damping Force Damper : 두 물체의 상대속도를 줄여준다. 즉, 두 물체의 속도가 비슷해지도록 만든다 ( 현관문이 쾅 안닫히도록 해주는 그 장치와 같다 ) 스프링이 출렁거리는 정도를 서서히 줄여준다 Spring Force : '길이의 차이' 에 의해 작용 됨 Damping Force : '속도의 차이'에 의해 작용 됨 덤핑 계수 d : 단위 속도 당 물체의 운동을 방해하는 힘 질점이 1개일 때 Damping Force in 1D :질점이 1개일때, ..
RigidCircle.h "공" 객체를 찍어낼 클래스를 포함한 헤더 #pragma once #include "Game2D.h" namespace jm { class RigidCircle { public: vec2 pos; vec2 vel; RGB color = Colors::hotpink; float radius = 0.1f; float mass = 1.0f; public: void draw() { beginTransformation(); { translate(pos); drawFilledCircle(color, radius - 1e-3f); setLineWidth(2.0f); drawWiredCircle(Colors::black, radius); } endTransformation(); } void u..
기본 틀 코드 #include "Game2D.h" #include "Examples/PrimitivesGallery.h" #include "RandomNumberGenerator.h" #include #include namespace jm { class RigidCircle { public: vec2 pos; vec2 vel; const float radius = 0.1f; void draw() // 원 그리기 { beginTransformation(); { translate(pos); drawFilledCircle(Colors::hotpink, radius - 1e-3f); setLineWidth(2.0f); drawWiredCircle(Colors::black, radius); } endTransfo..
Roble
'C++' 태그의 글 목록