1. Homepage
  2. Coding
  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

Chat with a Specialist
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.
Assignment Writing Service

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:
Assignment Writing Service

·       Original C++ written by the student (any use of AI assistance is prohibited) Assignment Writing Service

·       private repository in the 5SD814-2024 organization (See Repository below) Assignment Writing Service

o   Suggestion: Use playground as a starting point for the assignment Assignment Writing Service

·       Solution using Visual Studio Community 2022 (v17.10 or newer) Assignment Writing Service

·       Must use Visual Studio project settings Assignment Writing Service

o   Warning level 4 /W4  Assignment Writing Service

o   Treat all warnings as errors /WX  Assignment Writing Service

o   Ignoring warning 41004189 and 4505 is allowed Assignment Writing Service

·       The project cannot have any memory leaks Assignment Writing Service

·       A good and consistent project directory- and file structure Assignment Writing Service

o   Separate code from project files, e.g. place code in a separate folder Assignment Writing Service

§  E.g. src/ or source/ or code/ for header and source files Assignment Writing Service

o   Separate code in header and source files e.g. player.h and player.cpp Assignment Writing Service

·       Project uses SDL, SFML or raylib Assignment Writing Service

o   No additional external libraries other than the ones provided by the instructor Assignment Writing Service

Assignment specific requirements that must be implemented: Assignment Writing Service

·       Implement Separating Axis Theorem collision detection between convex polygons in 2D Assignment Writing Service

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

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

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

Assignment general requirements that should be followed: Assignment Writing Service

·       Reduce complexity as much as possible, simpler is always better (KISS) Assignment Writing Service

·       Boy scout rule: Leave the campground cleaner than you found it Assignment Writing Service

·       Be consistent: If you do something a certain way, do all similar things in the same way Assignment Writing Service

·       Choose descriptive and unambiguous names Assignment Writing Service

·       Use pronounceable names Assignment Writing Service

·       Use searchable names Assignment Writing Service

·       Replace magic numbers with named constants Assignment Writing Service

·       Avoid encodings, don't append prefixes or type information Assignment Writing Service

·       Try to write small functions Assignment Writing Service

·       A function should do one thing and prefer fewer function arguments Assignment Writing Service

·       Use comments as explanation of intent or warning of consequences Assignment Writing Service

·       Comments shouldn't be redundant or add obvious noise Assignment Writing Service

·       Don't comment out code, just remove it! Assignment Writing Service

·       Don't break indentation, be consistent in how you align code (scopes etc.) Assignment Writing Service

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 .
Assignment Writing Service

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. Assignment Writing Service

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. Assignment Writing Service

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. Assignment Writing Service

  Assignment Writing Service

  Assignment Writing Service

  Assignment Writing Service

  Assignment Writing Service

  Assignment Writing Service

  Assignment Writing Service

作业 2 - 碰撞检测

介绍

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

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

要求

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

必须实施的项目要求:
Assignment Writing Service

·       源语言 由学生编写的 C++(禁止使用 AI 辅助) Assignment Writing Service

·       5SD814-2024 组织中的私有存储库 (请参阅下面的存储库) Assignment Writing Service

o   建议:使用 Playground 作为作业的起点 Assignment Writing Service

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

·       必须使用 Visual Studio 项目设置 Assignment Writing Service

o   警告级别/W4  Assignment Writing Service

o   将所有警告视为错误 /WX  Assignment Writing Service

o   允许忽略警告 41004189  4505 Assignment Writing Service

·       项目不能有任何内存泄漏 Assignment Writing Service

·       良好且一致的项目目录和文件结构 Assignment Writing Service

o   将代码与项目文件分开,例如将代码放在单独的文件夹中 Assignment Writing Service

§  例如,src/  source/  code/ 用于头文件和源文件 Assignment Writing Service

o   在头文件和源文件中分隔代码,例如 player.h  player.cpp Assignment Writing Service

·       项目使用 SDLSFML raylib Assignment Writing Service

o   除了教师提供的外部库外,没有其他外部库 Assignment Writing Service

必须实施的任务特定要求: Assignment Writing Service

·       2D
凸多边形之间实现分离轴定理碰撞检测
Assignment Writing Service

o   ,不允许使用 raylib-collision 函数,但可以自己实现算法 Assignment Writing Service

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

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

遵循的作业一般要求: Assignment Writing Service

·       尽可能降低复杂性,越简单越好 (KISS Assignment Writing Service

·       童子军规则:离开露营地时比你发现时更干净 Assignment Writing Service

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

·       选择描述性和明确的名称 Assignment Writing Service

·       使用可发音的名称 Assignment Writing Service

·       使用可搜索的名称 Assignment Writing Service

·       将幻数替换为命名常量 Assignment Writing Service

·       避免编码,不要附加前缀或类型信息 Assignment Writing Service

·       尝试编写小函数 Assignment Writing Service

·       函数应该只做一件事,并且更喜欢较少的函数参数 Assignment Writing Service

·       使用注释作为意图的解释或后果的警告 Assignment Writing Service

·       评论不应多余或添加明显的噪音 Assignment Writing Service

·       不要注释掉代码,只需删除它! Assignment Writing Service

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

存储 库

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

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

分级

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

交接

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

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

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

生成式 AI

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

  Assignment Writing Service

  Assignment Writing Service

联系辅导老师!
私密保护
WeChat 微信
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++代考,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++编程代写,UPPSALA作业答案,5SD814作业答案,Programming with C/C++作业答案,Computer Games作业答案,COLLISION DETECTION作业答案,C作业答案,C++作业答案,