Comments (3)
同问,以及最新的规则是球拍具有移动速度限制吗?如果是这样的话,是按照球拍瞬移有一定的距离范围处理吗?
from pingpong.sessdsa.
已改为仅包含方向:
dict_op_side = {'position': copy.copy(op_player.pos),
'life': op_player.life,
'accelerate': -1 if op_player.action.acc < 0 else 1,
'run_vector': -1 if op_player.action.run < 0 else 1}
from pingpong.sessdsa.
移动速度限制已经设定:
def get_velocity(self):
# 球拍的全速是球X方向速度,按照体力值比例下降,当体力值下降到55%,将出现死角
return int((self.life / RACKET_LIFE) * BALL_V[1])
def update_pos_bat(self, tick_step):
# 如果指定迎球的距离大于最大速度的距离,则采用最大速度距离
self.pos.y += sign(self.action.bat) * min(abs(self.action.bat), self.get_velocity() * tick_step)
# 减少生命值
self.life -= int((abs(self.action.bat) / FACTOR_DISTANCE) ** 2)
def update_pos_run(self, tick_step):
# 如果指定跑位的距离大于最大速度的距离,则采用最大速度距离
self.pos.y += sign(self.action.bat) * min(abs(self.action.run), self.get_velocity() * tick_step)
# 减少生命值
self.life -= int((abs(self.action.run) / FACTOR_DISTANCE) ** 2)
from pingpong.sessdsa.
Related Issues (20)
- 最新版show.py无法使用 HOT 6
- 关于增加在对战结束后允许对战双方修改datastore的提议 HOT 1
- 为tabledata增加双方名字的属性 HOT 1
- 新的reader函数不保存记录了? HOT 3
- 解决了show.py的播放问题,可以选择播放 HOT 1
- 现在的pingpong.py如果重复对局,默认是把ds中的数据积存下来? HOT 3
- 调整游戏参数的建议 HOT 2
- 简约型道具图标 HOT 1
- 道具包提交:马里奥赛车8限定版道具包 HOT 2
- 跑位信息的bug HOT 3
- 认为捡道具触发过于严苛,建议设置松一点 HOT 4
- 建议:优化目录结构 HOT 2
- show可否输出每回合详细失分? HOT 1
- 代码中没有体现对算法每回合运行时间的限制? HOT 1
- 关于道具获取可能与路径经过的先后顺序不一致的问题 HOT 1
- 建议老师再次修改参数 HOT 7
- 隐身卡的问题 HOT 3
- 关于道具出现的时机 HOT 2
- 自己和自己就不用打了吧 HOT 1
- 关于传参时copy的问题 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pingpong.sessdsa.