当前位置:网站首页>Robocode Tutorial 4 - robocode's game physics
Robocode Tutorial 4 - robocode's game physics
2022-04-23 18:04:00 【dawnsun001】
Robocode/ Game physics
Now let's look at Robocode Some physical parameters of .
Coordinate system :Robocode Cartesian coordinate system , That is, the bottom left corner we most often use is (0,0) spot . This is the same as the usual java And c++ Programming is different .
Direction agreement :
【 Absolute direction system 】:Robocode No matter which direction the robot is in, it is the absolute angle with the static battlefield screen as the reference (Heading), Above is 0 Degree angle . That is, to the north is 0, To the East is 90, To the south is 180, To the West 270.
【 Relative direction system 】: The relative direction is based on the dynamics of the robot heading The angle is the angle difference of the reference , No longer refer to the whole static screen . It's called relative because of the robot's heading It's constantly changing as the robot moves ,heading It's just a relative object .
【Heading】: Is the angle difference between the robot direction and the top of the screen , The direction is 0 To 360 Between .
【Bearing】: It is the angle difference between the target and the direction found by a certain part of the robot, such as radar , Clockwise is a positive angle at -180 To 180 Between .
The details are shown in the following figure :
Heading and Bearing The concept of is very important , This is the basis of all control , We must master .
Time and distance :
Robocode The basic unit of time is “ticks”, Every robo Every time ticks Move a unit .Robocode The unit of distance is pixels , But it should be noted that Robocode The distance inside distance yes Double Data of type , So mobile 1.2 A pixel can be realized , in addition , To fit the screen ,Robocode One pixel inside is smaller than the real one .
Other sports Physics :
Forward speed : The maximum speed of the tank (Velocity) by 8, Taipa number getVelocity() The tank is back
The speed of .
Add / deceleration : Acceleration is 1 Pixels (pixel)/ frame frame , The deceleration is 2 pixel/frame.
Refer to the formula : set up s For distance ,Vt Is the final speed ,Vo For the initial speed ,t For time ,a For acceleration :
Bit formula s=Vo*t+a*t*t/2
Speed formula Vt =Vo +a*t
Average velocity formula v=(Vt + Vo)/2=s/t
Acceleration Formula a=(Vt - Vo)/t
See... For more physical rules 《robocode The rules of the game 》
版权声明
本文为[dawnsun001]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230544289512.html
边栏推荐
- Identification verification code
- C# 的数据流加密与解密
- C byte array (byte []) and string are converted to each other
- idea中安装YapiUpload 插件将api接口上传到yapi文档上
- Click Cancel to return to the previous page and modify the parameter value of the previous page, let pages = getcurrentpages() let prevpage = pages [pages. Length - 2] / / the data of the previous pag
- Remember using Ali Font Icon Library for the first time
- Docker installation MySQL
- Jenkspy package installation
- Operation of 2022 mobile crane driver national question bank simulation examination platform
- C1 notes [task training part 2]
猜你喜欢
Operation of 2022 mobile crane driver national question bank simulation examination platform
[UDS unified diagnostic service] (Supplement) v. detailed explanation of ECU bootloader development points (2)
.105Location
Installation du docker redis
Fashion classification case based on keras
.104History
Romance in C language
Click Cancel to return to the previous page and modify the parameter value of the previous page, let pages = getcurrentpages() let prevpage = pages [pages. Length - 2] / / the data of the previous pag
Welcome to the markdown editor
Classification of cifar100 data set based on convolutional neural network
随机推荐
word frequency count
Anchor location - how to set the distance between the anchor and the top of the page. The anchor is located and offset from the top
Docker installation MySQL
A few lines of code teach you to crawl lol skin pictures
Closure type of rust (difference between FN, fnmut and fnone)
journal
Welcome to the markdown editor
idea中安装YapiUpload 插件将api接口上传到yapi文档上
ArcGIS table to excel exceeds the upper limit, conversion failed
Click Cancel to return to the previous page and modify the parameter value of the previous page, let pages = getcurrentpages() let prevpage = pages [pages. Length - 2] / / the data of the previous pag
Dock installation redis
Go file operation
C# 网络相关操作
ArcGIS license error -15 solution
Nodejs安装
How to install jsonpath package
Classes and objects
587. Install fence / Sword finger offer II 014 Anagrams in strings
C language to achieve 2048 small game direction merging logic
2022 judgment questions and answers for operation of refrigeration and air conditioning equipment