묻고 답해요
164만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결홍정모의 게임 만들기 연습 문제 패키지
총알이 여러발 나가도록 하려고 하는데 잘안됩니다...
void update() override { // move tank if (isKeyPressed(GLFW_KEY_LEFT))tank.center.x -= 0.5f * getTimeStep(); if (isKeyPressed(GLFW_KEY_RIGHT))tank.center.x += 0.5f * getTimeStep(); if (isKeyPressed(GLFW_KEY_UP))tank.center.y += 0.5f * getTimeStep(); if (isKeyPressed(GLFW_KEY_DOWN))tank.center.y -= 0.5f * getTimeStep(); // shoot a cannon ball if (isKeyPressedAndReleased(GLFW_KEY_SPACE)) { bullet = new MyBullet; bullet->center = tank.center; bullet->center.x += 0.2f; bullet->center.y += 0.1f; bullet->velocity = vec2(0.5f, 0.0f); if (bullet1 == nullptr)bullet1 = bullet; bullet = bullet->prev; } if (bullet1 != nullptr && (bullet1->velocity - bullet1->center) > 5) { bullet1 = bullet1->prev; } bullet_update = bullet1; while (bullet_update != nullptr) { bullet_update->update(getTimeStep()); bullet_update->draw(); bullet_update = bullet_update->prev; } // rendering tank.draw(); /*if (bullet1!= nullptr) { bullet1->draw(); }*/ } }; 우선 vec2에 대해서 오버로딩 시켜서 벡터 거리 값을 구해서 상수와 크기비교시킬수있도록 해놨습니다. 그래서 그 거리값을 기준으로 총알이 딜리트 시키도록 하려고 했습니다. 그후 리스트 형식을 이용하려고 총알 클래스에 총알 포인트 변수를 넣었고 이를 이용해서 스페이스바를 누르면 총알의 포인트는 총알이전 주소값 현재는 아무 주소값이 없으니깐 nullptr값으로 이동하게되고 이후 다시 스페이스바를 누르면 bullet->prev에 새로운 bullet 클래스를 만들고 여기에 다시 값을 주고 되고 반복하게 하고 제일처음 bullet값을 다른 bullet 클래스 변수 bullet1에 넣어서 이 변수가 조건이 만족되어 delete가 되면 이전변수로 넘어가게 되고 업데이트는 와일문으로 bullet1값에 있는 이전 변수 클래스들을 다 반복문 돌려서 업데이트 시키면서 draw까지 시키려고 했구요 근대 이렇게 생각해서 구현해보니깐 총알이 하나밖에 안나가고 그 총알 하나가 사라져야지 다른 총알이 나오게 됩니다. 뭐가 잘못된지 잘모르겠어서 그런데 좀 어디가 문제인지 알려주실수 있으신가요 너무 어렵네요....
-
해결됨React로 NodeBird SNS 만들기
댓글이 두개씩 달려서여
댓글이 2개씩 달리는데 혹시 이유를 알려주시면 감사여 https://github.com/hyunsokstar/node_bird_22/blob/master/front/components/PostCard.js https://github.com/hyunsokstar/node_bird_22/blob/master/front/reducers/post.js https://github.com/hyunsokstar/node_bird_22/blob/master/front/sagas/post.js
-
미해결윤재성의 Java 기반 Android 9.0(pie) App 개발 심화 2단계
외부 저장소 쓰기 할때 안됩니다.
2019-09-04 17:58:48.616 767-767/kr.co.cashq.fileinputoutput W/System.err: java.io.FileNotFoundException: /storage/emulated/0/Android/data/kr.co.cashq.fileinputoutput/sd_file.dat: open failed: ENOENT (No such file or directory) 2019-09-04 17:58:48.616 767-767/kr.co.cashq.fileinputoutput W/System.err: at libcore.io.IoBridge.open(IoBridge.java:496) 2019-09-04 17:58:48.616 767-767/kr.co.cashq.fileinputoutput W/System.err: at java.io.FileOutputStream.<init>(FileOutputStream.java:235) 2019-09-04 17:58:48.616 767-767/kr.co.cashq.fileinputoutput W/System.err: at java.io.FileOutputStream.<init>(FileOutputStream.java:125) 2019-09-04 17:58:48.616 767-767/kr.co.cashq.fileinputoutput W/System.err: at kr.co.cashq.fileinputoutput.MainActivity.btn3Method(MainActivity.java:124) 2019-09-04 17:58:48.616 767-767/kr.co.cashq.fileinputoutput W/System.err: at java.lang.reflect.Method.invoke(Native Method) 2019-09-04 17:58:48.616 767-767/kr.co.cashq.fileinputoutput W/System.err: at androidx.appcompat.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:385) 2019-09-04 17:58:48.616 767-767/kr.co.cashq.fileinputoutput W/System.err: at android.view.View.performClick(View.java:7140) 2019-09-04 17:58:48.617 767-767/kr.co.cashq.fileinputoutput W/System.err: at android.view.View.performClickInternal(View.java:7117) 2019-09-04 17:58:48.617 767-767/kr.co.cashq.fileinputoutput W/System.err: at android.view.View.access$3500(View.java:801) 2019-09-04 17:58:48.617 767-767/kr.co.cashq.fileinputoutput W/System.err: at android.view.View$PerformClick.run(View.java:27351) 2019-09-04 17:58:48.617 767-767/kr.co.cashq.fileinputoutput W/System.err: at android.os.Handler.handleCallback(Handler.java:883) 2019-09-04 17:58:48.617 767-767/kr.co.cashq.fileinputoutput W/System.err: at android.os.Handler.dispatchMessage(Handler.java:100) 2019-09-04 17:58:48.617 767-767/kr.co.cashq.fileinputoutput W/System.err: at android.os.Looper.loop(Looper.java:214) 2019-09-04 17:58:48.617 767-767/kr.co.cashq.fileinputoutput W/System.err: at android.app.ActivityThread.main(ActivityThread.java:7356) 2019-09-04 17:58:48.617 767-767/kr.co.cashq.fileinputoutput W/System.err: at java.lang.reflect.Method.invoke(Native Method) 2019-09-04 17:58:48.617 767-767/kr.co.cashq.fileinputoutput W/System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) 2019-09-04 17:58:48.617 767-767/kr.co.cashq.fileinputoutput W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) 2019-09-04 17:58:48.617 767-767/kr.co.cashq.fileinputoutput W/System.err: Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory) 2019-09-04 17:58:48.617 767-767/kr.co.cashq.fileinputoutput W/System.err: at libcore.io.Linux.open(Native Method) 2019-09-04 17:58:48.618 767-767/kr.co.cashq.fileinputoutput W/System.err: at libcore.io.ForwardingOs.open(ForwardingOs.java:167) 2019-09-04 17:58:48.618 767-767/kr.co.cashq.fileinputoutput W/System.err: at libcore.io.BlockGuardOs.open(BlockGuardOs.java:252) 2019-09-04 17:58:48.618 767-767/kr.co.cashq.fileinputoutput W/System.err: at libcore.io.ForwardingOs.open(ForwardingOs.java:167) 2019-09-04 17:58:48.618 767-767/kr.co.cashq.fileinputoutput W/System.err: at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7255) 2019-09-04 17:58:48.618 767-767/kr.co.cashq.fileinputoutput W/System.err: at libcore.io.IoBridge.open(IoBridge.java:482) 2019-09-04 17:58:48.618 767-767/kr.co.cashq.fileinputoutput W/System.err: ... 16 more 위와 같이 파일을 쓸 수 없다고 하네요. 뭘 잘못 한거죠?
-
미해결프로그래밍 시작하기 : 파이썬 입문 (Inflearn Original)
코드질문
제가 혼자서 영상 안보고 복습을 하면서 코드를 작성해보니, 마지막 print문이 영상과는 다르게 나왔더라구요. 혹시나 이렇게 작성을 해도 문제가 없는지 궁금합니다. 또한 info와 speak에는 __info__처럼 언더바를 붙이지 않는데, 이유가 있을까요? class dog: species = 'first dog' def __init__(self, name, age): self.name = name self.age = age def info(self): return f"My name is {self.name}. I'm {self.age} old." def speak(self, sounds): return f"{self.name} barks {sounds}." a = dog('SooJin', 25) print(dog.info(a))
-
미해결Node.js 교과서 - 기본부터 프로젝트 실습까지
질문이요
redis 쓰면, 이런 에러가 납니다 Error: A client must be directly provided to the RedisStore 코드를 똑같이 복사해도 같은 에러가 뜨네요...
-
미해결바닥부터 시작하는 STM32 드론 개발의 모든 것
UART Baud Rate 질문
일반적으로 사용하는 값(9600, 115200)이 아닌 921600 Baud Rate를 사용한 이유가 있으신가요?
-
미해결해외취업 ASP.NET Core 웹개발 기본 강좌
AddScoped, AddTransient, AddSingleton 차이점
안녕하십니까. 강의 다 듣고 두번째 듣고 있습니다. 좋은 강의 감사합니다. 위 세개의 차이가 잘 이해가 안되는데, 제가 이해하고 있는게 맞는지 확인해주실수 있으신지요? 범위의 개념이 잘 이해가 되지 않아서... 아무튼.. 제가 이해한것은 다음과 같습니다. 범위를 세션으로 봤습니다. AddTransient : 호출될 때마다 새로운 인스턴스가 생성됨 AddScoped : 세션단위로 동일한 인스턴스가 제공됨. 즉, 같은 세션에서는 항상 동일한 객체가 제공되나, 다른 세션이 생성되었다면 그 세션내에서는 그 세션 전용의 객체가 생성되어 제공됨 AddSingleton : 세션과는 무관하게 애플리케이션 전체에서 하나의 객체만 생성되어 제공됨 위 내용이 맞는지요? 잘못 이해되었다면 가름침 부탁드립니다.. 감사합니다.
-
해결됨예제로 배우는 스프링 입문 (개정판)
Error : Unable to access jarfile target/*.jar
mvnw package 후 Success Build가 되어서 java -jar target/*.jar를 Terminal에서 실행하였으나, Error: Unable to access jarfile target/*.jar 이라는 에러가 나옵니다.. 해당 디렉토리에 jarfile을 확인해보니, 있음에도 불구하고 명령어 실행이 안됩니다.. 운영체제는 windows입니다. target 파일에 있는 jar 파일 명을 복사하여 명령어 입력하면 no main manifest attribute, in taget/*.jar 이라고 나오네요!
-
미해결ATOM Editor 소개 및 사용법
바로가기 아이콘 만드는 법 알려주세요...
윈도우 사용자여서 그런지.... AtomSetup-x64만 생기고 화살표 붙은 바로가기 아이콘이 안 생기네요... 매번 켤때마다 새로 설치합니다. 우주선에 연료같은거 올라가는 영상? 이미지? 나오는 화면 뜨고요...
-
미해결C 프로그래밍 - 입문부터 게임 개발까지
제 코드좀 봐주실 수 있을까요?
안녕하세요 항상 쉽고 명료한 강의 덕분에 너무나 잘 배우고 있습니다. 제가 계산기 코드를 따로 짜봤는데 빌드업이 되지 않아서 한 번 봐주실 수 있을까요? #include <stdio.h> void p(int plus); int main(void) { int a; int b; int plus = a + b; printf("숫자 두 개를 입력하시오\n"); scanf_s("%d %d", &a, &b); p(plus); } void p(int plus) { printf("a+b는 %d입니다.\n",plus); }
-
미해결React로 NodeBird SNS 만들기
게시글 추가하면 key 에러가 발생해서여
index.js:1 Warning: Encountered two children with the same key, `[object Object]`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version. in div (at pages/index.js:28) in Home (at _app.js:28) in div (created by Context.Consumer) in Col (at AppLayout.js:38) in div (created by Context.Consumer) in Row (at AppLayout.js:29) in div (at AppLayout.js:19) in AppLayout (at _app.js:27) in Provider (at _app.js:21) in NodeBird (created by withRedux(NodeBird)) in withRedux(NodeBird) in Suspense (created by AppContainer) in Container (created by AppContainer) in AppContainer 이거 key를 바꿔야 되는건가여? https://github.com/hyunsokstar/node_bird_22/blob/master/front/pages/index.js 알려주시면 감사여 ~! ㄳㄳ~!
-
미해결스프링 데이터 JPA
Entity 특정 컬럼을 환경에 따라 설정할수 있을까요?..
같은 서비스를 여러 나라에서 서비스중입니다. 소스는 같이 사용하나 서버나 db는 다른환경에서 운영중입니다. 타나라에서만 제공할 서비스에 컬럼을 계속해서 추가하는데한국db테이블에도 불필요한 컬럼을 계속 추가해줘야하는 이슈가생기고 있습니다. 혹시 이럴경우에 쉽게 해결할수 있는 방법이 있을까요?
-
해결됨웹 게임을 만들며 배우는 자바스크립트
코드 질문드려요!
삭제된 글입니다
-
미해결Flutter 입문 - 안드로이드, iOS 개발을 한 번에 (with Firebase)
firebase 연동 후 빌드시 에러가 납니다.
firebase 연동 후 빌드시 빌드에러가 납니다. 1. android > build.gradle dependencies { classpath 'com.android.tools.build:gradle:3.3.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.google.gms:google-services:4.2.0' } 2. android > app > build.gradle defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.vampireahn.instagram_clon" minSdkVersion 16 targetSdkVersion 28 multiDexEnabled true versionCode flutterVersionCode.toInteger() versionName flutterVersionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"} dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test:runner:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' implementation 'com.google.firebase:firebase-core:16.0.7'}apply plugin: 'com.google.gms.google-services' 3. android > gradle.properties org.gradle.jvmargs=-Xmx1536Mandroid.useAndroidX=trueandroid.enableJetifier=true 위와같이 설정 후 빌드를 하면 * Error running Gradle: ProcessException: Process "/Users/an-yongjae/FlutterProjects/instagram_clon/instagram_clon/android/gradlew" exited abnormally: > Configure project :app registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection) registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection) registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection) WARNING: API 'variant.getJavaCompile()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()'. It will be removed at the end of 2019. For more information, see https://d.android.com/r/tools/task-configuration-avoidance. To determine what is calling variant.getJavaCompile(), use -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace. WARNING: API 'variant.getMergeAssets()' is obsolete and has been replaced with 'variant.getMergeAssetsProvider()'. It will be removed at the end of 2019. For more information, see https://d.android.com/r/tools/task-configuration-avoidance. To determine what is calling variant.getMergeAssets(), use -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace. WARNING: API 'variantOutput.getProcessResources()' is obsolete and has been replaced with 'variantOutput.getProcessResourcesProvider()'. It will be removed at the end of 2019. For more information, see https://d.android.com/r/tools/task-configuration-avoidance. To determine what is calling variantOutput.getProcessResources(), use -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace. ********************************************************* WARNING: This version of image_picker will break your Android build if it or its dependencies aren't compatible with AndroidX. See https://goo.gl/CP92wY for more information on the problem and how to fix it. This warning prints for all Android build failures. The real root cause of the error may be unrelated. ********************************************************* FAILURE: Build failed with an exception. * What went wrong: The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.0 and higher. The following dependencies do not satisfy the required version: root project 'android' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.71 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 5s Command: /Users/an-yongjae/FlutterProjects/instagram_clon/instagram_clon/android/gradlew app:properties Finished with error: Please review your Gradle project setup in the android/ folder. 와 같이 빌드 에러가 납니다. 어떻게 수정을 해야 하는지 조언 부탁 드립니다.
-
해결됨파이썬 입문 및 웹 크롤링을 활용한 다양한 자동화 어플리케이션 제작하기
txt결과값이 다릅니다
강의와 같은 코드를 작성했느데 a.string의 출력값이 변하지 않아서 어떤게 잘못된건지 알 수 있을까요? 다음에 find_all("a",string="daum")을 print해도 []이렇게 찾을 수 없습니다..
-
미해결React로 NodeBird SNS 만들기
가입하기를 눌렀을때 아이콘 효과가 안보여요
signup page에서 가입하기를 눌렀을때 <Button type="primary" htmlType="submit" loading={isSigningUp}>가입하기</Button> 버튼을 누르면 액션응ㄴ 디스패치 되고 isSigningUp 도 true => false로 바뀌는데 아이콘 빙글빙글이 안돌아가여 이유가 무엇일지 혹시 알려주시면 감사여 ~!~! 리덕스 사가 https://github.com/hyunsokstar/node_bird_22/blob/master/front/sagas/user.js
-
해결됨자바 ORM 표준 JPA 프로그래밍 - 기본편
Entity 클래스의 역할
안녕하세요. 강사님! 엔티티 클래스가 역할과 책임을 가지고 주도적으로 일을 하는 클래스가 되어야 할까요 아니면 그저 DTO 같은 데이터 저장소로써 역할만 하는것이 나은지 궁금합니다!
-
미해결바닥부터 시작하는 STM32 드론 개발의 모든 것
강의자료
강의 자료는 다운 받을 수는 없나요
-
미해결홍정모의 게임 만들기 연습 문제 패키지
13분 30초쯤에 메모리누수가 생긴다는게 잘이해가 안가네요
포탄을 쏘고 움직이고 포탄을 쏘면 메모리 릭이 생기신다고 하셨는데 왜 메모리릭이 생기는지 잘이해가 안갑니다. 15분에서 힌트 주신다면서 총알이 있는 상태에서 또 스페이스를 누르면 원래 나가던 총알이 딜리트가 안된상태에서 뉴 불릿으로 새롭게 만들어지면서 메모리릭이 생기게 된다 이 이유 때문인건가요? 아니면 다른 문제 인건가요? 그리고 혹시 이런 부분에서 메모리 릭이 실시간으로 나고있는지 아닌지 확인 하는 방법이 따배c++에서 비쥬얼 스튜디오로 프로파일링 하기 이부분을 참고하면 되는건가요?
-
미해결[리뉴얼] 파이썬입문과 크롤링기초 부트캠프 [파이썬, 웹, 데이터 이해 기본까지] (업데이트)
강의자료
강의자료를 다운로드 받을수 있나요 ?