python CSSE7030

news2024/11/25 22:39:03
1 Introduction
In this assignment, you will implement a (heavily) simplified version of the video game ”Into The Breach”. In this game players defend a set of civilian buildings from giant monsters. In order to achieve this goal, the player commands a set of equally giant mechanical heroes called ”Mechs”.
There are a variety of enemy and mech types, which each behave slightly differently. Gameplay is described in section 3 of this document.
Unlike assignment 1, in this assignment you will be using object-oriented programming and following the Apply Model-View-Controller design pattern shown in lectures. In addition to creating code for modelling the game, you will be implementing a graphical user interface (GUI). An example of a
final completed game is shown in Figure 1.
2 Getting Started
Download a2.zip from Blackboard — this archive contains the necessary files to start this assign ment. Once extracted, the a2.zip archive will provide the following files:
a2.py This is the only file you will submit and is where you write your code. Do not make changes  to any other files.
a2 support.py Do not modify or submit this file , it contains pre-defined classes, functions, and con stants to assist you in some parts of your assignment. In addition to these, you are encouraged  to create your own constants and helper functions in a2.py where possible.
levels/ This folder contains a small collection of files used to initialize games of Into The Breach . In  addition to these, you are encouraged to create your own files to help test your implementation where possible.
3 Gameplay
This section describes an overview of gameplay for Assignment 2. Where interactions are not ex
plicitly mentioned in this section, please see Section 4.
3.1 Definitions
Gameplay takes place on a rectangular grid of tiles called a board , on which different types of entities can stand. There are three types of tile: Ground tiles, mountain tiles, and building tiles. Building 
Figure 1: Example screenshot from a completed implementation. Note that your display may look slightly different depending on your operating system.
tiles each possess a given amount of health , which is the amount of damage they can suffer before they are destroyed . A building is destroyed if its health drops to 0. A tile may be blocking , in which case entities cannot stand on it. Tiles that are not blocking may have a maximum of one entity standing on them at any given time. Ground tiles are never blocking, mountain tiles are always  blocking, and building tiles are blocking if and only if they are not destroyed.
Entities may either be Mechs , which are controlled by the player, or Enemies , which attack the player’s mechs and buildings. There are two types of mech; the Tank Mech and the Heal Mech . There are also two types of enemy; the Scorpion and the Firefly . Each entity possesses 4 characteristics:
1. position : the coordinate of the tile within the board on which the entity is currently standing.
2. health : the remaining amount of damage the entity can suffer before it is destroyed . An entity is destroyed the moment its health drops to 0, at which point it is immediately removed from the game.
3. speed : the number of tiles the entity can move during its movement phase (see below for details). Entities can only move horizontally and vertically; that is, moving one tile diagonally is considered two individual movements.
4. strength : how much damage the entity deals to buildings and other entities (i.e. the amount by which it reduces the health of attacked buildings or entities).
The game is turn based, with each turn consisting of a player movement phase, an attack phase, and an enemy movement phase. During the player movement phase, the player has the option to move each of the mechs under their control to a new tile on the grid. During the attacking phase, each
mech and enemy perform an attack: an action that can damage mechs, enemies, or even buildings.
Each enemy, mech, and building can only receive a certain amount of damage. If a mech or enemy is destroyed before they attack during a given attack phase, they do not attack during that attack phase. During the enemy movement phase, each enemy chooses a tile as their objective, and then
moves to a new tile on the grid such that they are closer to their objective. The order in which 2mechs and enemies move and attack is determined by a fixed priority that will be displayed to the user at all times.

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1872162.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

FuTalk设计周刊-Vol.026

🔥🔥AI漫谈 热点捕手🔥🔥 1、Hotshot-XL AI文本转GIF Hotshot-XL 是一种 AI 文本转 GIF 模型,经过训练可与Stable Diffusion XL一起使用。能够使用任何现有或新微调的 SDXL 模型制作 GIF。 网页体验 网页http://htt…

【吊打面试官系列-MyBatis面试题】MyBatis 框架的缺点?

大家好,我是锋哥。今天分享关于 【MyBatis 框架的缺点?】面试题,希望对大家有帮助; MyBatis 框架的缺点? 1、SQL 语句的编写工作量较大,尤其当字段多、关联表多时,对开发人员编写 SQL 语句的功底…

昇思25天学习打卡营第5天|数据变换Transforms

数据变换Transforms 介绍Transforms分类Common TransformsVision TransformsText TransformsPythonTokenizer LookupLambda Transforms 参考 介绍 MindSpore提供不同种类的数据变换(Transforms),配合数据处理Pipeline来实现数据预处理。 所有…

Nest使用multer实现文件上传,并实现大文件分片上传(下)

上节我们学了在 Express 里用 multer 包处理 multipart/form-data 类型的请求中的 file。 单个、多个字段的单个、多个 file 都能轻松取出来。 接下来我们就来学习一下在Nest 里使用multer。 一,Nest如何使用multer实现文件上传 首先我们先创建一个Nest项目: nest…

BFS 解决拓扑排序

例题一 解法: 算法思路: 原问题可以转换成⼀个拓扑排序问题。⽤ BFS 解决拓扑排序即可。 拓扑排序流程: a. 将所有⼊度为 0 的点加⼊到队列中; b. 当队列不空的时候,⼀直循环: i. 取出队头元素&am…

Transformers 安装与基本使用

文章目录 Github文档推荐文章简介安装官方示例中文情感分析模型分词器 Tokenizer填充 Padding截断 Truncation google-t5/t5-small使用脚本进行训练Pytorch 机器翻译数据集下载数据集格式转换 Github https://github.com/huggingface/transformers 文档 https://huggingface…

上海亚商投顾:沪指震荡下跌 多只银行股创年内新高

上海亚商投顾前言:无惧大盘涨跌,解密龙虎榜资金,跟踪一线游资和机构资金动向,识别短期热点和强势个股。 一.市场情绪 三大指数昨日震荡调整,沪指尾盘跌近1%,深成指、创业板指均跌超1.5%。 板块概念方面&a…

六西格玛项目实战:数据驱动,手机PCM率直线下降

在当前智能手机市场日益竞争激烈的背景下,消费者对手机质量的要求达到了前所未有的高度。PCM(可能指生产过程中的某种不良率或缺陷率)作为影响手机质量的关键因素,直接关联到消费者满意度和品牌形象。为了应对这一挑战&#xff0c…

ICCV2023知识蒸馏相关论文速览

Paper1 Spatial Self-Distillation for Object Detection with Inaccurate Bounding Boxes 摘要原文: Object detection via inaccurate bounding box supervision has boosted a broad interest due to the expensive high-quality annotation data or the occasional inevit…

Windows CMD:快速入门

文字目录 一、概述二、常用命令2.1 切换盘符2.2 查看当前盘符下的所有文件2.3 进入单级目录2.4 返回上一级目录2.5 进入多级目录2.6 回到盘符目录2.7 清屏2.8 退出 三、练习 一、概述 CMD 是 Command的缩写,即命令的意思,它的作用是利用命令的方式来操作…

Linux-笔记 使用SCP命令传输文件报错 :IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!

前言 使用scp命令向开发板传输文件发生报错&#xff0c;报错见下图; 解决 rm -rf /home/<用户名>/.ssh/known_hosts 此方法同样适用于使用ssh命令连接开发板报错的情况。 参考 https://blog.csdn.net/westsource/article/details/6636096

大模型赋能全链路可观测性:运维效能的革新之旅

目录 全链路可观测工程与大模型结合---提升运维效能 可观测性&#xff08;Observability&#xff09;在IT系统中的应用及其重要性 统一建设可观测数据 统一建设可观测数据的策略与流程 全链路的构成和监控形态 云上的全链路可视方案 为什么一定是Copilot 大模型的Copilo…

基于iview.viewUI实现行合并(无限制/有限制合并)【已验证可正常运行】

1.基于iview.viewUI实现行合并&#xff08;列之间没有所属对应关系&#xff0c;正常合并&#xff09; 注&#xff1a;以下代码来自于GPT4o&#xff1a;国内直连GPT4o 只需要修改以下要合并的列字段&#xff0c;就可以方便使用啦 mergeFields: [majorNo, devNam, overhaulAdvic…

【EXCEL技巧】Excel如何将数字前面的0去掉

Excel文件中经常会遇到数据是0001345这种&#xff0c;那么&#xff0c;如何将数字前面的0去掉呢&#xff1f;今天和大家分享方法。 首先&#xff0c;选中一列空的单元格&#xff0c;然后在单元格中输入公式TEXT(D3,0)&#xff0c;这里的D3指的是前面带有0的数据的位置 回车之后…

Linux基础- 使用 Apache 服务部署静态网站

目录 零. 简介 一. linux安装Apache 二. 创建网页 三. window访问 修改了一下默认端口 到 8080 零. 简介 Apache 是世界使用排名第一的 Web 服务器软件。 它具有以下一些显著特点和优势&#xff1a; 开源免费&#xff1a;可以免费使用和修改&#xff0c;拥有庞大的社区支…

小程序备案小程序认证双系统

​打造安全合规的线上平台 &#x1f50d; 一、引言&#xff1a;为何需要小程序备案与认证&#xff1f; 在数字化快速发展的今天&#xff0c;小程序已成为企业、个人展示自身、提供服务的重要窗口。然而&#xff0c;随着小程序数量的快速增长&#xff0c;安全、合规等问题也逐渐…

jenkins设置定时构建语法

一、设置定时 定时构建的语法是*** * * * ***。 第一个*表示分钟&#xff0c;取值范围是0~59。例如&#xff0c;5 * * * *表示每个小时的第5分钟会构建一次&#xff1b;H/15 * * * 或/15 * * * 表示每隔15分钟构建一次&#xff1b; 第2个表示小时&#xff0c;取值范围是0~23。…

深度解析RocketMq源码-IndexFile

1.绪论 在工作中&#xff0c;我们经常需要根据msgKey查询到某条日志。但是&#xff0c;通过前面对commitLog分析&#xff0c;producer将消息推送到broker过后&#xff0c;其实broker是直接消息到达broker的先后顺序写入到commitLog中的。我们如果想根据msgKey检索一条消息无疑…

Embedding 、词嵌入、向量模型说的是一回事么?AI是如何理解世界?AI人不能不看的Embedding白话科普!

在AI理解世界的过程中&#xff0c;向量模型扮演着一个至关重要的角色&#xff0c;甚至可以说它是AI大模型用以构建和理解复杂数据的基础&#xff0c;也是对不同形态数据的一种标准化的“浓缩”。它能够将语言、图像、声音等多样化的信息&#xff0c;转化为一种通用的、数学化的…

知乎正通过乱码来干扰必应/谷歌等爬虫,从而限制中文数据集被用于AI训练

有用户反馈称使用微软必应搜索和谷歌搜索发现存在不少知乎乱码内容&#xff0c;即搜索结果里知乎内容的标题和正文内容都可能是乱码的&#xff0c;但抓取的正文前面一些段落内容可以正常查看。考虑到此前知乎已经屏蔽除百度和搜狗以外的所有搜索引擎爬虫 (蜘蛛 / 机器人)&#…