1. Homepage
  2. Programming
  3. 5SD814 Programming with C/C++ 4: Computer Games in 2D - Assignment 2: COLLISION DETECTION

5SD814 Programming with C/C++ 4: Computer Games in 2D - Assignment 2: COLLISION DETECTION

Engage in a Conversation
UPPSALA5SD814Programming with C/C++Computer GamesCOLLISION DETECTIONCC++

ASSIGNMENT 2 - COLLISION DETECTION

Introduction

The Separating Axis Theorem (SAT) provides a powerful and efficient method for detecting collisions between convex polygons in 2D (and 3D). A convex polygon is a shape where all internal angles are less than or equal to 180 degrees, ensuring it "bulges outwards" rather than inward.  SAT simplifies collision detection by focusing on finding one axis (a line) along which the two shapes do not overlap.

In this individual assignment, you'll put your understanding of collision detection into practice by implementing SAT for convex polygons in 2D. This will give you a solid foundation for building more complex and engaging game mechanics in the future.
CourseNana.COM

Requirements

Lecture material, various coding snippets and solutions provided by the course responsible and teachers can and should be used as a basis for the implementation of the assignment. Also, the course literature used in Linear Algebra (5SD901) will be useful as a reference on some mathematical operations.

Project requirements that must be implemented:
CourseNana.COM

·       Original C++ written by the student (any use of AI assistance is prohibited) CourseNana.COM

·       private repository in the 5SD814-2024 organization (See Repository below) CourseNana.COM

o   Suggestion: Use playground as a starting point for the assignment CourseNana.COM

·       Solution using Visual Studio Community 2022 (v17.10 or newer) CourseNana.COM

·       Must use Visual Studio project settings CourseNana.COM

o   Warning level 4 /W4  CourseNana.COM

o   Treat all warnings as errors /WX  CourseNana.COM

o   Ignoring warning 41004189 and 4505 is allowed CourseNana.COM

·       The project cannot have any memory leaks CourseNana.COM

·       A good and consistent project directory- and file structure CourseNana.COM

o   Separate code from project files, e.g. place code in a separate folder CourseNana.COM

§  E.g. src/ or source/ or code/ for header and source files CourseNana.COM

o   Separate code in header and source files e.g. player.h and player.cpp CourseNana.COM

·       Project uses SDL, SFML or raylib CourseNana.COM

o   No additional external libraries other than the ones provided by the instructor CourseNana.COM

Assignment specific requirements that must be implemented: CourseNana.COM

·       Implement Separating Axis Theorem collision detection between convex polygons in 2D CourseNana.COM

o   I.e. you are not allowed to use raylib-collision functions, but implement the algorithm yourselves CourseNana.COM

·       Each object should render their outline, use color green (#00FF00) for non-overlapping and red (#FF0000) when objects are colliding CourseNana.COM

·       Animate each object over time, e.g. transform shapes to visualize collision between objects (move, rotate etc.) CourseNana.COM

Assignment general requirements that should be followed: CourseNana.COM

·       Reduce complexity as much as possible, simpler is always better (KISS) CourseNana.COM

·       Boy scout rule: Leave the campground cleaner than you found it CourseNana.COM

·       Be consistent: If you do something a certain way, do all similar things in the same way CourseNana.COM

·       Choose descriptive and unambiguous names CourseNana.COM

·       Use pronounceable names CourseNana.COM

·       Use searchable names CourseNana.COM

·       Replace magic numbers with named constants CourseNana.COM

·       Avoid encodings, don't append prefixes or type information CourseNana.COM

·       Try to write small functions CourseNana.COM

·       A function should do one thing and prefer fewer function arguments CourseNana.COM

·       Use comments as explanation of intent or warning of consequences CourseNana.COM

·       Comments shouldn't be redundant or add obvious noise CourseNana.COM

·       Don't comment out code, just remove it! CourseNana.COM

·       Don't break indentation, be consistent in how you align code (scopes etc.) CourseNana.COM

Repository

Give the repository a sensible name, e.g. 5SD814-Assignment2-<your-name-goes-here>. Commit frequently and try to always commit code that compiles and runs. At a bare minimum you should commit at least at the end of every programming session. 

If you need: Ask the instructor for guidance while setting up the repository on our gitea server .
CourseNana.COM

Grading

This assignment has Pass and Fail as grades. Successfully completing all assignment requirements will earn you a Pass. You will be graded on the last commit before the due date. CourseNana.COM

Hand-in

Failing to comply with any of the assignment requirements or hand-in steps will result in a Fail on the assignment.

The hand-in is a link to a commit in your repository, where the commit must be before the due date.

The repository must also include a 
readme.txt that contains the course name (with course code), the name of the student (i.e. your name), a short assignment description and a short usage description (i.e. how to use the program). Place this description text file in the root folder of the solution. The text file should also contain the name/names of other students you have collaborated with (if applicable for the assignment). You are allowed to - and encouraged - to talk to other students with regards to different approaches and implementations of the assignment; but obviously you must have implemented everything yourself. CourseNana.COM

Generative AI

Any use of generative AI is prohibited! See section "2.2 Use of Generative AI" in "Standards for the programmes at the Department of Game Design" on Studium > Modules > Department Standards 2024. CourseNana.COM

  CourseNana.COM

  CourseNana.COM

  CourseNana.COM

  CourseNana.COM

  CourseNana.COM

  CourseNana.COM

作业 2 - 碰撞检测

介绍

分离轴定理 (SAT) 提供了一种强大而有效的方法来检测 2D(和 3D)凸多边形之间的碰撞。凸多边形是所有内角都小于或等于 180 度的形状,确保它向外凸出而不是向内凸出。SAT 通过专注于查找两个形状不重叠的一个轴(一条线)来简化碰撞检测。

在这个单独的作业中,您将通过对 2D 凸多边形实施 SAT 来将您对碰撞检测的理解付诸实践。这将为您在未来构建更复杂和引人入胜的游戏机制打下坚实的基础。
CourseNana.COM

要求

负责课程和教师提供的讲座材料、各种编码片段和解决方案可以而且应该用作实施作业的基础。此外,线性代数 5SD901) 中使用的课程文献将用作某些数学运算的参考。

必须实施的项目要求:
CourseNana.COM

·       源语言 由学生编写的 C++(禁止使用 AI 辅助) CourseNana.COM

·       5SD814-2024 组织中的私有存储库 (请参阅下面的存储库) CourseNana.COM

o   建议:使用 Playground 作为作业的起点 CourseNana.COM

·       使用 Visual Studio Community 2022v17.10 或更高版本)的解决方案 CourseNana.COM

·       必须使用 Visual Studio 项目设置 CourseNana.COM

o   警告级别/W4  CourseNana.COM

o   将所有警告视为错误 /WX  CourseNana.COM

o   允许忽略警告 41004189  4505 CourseNana.COM

·       项目不能有任何内存泄漏 CourseNana.COM

·       良好且一致的项目目录和文件结构 CourseNana.COM

o   将代码与项目文件分开,例如将代码放在单独的文件夹中 CourseNana.COM

§  例如,src/  source/  code/ 用于头文件和源文件 CourseNana.COM

o   在头文件和源文件中分隔代码,例如 player.h  player.cpp CourseNana.COM

·       项目使用 SDLSFML raylib CourseNana.COM

o   除了教师提供的外部库外,没有其他外部库 CourseNana.COM

必须实施的任务特定要求: CourseNana.COM

·       2D
凸多边形之间实现分离轴定理碰撞检测
CourseNana.COM

o   ,不允许使用 raylib-collision 函数,但可以自己实现算法 CourseNana.COM

·       每个对象都应渲染其轮廓,对于不重叠的物体使用绿色 (#00FF00),在物体碰撞时使用红色 (#FF0000 CourseNana.COM

·       随时间对每个对象进行动画处理,例如变换形状以可视化对象之间的碰撞(移动、旋转等)。 CourseNana.COM

遵循的作业一般要求: CourseNana.COM

·       尽可能降低复杂性,越简单越好 (KISS CourseNana.COM

·       童子军规则:离开露营地时比你发现时更干净 CourseNana.COM

·       保持一致:如果您以某种方式做某事,则以相同的方式做所有相似的事情 CourseNana.COM

·       选择描述性和明确的名称 CourseNana.COM

·       使用可发音的名称 CourseNana.COM

·       使用可搜索的名称 CourseNana.COM

·       将幻数替换为命名常量 CourseNana.COM

·       避免编码,不要附加前缀或类型信息 CourseNana.COM

·       尝试编写小函数 CourseNana.COM

·       函数应该只做一件事,并且更喜欢较少的函数参数 CourseNana.COM

·       使用注释作为意图的解释或后果的警告 CourseNana.COM

·       评论不应多余或添加明显的噪音 CourseNana.COM

·       不要注释掉代码,只需删除它! CourseNana.COM

·       不要中断缩进,在对齐代码的方式(范围等)上保持一致 CourseNana.COM

存储 库

为存储库指定一个合理的名称,例如 5SD814-Assignment2-<your-name-goes-here>。经常提交并尝试始终提交可编译和运行的代码。至少您应该在每个编程会话结束时提交。

如果需要:在我们的 gitea 服务器上设置存储库时,请向讲师寻求指导.
CourseNana.COM

分级

此作业的成绩为通过不及格。成功完成所有作业要求将获得通行证。您将在截止日期之前的最后一次提交中评分。 CourseNana.COM

交接

未能遵守任何作业要求或提交步骤将导致作业不及格

提交是指向存储库中提交的链接,其中提交必须在截止日期之前提交。

存储库还必须包括一个
readme.txt,其中包含课程名称(带有课程代码)、学生姓名(即您的姓名)、简短的作业描述和简短的使用描述(即如何使用该程序)。将此描述文本文件放在解决方案的根文件夹中。文本文件还应包含与您合作的其他学生的姓名(如果适用于作业)。你可以 - 并鼓励 - 与其他学生讨论作业的不同方法和实施情况;但显然你必须自己实施所有工作。 CourseNana.COM

生成式 AI

禁止使用生成式 AI 请参阅 2024 Studium > Modules 游戏设计系课程标准中的2.2 生成式 AI 的使用部分> CourseNana.COM

  CourseNana.COM

  CourseNana.COM

Get in Touch with Our Experts

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
UPPSALA代写,5SD814代写,Programming with C/C++代写,Computer Games代写,COLLISION DETECTION代写,C代写,C++代写,UPPSALA代编,5SD814代编,Programming with C/C++代编,Computer Games代编,COLLISION DETECTION代编,C代编,C++代编,UPPSALA代考,5SD814代考,Programming with C/C++代考,Computer Games代考,COLLISION DETECTION代考,C代考,C++代考,UPPSALAhelp,5SD814help,Programming with C/C++help,Computer Gameshelp,COLLISION DETECTIONhelp,Chelp,C++help,UPPSALA作业代写,5SD814作业代写,Programming with C/C++作业代写,Computer Games作业代写,COLLISION DETECTION作业代写,C作业代写,C++作业代写,UPPSALA编程代写,5SD814编程代写,Programming with C/C++编程代写,Computer Games编程代写,COLLISION DETECTION编程代写,C编程代写,C++编程代写,UPPSALAprogramming help,5SD814programming help,Programming with C/C++programming help,Computer Gamesprogramming help,COLLISION DETECTIONprogramming help,Cprogramming help,C++programming help,UPPSALAassignment help,5SD814assignment help,Programming with C/C++assignment help,Computer Gamesassignment help,COLLISION DETECTIONassignment help,Cassignment help,C++assignment help,UPPSALAsolution,5SD814solution,Programming with C/C++solution,Computer Gamessolution,COLLISION DETECTIONsolution,Csolution,C++solution,