当前位置:网站首页>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
边栏推荐
- C language input and output (printf and scanf functions, putchar and getchar functions)
- Gobang game based on pyGame Library
- Rust: how to match a string?
- Halo open source project learning (II): entity classes and data tables
- cv_ Solution of mismatch between bridge and opencv
- Docker 安装 Redis
- 2022 judgment questions and answers for operation of refrigeration and air conditioning equipment
- C# 网络相关操作
- Auto.js 自定义对话框
- [UDS unified diagnostic service] v. diagnostic application example: Flash bootloader
猜你喜欢

Go language JSON package usage

mysql自动启动设置用Systemctl start mysqld启动

Fashion classification case based on keras

Jenkspy package installation

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

Go的Gin框架学习

Random number generation of C #

MySQL 中的字符串函数

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

cv_ Solution of mismatch between bridge and opencv
随机推荐
Crawler for querying nicknames and avatars based on qqwebapi
Classification of cifar100 data set based on convolutional neural network
C byte array (byte []) and string are converted to each other
How to install jsonpath package
C language loop structure program
2022 Shanghai safety officer C certificate operation certificate examination question bank and simulation examination
mysql自动启动设置用Systemctl start mysqld启动
C language input and output (printf and scanf functions, putchar and getchar functions)
Go语言JSON包使用
Svn simple operation command
MySQL_ 01_ Simple data retrieval
ArcGIS license error -15 solution
Clion installation tutorial
7-21 wrong questions involve knowledge points.
Laser slam theory and practice of dark blue College Chapter 3 laser radar distortion removal exercise
YOLOv4剪枝【附代码】
Classes and objects
Flash - Middleware
Data stream encryption and decryption of C
Rewrite four functions such as StrCmp in C language