当前位置:网站首页>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
边栏推荐
- Correct opening method of option
- Implement a simple function to calculate the sum of all integers between M ~ n (m < n)
- Installation du docker redis
- Cells in rust share variable pointers
- Multi thread safe reference arc of rust
- Basic usage of crawler requests
- proxy server
- .104History
- Map basemap Library
- 2022 Jiangxi Photovoltaic Exhibition, China distributed Photovoltaic Exhibition, Nanchang solar energy utilization Exhibition
猜你喜欢

Jenkspy package installation

Welcome to the markdown editor

Using files to save data (C language)

Cloud native Virtualization: building edge computing instances based on kubevirt

Random number generation of C #
![[UDS unified diagnostic service] (Supplement) v. detailed explanation of ECU bootloader development points (1)](/img/74/bb173ca53d62304908ca80d3e96939.png)
[UDS unified diagnostic service] (Supplement) v. detailed explanation of ECU bootloader development points (1)

Implementation of image recognition code based on VGg convolutional neural network
![[UDS unified diagnostic service] IV. typical diagnostic service (6) - input / output control unit (0x2F)](/img/ae/cbfc01fbcc816915b1794a9d70247a.png)
[UDS unified diagnostic service] IV. typical diagnostic service (6) - input / output control unit (0x2F)

由tcl脚本生成板子对应的vivado工程

Map basemap Library
随机推荐
Go language JSON package usage
Climbing watermelon video URL
The difference between deep copy and shallow copy
An example of linear regression based on tensorflow
20222 return to the workplace
Installation du docker redis
ES6
Yolov4 pruning [with code]
Re expression régulière
Realization of consumer gray scale
Operators 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
I / O multiplexing and its related details
Process management command
Nat Commun|在生物科学领域应用深度学习的当前进展和开放挑战
Solving the problem of displaying too many unique values in ArcGIS partition statistics failed
From source code to executable file
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
Map basemap Library
Go语言JSON包使用