{"id":388357,"date":"2024-06-29T07:53:48","date_gmt":"2024-06-29T07:53:48","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=388357"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=388357","title":{"rendered":"<span>\u0424\u0438\u0437\u0438\u043a\u0430 \u0432 Python \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Pymunk<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0424\u0438\u0437\u0438\u043a\u0430. \u041a\u0442\u043e-\u0442\u043e \u0435\u0451 \u043b\u044e\u0431\u0438\u0442, \u043a\u0442\u043e-\u0442\u043e \u043d\u0435\u0442, \u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e \u044d\u0442\u043e \u043d\u0435\u043e\u0442\u044a\u0435\u043c\u043b\u0435\u043c\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0432\u0441\u0435\u0433\u043e 2 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Python. <\/p>\n<p>\u041a \u043a\u043e\u043d\u0446\u0443 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u0443\u044e \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u044e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0442\u0435\u043b \u0438 \u043f\u043e\u0439\u043c\u0451\u043c \u043e\u0441\u043d\u043e\u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <strong>Pymunk. <\/strong><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0e2\/aee\/b01\/0e2aeeb01d6494ec13b3f3cdee034276.gif\" width=\"720\" height=\"480\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0e2\/aee\/b01\/0e2aeeb01d6494ec13b3f3cdee034276.gif\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041c\u043e\u044f \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u043b\u043e\u0433\u0438\u044f:<\/p>\n<p><strong>\u0420\u0430\u0437\u0434\u0435\u043b &#8212; \u043a\u0443\u0441\u043e\u043a \u043a\u043e\u0434\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u043f\u043e\u043c\u0435\u0447\u0430\u044e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u043c, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u044d\u0442\u043e \u0432 \u0441\u0442\u0430\u0442\u044c\u0435<br \/>(\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0442\u0435\u0440\u043c\u0438\u043d\u0430 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f, \u043d\u043e \u043c\u043d\u0435 \u0442\u0430\u043a \u043f\u0440\u043e\u0449\u0435 \u0432\u0430\u043c \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c)<\/strong><\/p>\n<hr\/>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c\u0441\u044f \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0431\u043e\u0442\u044b<\/h2>\n<p>\u0418 \u0442\u0430\u043a, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b Python \u0432 \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0434\u043b\u044f \u0432\u0430\u0441 IDE <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0d6\/711\/d57\/0d6711d574bfd7fc9d7cc97ad4b8a8c8.png\" width=\"799\" height=\"602\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0d6\/711\/d57\/0d6711d574bfd7fc9d7cc97ad4b8a8c8.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c <strong>Pymunk<\/strong> \u0438<strong> Pygame<\/strong>. \u0410 \u0442\u0430\u043a \u0436\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0438\u0445 \u0434\u043b\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b.<br \/>\u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438\u0445 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <em>pip install<\/em><\/p>\n<p>\u0412\u043e\u0442 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">#\u0438\u043c\u043f\u043e\u0440\u0442 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 import pygame as pg import pymunk.pygame_util<\/code><\/pre>\n<p>\u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 PyGame \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 PyMunk, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u043e\u0433\u043d\u0430\u0442\u044c \u0438\u0445 \u043f\u043e\u0434 \u043e\u0434\u043d\u0443 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442<\/p>\n<figure class=\"float\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/8f1\/e96\/708\/8f1e9670852fff562f1621d5483c41e4.jpg\" alt=\"PyGame\" title=\"PyGame\" width=\"466\" height=\"306\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8f1\/e96\/708\/8f1e9670852fff562f1621d5483c41e4.jpg\" data-blurred=\"true\"\/><figcaption>PyGame<\/figcaption><\/figure>\n<figure class=\"float\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/047\/439\/b32\/047439b328490ab9057ef85b11ac9557.jpg\" alt=\"PyMunk\" title=\"PyMunk\" width=\"466\" height=\"306\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/047\/439\/b32\/047439b328490ab9057ef85b11ac9557.jpg\" data-blurred=\"true\"\/><figcaption>PyMunk<\/figcaption><\/figure>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043a\u043e\u0434 \u0432 &#171;\u0438\u043c\u043f\u043e\u0440\u0442 \u043c\u043e\u0434\u0443\u043b\u0435\u0439&#187; \u0434\u043b\u044f \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e<\/p>\n<pre><code class=\"python\">pymunk.pygame_util.positive_y_is_up = False<\/code><\/pre>\n<p>\u0423\u0440\u0430, \u043c\u044b \u043f\u043e\u0434\u043e\u0433\u043d\u0430\u043b\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0448\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c.<\/p>\n<h2>\u041e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 \u0432 Pygame<\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0443 \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u044e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u043a\u043e\u0434<\/p>\n<p>\u0417\u0430\u0434\u0430\u0434\u0438\u043c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u044d\u043a\u0440\u0430\u043d\u0430 \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e FPS.<\/p>\n<pre><code class=\"python\">#\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 PyGame RES = WIDTH, HEIGHT = 900, 720 FPS = 60  pg.init() surface = pg.display.set_mode(RES) clock = pg.time.Clock() draw_options = pymunk.pygame_util.DrawOptions(surface)<\/code><\/pre>\n<blockquote>\n<p>WIDTH \u0438 HEIGHT \u044d\u0442\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043e\u043a\u043d\u0430 Pygame.<\/p>\n<p>FPS &#8212; \u044d\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u0430\u0434\u0440\u043e\u0432 \u043e\u0431\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 (\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f 60)<\/p>\n<\/blockquote>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0446\u0438\u043a\u043b \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438. \u041e\u043d \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0435\u0433\u0434\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0441\u0430\u043c\u043e\u043c \u043a\u043e\u043d\u0446\u0435 \u043a\u043e\u0434\u0430.<\/p>\n<pre><code class=\"python\">while True:     surface.fill(pg.Color('black'))      for i in pg.event.get():         if i.type == pg.QUIT:             exit()     pg.display.flip()     clock.tick(FPS)<\/code><\/pre>\n<p><strong>\u041a\u043e\u0434 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/strong><\/p>\n<pre><code class=\"python\">#\u0438\u043c\u043e\u043f\u0440\u0442 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 import pygame as pg import pymunk.pygame_util pymunk.pygame_util.positive_y_is_up = False  #\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 PyGame RES = WIDTH, HEIGHT = 900, 720 FPS = 60  pg.init() surface = pg.display.set_mode(RES) clock = pg.time.Clock() draw_options = pymunk.pygame_util.DrawOptions(surface)  #\u041e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 PyGame while True:     surface.fill(pg.Color('black'))      for i in pg.event.get():         if i.type == pg.QUIT:             exit()                  pg.display.flip()     clock.tick(FPS)<\/code><\/pre>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0447\u0442\u043e \u0432\u044b\u0445\u043e\u0434\u0438\u0442. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/7f7\/565\/372\/7f756537204d18c459dcff4d29f42e92.png\" width=\"943\" height=\"749\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7f7\/565\/372\/7f756537204d18c459dcff4d29f42e92.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0430\u0448\u0435 \u043e\u043a\u043d\u043e \u0433\u043e\u0442\u043e\u0432\u043e \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u0438.<\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u041f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e<\/h2>\n<p>\u041d\u043e \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f \u0441 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c\u0438 \u043f\u043e\u043d\u044f\u0442\u0438\u044f\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 PyMunk.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e (space)<br \/><strong>Space<\/strong> &#8212; \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0435\u0434\u0438\u043d\u0438\u0446\u0430 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f PyMunk.\u00a0\u0412\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0435 \u043a \u043d\u0435\u043c\u0443 \u0442\u0432\u0435\u0440\u0434\u044b\u0435 \u0442\u0435\u043b\u0430, \u0444\u043e\u0440\u043c\u044b \u0438 \u0441\u0443\u0441\u0442\u0430\u0432\u044b, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u043e\u0434\u0432\u0438\u0433\u0430\u0435\u0442\u0435 \u0438\u0445 \u0432\u043f\u0435\u0440\u0435\u0434 \u0432\u043c\u0435\u0441\u0442\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 &#171;\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 PyMunk&#187; <strong>\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0430 &#171;\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 PyGame&#187;<\/strong> \u0438 \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0442\u0430\u043c space<\/p>\n<pre><code class=\"python\">#\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 Pymunk space = pymunk.Space()<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0435\u0441\u0442\u044c, \u043f\u043e\u0440\u0430 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0433\u0440\u0430\u0432\u0438\u0442\u0430\u0446\u0438\u044e.<\/p>\n<pre><code class=\"python\">space.gravity = 0, 8000<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0448 \u0440\u0430\u0437\u0434\u0435\u043b  &#171;\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 PyMunk&#187; \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"python\">#\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 Pymunk space = pymunk.Space() space.gravity = 0, 8000<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432\u0430\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<p><strong>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u0430\u0440\u0443 \u0441\u0442\u0440\u043e\u043a \u0432 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0443 \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0430 \u0440\u0438\u0441\u043e\u0432\u0430\u043b\u0430 \u043d\u0430\u0448\u0438 \u0442\u0435\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u0432 PyMunk:<\/strong><\/p>\n<pre><code class=\"python\">#\u041e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 while True:     surface.fill(pg.Color('black'))      for i in pg.event.get():         if i.type == pg.QUIT:             exit() #\u041c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0432\u043e\u0442 \u044d\u0442\u0438 2 \u0441\u0442\u0440\u043e\u043a\u0438:     space.step(1 \/ FPS)     space.debug_draw(draw_options)      pg.display.flip()     clock.tick(FPS)<\/code><\/pre>\n<p><strong>\u041a\u043e\u0434 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/strong><\/p>\n<pre><code class=\"python\">#\u0438\u043c\u043f\u043e\u0440\u0442 \u043c\u043e\u0434\u0443\u043b\u0435\u0439: import pygame as pg from random import randrange import pymunk.pygame_util pymunk.pygame_util.positive_y_is_up = False  #\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b PyGame RES = WIDTH, HEIGHT = 900, 720 FPS = 60  pg.init() surface = pg.display.set_mode(RES) clock = pg.time.Clock() draw_options = pymunk.pygame_util.DrawOptions(surface)  #\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 Pymunk space = pymunk.Space() space.gravity = 0, 8000  #\u041e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 while True:     surface.fill(pg.Color('black'))      for i in pg.event.get():         if i.type == pg.QUIT:             exit()      space.step(1 \/ FPS)     space.debug_draw(draw_options)      pg.display.flip()     clock.tick(FPS)<\/code><\/pre>\n<h3>\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0442\u0435\u043b\u0430<\/h3>\n<p>\u0412 <strong>PyMunk<\/strong> \u0435\u0441\u0442\u044c 3 \u0442\u0438\u043f\u0430 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432: \u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435, \u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0438 \u041a\u0438\u043d\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435<\/p>\n<blockquote>\n<p><strong>\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435<\/strong> (Dynamic) &#8212; \u041e\u0431\u044a\u0435\u043a\u0442\u044b \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u044e\u0442 \u043d\u0430 \u0441\u0442\u043e\u043b\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f, \u043d\u0430 \u043d\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442 \u0441\u0438\u043b\u044b \u0438 \u0433\u0440\u0430\u0432\u0438\u0442\u0430\u0446\u0438\u044f, \u043e\u043d\u0438 \u0438\u043c\u0435\u044e\u0442 \u043a\u043e\u043d\u0435\u0447\u043d\u0443\u044e \u043c\u0430\u0441\u0441\u0443. <br \/>\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0442\u0435\u043b\u0430 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438 \u0442\u0435\u043b.<\/p>\n<p><strong>\u041a\u0438\u043d\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435<\/strong> (Kinematic) &#8212; \u042d\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0437 \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0430, \u0430 \u043d\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0434\u0432\u0438\u0436\u043a\u0430. \u041d\u0430 \u043d\u0438\u0445 \u043d\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0433\u0440\u0430\u0432\u0438\u0442\u0430\u0446\u0438\u044f. \u0425\u043e\u0440\u043e\u0448\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043a\u0438\u043d\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0442\u0435\u043b: \u043b\u0435\u0442\u0430\u044e\u0449\u0438\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u0432 \u0438\u0433\u0440\u0430\u0445<\/p>\n<p><strong>\u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435<\/strong> (Static) &#8212; \u0422\u0435\u043b\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0434\u0432\u0438\u0433\u0430\u044e\u0442\u0441\u044f, \u043d\u043e \u043c\u043e\u0433\u0443\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0442\u0435\u043b\u0430\u043c\u0438.<br \/>\u0425\u043e\u0440\u043e\u0448\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 &#8212; \u0441\u0442\u0435\u043d\u044b \u0438 \u043f\u043e\u043b\u044b \u0432 \u0438\u0433\u0440\u0430\u0445.<\/p>\n<\/blockquote>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443:<\/p>\n<p>\u041f\u0438\u0448\u0435\u043c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 <strong>\u043f\u043e\u0441\u043b\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0430 &#171;\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 Pymunk&#187;<\/strong><\/p>\n<pre><code class=\"python\">#\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 segment_shape = pymunk.Segment(space.static_body, (1, HEIGHT), (WIDTH, HEIGHT), 26) space.add(segment_shape) segment_shape.elasticity = 0.4 segment_shape.friction = 1.0<\/code><\/pre>\n<blockquote>\n<p><strong>space.add(\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u043f\u044f\u0442\u0443\u044e)<\/strong> &#8212; \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e<\/p>\n<p><strong>segment_shape.elasticity<\/strong> &#8212; \u041a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0443\u043f\u0440\u0443\u0433\u043e\u0441\u0442\u0438<\/p>\n<p><strong>segment_shape.friction<\/strong> &#8212; \u041a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0442\u0440\u0435\u043d\u0438\u044f<\/p>\n<\/blockquote>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0ca\/30b\/e11\/0ca30be1151c8f11dbecaf37cddee070.png\" width=\"918\" height=\"293\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0ca\/30b\/e11\/0ca30be1151c8f11dbecaf37cddee070.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u042d\u0442\u0430 \u0441\u0435\u0440\u0430\u044f \u043f\u043e\u043b\u043e\u0441\u043a\u0430 &#8212; \u043d\u0430\u0448 \u043f\u0435\u0440\u0432\u044b\u0439 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442, \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0435 \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e.<br \/>\u0411\u0443\u0434\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0435\u0451 \u043f\u043e\u043b\u043e\u043c \u0434\u043b\u044f \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u0438.<\/p>\n<h2>\u0418\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u044b \u0438 \u0438\u0445 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435<\/h2>\n<p>\u0412\u044b \u0434\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0434\u043e \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0430 \u0441\u0442\u0430\u0442\u044c\u0438, \u043f\u043e\u0437\u0434\u0440\u0430\u0432\u043b\u044f\u044e!<br \/>\u0421\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c <strong>\u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0442\u0435\u043b\u0430 <\/strong>\u0438 \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043b\u044f \u043d\u0438\u0445 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435. <\/p>\n<p><strong>\u0418\u0434\u0435\u044f:<\/strong><br \/>\u041a\u043b\u0438\u043a\u0430\u044f \u043d\u0430 \u044d\u043a\u0440\u0430\u043d \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u044b \u043f\u043e\u0434\u0434\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0437\u0430\u043a\u043e\u043d\u0430\u043c \u0444\u0438\u0437\u0438\u043a\u0438.<\/p>\n<p><strong>\u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438:<\/strong><\/p>\n<pre><code class=\"python\">#\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u043a\u0438 def create_square(space, pos):     square_mass, square_size = 1, (60, 60)     square_moment = pymunk.moment_for_box(square_mass, square_size)     square_body = pymunk.Body(square_mass, square_moment)<\/code><\/pre>\n<blockquote>\n<p><strong>square_mass<\/strong><code> - \u043c\u0430\u0441\u0441\u0430 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0430 (\u0432 \u043d\u0430\u0448\u0435 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0432\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u043c\u0443)<\/code><\/p>\n<p><strong>square_size<\/strong> <code>- \u0440\u0430\u0437\u043c\u0435\u0440 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0430. \u041f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 (width, height)<\/code><\/p>\n<p><strong>square_moment = pymunk.moment_for_box<\/strong> &#8212; <code>\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043c\u043e\u043c\u0435\u043d\u0442 \u0438\u043d\u0435\u0440\u0446\u0438\u0438 \u0434\u043b\u044f box \u0437\u043d\u0430\u044f \u043c\u0430\u0441\u0441\u0443 \u0438 \u0440\u0430\u0437\u043c\u0435\u0440<\/code><\/p>\n<p><strong>quare_body = pymunk.Body<\/strong> &#8212; <code>\u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0442\u0435\u043b\u0430<\/code><\/p>\n<\/blockquote>\n<p>\u0412\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0439 \u0444\u0438\u0447\u0438: C\u0434\u0435\u043b\u0430\u0435\u043c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u044b \u043f\u043e\u044f\u0432\u043b\u044f\u043b\u0438\u0441\u044c \u043d\u0430 \u043c\u0435\u0441\u0442\u0435 \u0433\u0434\u0435 \u0441\u0442\u043e\u0438\u0442 \u043a\u0443\u0440\u0441\u043e\u0440<\/p>\n<pre><code class=\"python\">def create_square(space, pos):     square_mass, square_size = 1, (60, 60)     square_moment = pymunk.moment_for_box(square_mass, square_size)     square_body = pymunk.Body(square_mass, square_moment)     # \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u043a\u0443\u0440\u0441\u043e\u0440\u0430     square_body.position = pos<\/code><\/pre>\n<blockquote>\n<p><strong>square_body.position<\/strong><code> - \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0442\u0435\u043b\u0430<\/code><\/p>\n<\/blockquote>\n<pre><code class=\"python\">def create_square(space, pos):     square_mass, square_size = 1, (60, 60)     square_moment = pymunk.moment_for_box(square_mass, square_size)     square_body = pymunk.Body(square_mass, square_moment)     square_body.position = pos     square_shape = pymunk.Poly.create_box(square_body, square_size)     square_shape.elasticity = 0.8     square_shape.friction = 1.0<\/code><\/pre>\n<p>\u0424\u0438\u0447\u0430 \u043f\u043e\u0434 \u043d\u043e\u043c\u0435\u0440\u043e\u043c \u0434\u0432\u0430: \u0446\u0432\u0435\u0442 \u043a\u0443\u0431\u0438\u043a\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u043d\u0434\u043e\u043c\u0435\u043d. <br \/>\u0421\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"python\">square_shape.color = [randrange(256) for i in range(4)]<\/code><\/pre>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446 \u0434\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0432 \u0438\u0442\u043e\u0433\u0435 \u043e\u043d\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"python\">def create_square(space, pos):     square_mass, square_size = 1, (60, 60)     square_moment = pymunk.moment_for_box(square_mass, square_size)     square_body = pymunk.Body(square_mass, square_moment)     square_body.position = pos     square_shape = pymunk.Poly.create_box(square_body, square_size)     square_shape.elasticity = 0.8     square_shape.friction = 1.0     square_shape.color = [randrange(256) for i in range(4)]     space.add(square_body, square_shape)<\/code><\/pre>\n<blockquote>\n<p>\u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e \u0447\u0442\u043e <strong>space.add <\/strong>\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u0435\u043b\u043e \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432<\/p>\n<\/blockquote>\n<p><strong>\u041c\u044b \u043d\u0430 \u0444\u0438\u043d\u0438\u0448\u043d\u043e\u0439 \u043f\u0440\u044f\u043c\u043e\u0439! \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0443.<\/strong><\/p>\n<pre><code class=\"python\"># \u0441\u043f\u0430\u0432\u043d \u043a\u0443\u0431\u0438\u043a\u043e\u0432         if i.type == pg.MOUSEBUTTONDOWN:             if i.button == 1:                 create_square(space, i.pos)                 print(i.pos)<\/code><\/pre>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"python\">#\u041e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 while True:     surface.fill(pg.Color('black'))      for i in pg.event.get():         if i.type == pg.QUIT:             exit()         # \u0441\u043f\u0430\u0432\u043d \u043c\u044f\u0447\u0438\u043a\u043e\u0432         if i.type == pg.MOUSEBUTTONDOWN:             if i.button == 1:                 create_square(space, i.pos)                 print(i.pos)      space.step(1 \/ FPS)     space.debug_draw(draw_options)      pg.display.flip()     clock.tick(FPS)  print('end')<\/code><\/pre>\n<h2>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c<\/h2>\n<p>\u0421\u0447\u0438\u0442\u0430\u044e \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043e\u0442\u043b\u0438\u0447\u043d\u043e \ud83d\ude42<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/555\/bd7\/1e8\/555bd71e89517b448df05c3806a8b47e.gif\" alt=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\" title=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\" width=\"1080\" height=\"720\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/555\/bd7\/1e8\/555bd71e89517b448df05c3806a8b47e.gif\"\/><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/figcaption><\/figure>\n<p><strong>\u0412\u0435\u0441\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434:<\/strong><\/p>\n<pre><code class=\"python\">#\u0438\u043c\u043f\u043e\u0440\u0442 \u043c\u043e\u0434\u0443\u043b\u0435\u0439: import pygame as pg from random import randrange import pymunk.pygame_util pymunk.pygame_util.positive_y_is_up = False  #\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b PyGame RES = WIDTH, HEIGHT = 900, 720 FPS = 60  pg.init() surface = pg.display.set_mode(RES) clock = pg.time.Clock() draw_options = pymunk.pygame_util.DrawOptions(surface)  #\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 Pymunk space = pymunk.Space() space.gravity = 0, 8000  #\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 segment_shape = pymunk.Segment(space.static_body, (2, HEIGHT), (WIDTH, HEIGHT), 26) space.add(segment_shape) segment_shape.elasticity = 0.8 segment_shape.friction = 1.0    #\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u043a\u0438 body = pymunk.Body() def create_square(space, pos):     square_mass, square_size = 1, (60, 60)     square_moment = pymunk.moment_for_box(square_mass, square_size)     square_body = pymunk.Body(square_mass, square_moment)     square_body.position = pos     square_shape = pymunk.Poly.create_box(square_body, square_size)     square_shape.elasticity = 0.4     square_shape.friction = 1.0     square_shape.color = [randrange(256) for i in range(4)]     space.add(square_body, square_shape)   #\u041e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 while True:     surface.fill(pg.Color('black'))      for i in pg.event.get():         if i.type == pg.QUIT:             exit()         # \u0441\u043f\u0430\u0432\u043d \u043a\u0443\u0431\u0438\u043a\u043e\u0432         if i.type == pg.MOUSEBUTTONDOWN:             if i.button == 1:                 create_square(space, i.pos)                 print(i.pos)      space.step(1 \/ FPS)     space.debug_draw(draw_options)      pg.display.flip()     clock.tick(FPS)  print('end') <\/code><\/pre>\n<h2>\u0418\u0442\u043e\u0433<\/h2>\n<p>\u041c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043d\u0430 PyGame \u0438 PyMunk \u0441 \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u0435\u0439 \u0444\u0438\u0437\u0438\u043a\u0438.<\/p>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0430\u043c\u0438 \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e, \u0441\u0442\u0430\u0442\u044c\u0438 \u0438 \u0432\u0438\u0434\u0435\u043e \u0441 \u044e\u0442\u044e\u0431\u0430. <br \/>\u041d\u043e \u044f \u0442\u043e\u0436\u0435 \u043d\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0441\u044c \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0442\u044c \u043d\u0430 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e \u044d\u0442\u043e\u0439 \u0442\u0435\u043c\u0435.<\/p>\n<p>\u0414\u043e \u0441\u0432\u044f\u0437\u0438)<\/p>\n<p><code>\u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b: Standalone Coder, \u0444\u043e\u0440\u0443\u043c\u044b, \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f.<\/code><\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/593547\/\"> https:\/\/habr.com\/ru\/articles\/593547\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0424\u0438\u0437\u0438\u043a\u0430. \u041a\u0442\u043e-\u0442\u043e \u0435\u0451 \u043b\u044e\u0431\u0438\u0442, \u043a\u0442\u043e-\u0442\u043e \u043d\u0435\u0442, \u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e \u044d\u0442\u043e \u043d\u0435\u043e\u0442\u044a\u0435\u043c\u043b\u0435\u043c\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0432\u0441\u0435\u0433\u043e 2 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Python. <\/p>\n<p>\u041a \u043a\u043e\u043d\u0446\u0443 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u0443\u044e \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u044e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0442\u0435\u043b \u0438 \u043f\u043e\u0439\u043c\u0451\u043c \u043e\u0441\u043d\u043e\u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <strong>Pymunk. <\/strong><\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041c\u043e\u044f \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u043b\u043e\u0433\u0438\u044f:<\/p>\n<p><strong>\u0420\u0430\u0437\u0434\u0435\u043b &#8212; \u043a\u0443\u0441\u043e\u043a \u043a\u043e\u0434\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u043f\u043e\u043c\u0435\u0447\u0430\u044e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u043c, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u044d\u0442\u043e \u0432 \u0441\u0442\u0430\u0442\u044c\u0435<br \/>(\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0442\u0435\u0440\u043c\u0438\u043d\u0430 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f, \u043d\u043e \u043c\u043d\u0435 \u0442\u0430\u043a \u043f\u0440\u043e\u0449\u0435 \u0432\u0430\u043c \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c)<\/strong><\/p>\n<hr\/>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c\u0441\u044f \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0431\u043e\u0442\u044b<\/h2>\n<p>\u0418 \u0442\u0430\u043a, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b Python \u0432 \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0434\u043b\u044f \u0432\u0430\u0441 IDE <\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c <strong>Pymunk<\/strong> \u0438<strong> Pygame<\/strong>. \u0410 \u0442\u0430\u043a \u0436\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0438\u0445 \u0434\u043b\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b.<br \/>\u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438\u0445 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <em>pip install<\/em><\/p>\n<p>\u0412\u043e\u0442 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">#\u0438\u043c\u043f\u043e\u0440\u0442 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 import pygame as pg import pymunk.pygame_util<\/code><\/pre>\n<p>\u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 PyGame \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 PyMunk, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u043e\u0433\u043d\u0430\u0442\u044c \u0438\u0445 \u043f\u043e\u0434 \u043e\u0434\u043d\u0443 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442<\/p>\n<figure class=\"float\"><figcaption>PyGame<\/figcaption><\/figure>\n<figure class=\"float\"><figcaption>PyMunk<\/figcaption><\/figure>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043a\u043e\u0434 \u0432 &#171;\u0438\u043c\u043f\u043e\u0440\u0442 \u043c\u043e\u0434\u0443\u043b\u0435\u0439&#187; \u0434\u043b\u044f \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e<\/p>\n<pre><code class=\"python\">pymunk.pygame_util.positive_y_is_up = False<\/code><\/pre>\n<p>\u0423\u0440\u0430, \u043c\u044b \u043f\u043e\u0434\u043e\u0433\u043d\u0430\u043b\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0448\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c.<\/p>\n<h2>\u041e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 \u0432 Pygame<\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0443 \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u044e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u043a\u043e\u0434<\/p>\n<p>\u0417\u0430\u0434\u0430\u0434\u0438\u043c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u044d\u043a\u0440\u0430\u043d\u0430 \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e FPS.<\/p>\n<pre><code class=\"python\">#\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 PyGame RES = WIDTH, HEIGHT = 900, 720 FPS = 60  pg.init() surface = pg.display.set_mode(RES) clock = pg.time.Clock() draw_options = pymunk.pygame_util.DrawOptions(surface)<\/code><\/pre>\n<blockquote>\n<p>WIDTH \u0438 HEIGHT \u044d\u0442\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043e\u043a\u043d\u0430 Pygame.<\/p>\n<p>FPS &#8212; \u044d\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u0430\u0434\u0440\u043e\u0432 \u043e\u0431\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 (\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f 60)<\/p>\n<\/blockquote>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0446\u0438\u043a\u043b \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438. \u041e\u043d \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0435\u0433\u0434\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0441\u0430\u043c\u043e\u043c \u043a\u043e\u043d\u0446\u0435 \u043a\u043e\u0434\u0430.<\/p>\n<pre><code class=\"python\">while True:     surface.fill(pg.Color('black'))      for i in pg.event.get():         if i.type == pg.QUIT:             exit()     pg.display.flip()     clock.tick(FPS)<\/code><\/pre>\n<p><strong>\u041a\u043e\u0434 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/strong><\/p>\n<pre><code class=\"python\">#\u0438\u043c\u043e\u043f\u0440\u0442 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 import pygame as pg import pymunk.pygame_util pymunk.pygame_util.positive_y_is_up = False  #\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 PyGame RES = WIDTH, HEIGHT = 900, 720 FPS = 60  pg.init() surface = pg.display.set_mode(RES) clock = pg.time.Clock() draw_options = pymunk.pygame_util.DrawOptions(surface)  #\u041e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 PyGame while True:     surface.fill(pg.Color('black'))      for i in pg.event.get():         if i.type == pg.QUIT:             exit()                  pg.display.flip()     clock.tick(FPS)<\/code><\/pre>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0447\u0442\u043e \u0432\u044b\u0445\u043e\u0434\u0438\u0442. <\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0430\u0448\u0435 \u043e\u043a\u043d\u043e \u0433\u043e\u0442\u043e\u0432\u043e \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u0438.<\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u041f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e<\/h2>\n<p>\u041d\u043e \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f \u0441 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c\u0438 \u043f\u043e\u043d\u044f\u0442\u0438\u044f\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 PyMunk.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e (space)<br \/><strong>Space<\/strong> &#8212; \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0435\u0434\u0438\u043d\u0438\u0446\u0430 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f PyMunk.\u00a0\u0412\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0435 \u043a \u043d\u0435\u043c\u0443 \u0442\u0432\u0435\u0440\u0434\u044b\u0435 \u0442\u0435\u043b\u0430, \u0444\u043e\u0440\u043c\u044b \u0438 \u0441\u0443\u0441\u0442\u0430\u0432\u044b, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u043e\u0434\u0432\u0438\u0433\u0430\u0435\u0442\u0435 \u0438\u0445 \u0432\u043f\u0435\u0440\u0435\u0434 \u0432\u043c\u0435\u0441\u0442\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 &#171;\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 PyMunk&#187; <strong>\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0430 &#171;\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 PyGame&#187;<\/strong> \u0438 \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0442\u0430\u043c space<\/p>\n<pre><code class=\"python\">#\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 Pymunk space = pymunk.Space()<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0435\u0441\u0442\u044c, \u043f\u043e\u0440\u0430 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0433\u0440\u0430\u0432\u0438\u0442\u0430\u0446\u0438\u044e.<\/p>\n<pre><code class=\"python\">space.gravity = 0, 8000<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0448 \u0440\u0430\u0437\u0434\u0435\u043b  &#171;\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 PyMunk&#187; \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"python\">#\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 Pymunk space = pymunk.Space() space.gravity = 0, 8000<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432\u0430\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<p><strong>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u0430\u0440\u0443 \u0441\u0442\u0440\u043e\u043a \u0432 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0443 \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0430 \u0440\u0438\u0441\u043e\u0432\u0430\u043b\u0430 \u043d\u0430\u0448\u0438 \u0442\u0435\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u0432 PyMunk:<\/strong><\/p>\n<pre><code class=\"python\">#\u041e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 while True:     surface.fill(pg.Color('black'))      for i in pg.event.get():         if i.type == pg.QUIT:             exit() #\u041c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0432\u043e\u0442 \u044d\u0442\u0438 2 \u0441\u0442\u0440\u043e\u043a\u0438:     space.step(1 \/ FPS)     space.debug_draw(draw_options)      pg.display.flip()     clock.tick(FPS)<\/code><\/pre>\n<p><strong>\u041a\u043e\u0434 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/strong><\/p>\n<pre><code class=\"python\">#\u0438\u043c\u043f\u043e\u0440\u0442 \u043c\u043e\u0434\u0443\u043b\u0435\u0439: import pygame as pg from random import randrange import pymunk.pygame_util pymunk.pygame_util.positive_y_is_up = False  #\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b PyGame RES = WIDTH, HEIGHT = 900, 720 FPS = 60  pg.init() surface = pg.display.set_mode(RES) clock = pg.time.Clock() draw_options = pymunk.pygame_util.DrawOptions(surface)  #\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 Pymunk space = pymunk.Space() space.gravity = 0, 8000  #\u041e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 while True:     surface.fill(pg.Color('black'))      for i in pg.event.get():         if i.type == pg.QUIT:             exit()      space.step(1 \/ FPS)     space.debug_draw(draw_options)      pg.display.flip()     clock.tick(FPS)<\/code><\/pre>\n<h3>\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0442\u0435\u043b\u0430<\/h3>\n<p>\u0412 <strong>PyMunk<\/strong> \u0435\u0441\u0442\u044c 3 \u0442\u0438\u043f\u0430 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432: \u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435, \u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0438 \u041a\u0438\u043d\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435<\/p>\n<blockquote>\n<p><strong>\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435<\/strong> (Dynamic) &#8212; \u041e\u0431\u044a\u0435\u043a\u0442\u044b \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u044e\u0442 \u043d\u0430 \u0441\u0442\u043e\u043b\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f, \u043d\u0430 \u043d\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442 \u0441\u0438\u043b\u044b \u0438 \u0433\u0440\u0430\u0432\u0438\u0442\u0430\u0446\u0438\u044f, \u043e\u043d\u0438 \u0438\u043c\u0435\u044e\u0442 \u043a\u043e\u043d\u0435\u0447\u043d\u0443\u044e \u043c\u0430\u0441\u0441\u0443. <br \/>\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0442\u0435\u043b\u0430 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438 \u0442\u0435\u043b.<\/p>\n<p><strong>\u041a\u0438\u043d\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435<\/strong> (Kinematic) &#8212; \u042d\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0437 \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0430, \u0430 \u043d\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0434\u0432\u0438\u0436\u043a\u0430. \u041d\u0430 \u043d\u0438\u0445 \u043d\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0433\u0440\u0430\u0432\u0438\u0442\u0430\u0446\u0438\u044f. \u0425\u043e\u0440\u043e\u0448\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043a\u0438\u043d\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0442\u0435\u043b: \u043b\u0435\u0442\u0430\u044e\u0449\u0438\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u0432 \u0438\u0433\u0440\u0430\u0445<\/p>\n<p><strong>\u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435<\/strong> (Static) &#8212; \u0422\u0435\u043b\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0434\u0432\u0438\u0433\u0430\u044e\u0442\u0441\u044f, \u043d\u043e \u043c\u043e\u0433\u0443\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0442\u0435\u043b\u0430\u043c\u0438.<br \/>\u0425\u043e\u0440\u043e\u0448\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 &#8212; \u0441\u0442\u0435\u043d\u044b \u0438 \u043f\u043e\u043b\u044b \u0432 \u0438\u0433\u0440\u0430\u0445.<\/p>\n<\/blockquote>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443:<\/p>\n<p>\u041f\u0438\u0448\u0435\u043c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 <strong>\u043f\u043e\u0441\u043b\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0430 &#171;\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 Pymunk&#187;<\/strong><\/p>\n<pre><code class=\"python\">#\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 segment_shape = pymunk.Segment(space.static_body, (1, HEIGHT), (WIDTH, HEIGHT), 26) space.add(segment_shape) segment_shape.elasticity = 0.4 segment_shape.friction = 1.0<\/code><\/pre>\n<blockquote>\n<p><strong>space.add(\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u043f\u044f\u0442\u0443\u044e)<\/strong> &#8212; \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e<\/p>\n<p><strong>segment_shape.elasticity<\/strong> &#8212; \u041a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0443\u043f\u0440\u0443\u0433\u043e\u0441\u0442\u0438<\/p>\n<p><strong>segment_shape.friction<\/strong> &#8212; \u041a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0442\u0440\u0435\u043d\u0438\u044f<\/p>\n<\/blockquote>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u042d\u0442\u0430 \u0441\u0435\u0440\u0430\u044f \u043f\u043e\u043b\u043e\u0441\u043a\u0430 &#8212; \u043d\u0430\u0448 \u043f\u0435\u0440\u0432\u044b\u0439 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442, \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0435 \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e.<br \/>\u0411\u0443\u0434\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0435\u0451 \u043f\u043e\u043b\u043e\u043c \u0434\u043b\u044f \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u0438.<\/p>\n<h2>\u0418\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u044b \u0438 \u0438\u0445 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435<\/h2>\n<p>\u0412\u044b \u0434\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0434\u043e \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0430 \u0441\u0442\u0430\u0442\u044c\u0438, \u043f\u043e\u0437\u0434\u0440\u0430\u0432\u043b\u044f\u044e!<br \/>\u0421\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c <strong>\u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0442\u0435\u043b\u0430 <\/strong>\u0438 \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043b\u044f \u043d\u0438\u0445 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435. <\/p>\n<p><strong>\u0418\u0434\u0435\u044f:<\/strong><br \/>\u041a\u043b\u0438\u043a\u0430\u044f \u043d\u0430 \u044d\u043a\u0440\u0430\u043d \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u044b \u043f\u043e\u0434\u0434\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0437\u0430\u043a\u043e\u043d\u0430\u043c \u0444\u0438\u0437\u0438\u043a\u0438.<\/p>\n<p><strong>\u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438:<\/strong><\/p>\n<pre><code class=\"python\">#\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u043a\u0438 def create_square(space, pos):     square_mass, square_size = 1, (60, 60)     square_moment = pymunk.moment_for_box(square_mass, square_size)     square_body = pymunk.Body(square_mass, square_moment)<\/code><\/pre>\n<blockquote>\n<p><strong>square_mass<\/strong><code> - \u043c\u0430\u0441\u0441\u0430 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0430 (\u0432 \u043d\u0430\u0448\u0435 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0432\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u043c\u0443)<\/code><\/p>\n<p><strong>square_size<\/strong> <code>- \u0440\u0430\u0437\u043c\u0435\u0440 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0430. \u041f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 (width, height)<\/code><\/p>\n<p><strong>square_moment = pymunk.moment_for_box<\/strong> &#8212; <code>\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043c\u043e\u043c\u0435\u043d\u0442 \u0438\u043d\u0435\u0440\u0446\u0438\u0438 \u0434\u043b\u044f box \u0437\u043d\u0430\u044f \u043c\u0430\u0441\u0441\u0443 \u0438 \u0440\u0430\u0437\u043c\u0435\u0440<\/code><\/p>\n<p><strong>quare_body = pymunk.Body<\/strong> &#8212; <code>\u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0442\u0435\u043b\u0430<\/code><\/p>\n<\/blockquote>\n<p>\u0412\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0439 \u0444\u0438\u0447\u0438: C\u0434\u0435\u043b\u0430\u0435\u043c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u044b \u043f\u043e\u044f\u0432\u043b\u044f\u043b\u0438\u0441\u044c \u043d\u0430 \u043c\u0435\u0441\u0442\u0435 \u0433\u0434\u0435 \u0441\u0442\u043e\u0438\u0442 \u043a\u0443\u0440\u0441\u043e\u0440<\/p>\n<pre><code class=\"python\">def create_square(space, pos):     square_mass, square_size = 1, (60, 60)     square_moment = pymunk.moment_for_box(square_mass, square_size)     square_body = pymunk.Body(square_mass, square_moment)     # \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u043a\u0443\u0440\u0441\u043e\u0440\u0430     square_body.position = pos<\/code><\/pre>\n<blockquote>\n<p><strong>square_body.position<\/strong><code> - \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0442\u0435\u043b\u0430<\/code><\/p>\n<\/blockquote>\n<pre><code class=\"python\">def create_square(space, pos):     square_mass, square_size = 1, (60, 60)     square_moment = pymunk.moment_for_box(square_mass, square_size)     square_body = pymunk.Body(square_mass, square_moment)     square_body.position = pos     square_shape = pymunk.Poly.create_box(square_body, square_size)     square_shape.elasticity = 0.8     square_shape.friction = 1.0<\/code><\/pre>\n<p>\u0424\u0438\u0447\u0430 \u043f\u043e\u0434 \u043d\u043e\u043c\u0435\u0440\u043e\u043c \u0434\u0432\u0430: \u0446\u0432\u0435\u0442 \u043a\u0443\u0431\u0438\u043a\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u043d\u0434\u043e\u043c\u0435\u043d. <br \/>\u0421\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"python\">square_shape.color = [randrange(256) for i in range(4)]<\/code><\/pre>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446 \u0434\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0432 \u0438\u0442\u043e\u0433\u0435 \u043e\u043d\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"python\">def create_square(space, pos):     square_mass, square_size = 1, (60, 60)     square_moment = pymunk.moment_for_box(square_mass, square_size)     square_body = pymunk.Body(square_mass, square_moment)     square_body.position = pos     square_shape = pymunk.Poly.create_box(square_body, square_size)     square_shape.elasticity = 0.8     square_shape.friction = 1.0     square_shape.color = [randrange(256) for i in range(4)]     space.add(square_body, square_shape)<\/code><\/pre>\n<blockquote>\n<p>\u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e \u0447\u0442\u043e <strong>space.add <\/strong>\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u0435\u043b\u043e \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432<\/p>\n<\/blockquote>\n<p><strong>\u041c\u044b \u043d\u0430 \u0444\u0438\u043d\u0438\u0448\u043d\u043e\u0439 \u043f\u0440\u044f\u043c\u043e\u0439! \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0443.<\/strong><\/p>\n<pre><code class=\"python\"># \u0441\u043f\u0430\u0432\u043d \u043a\u0443\u0431\u0438\u043a\u043e\u0432         if i.type == pg.MOUSEBUTTONDOWN:             if i.button == 1:                 create_square(space, i.pos)                 print(i.pos)<\/code><\/pre>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"python\">#\u041e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 while True:     surface.fill(pg.Color('black'))      for i in pg.event.get():         if i.type == pg.QUIT:             exit()         # \u0441\u043f\u0430\u0432\u043d \u043c\u044f\u0447\u0438\u043a\u043e\u0432         if i.type == pg.MOUSEBUTTONDOWN:             if i.button == 1:                 create_square(space, i.pos)                 print(i.pos)      space.step(1 \/ FPS)     space.debug_draw(draw_options)      pg.display.flip()     clock.tick(FPS)  print('end')<\/code><\/pre>\n<h2>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c<\/h2>\n<p>\u0421\u0447\u0438\u0442\u0430\u044e \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043e\u0442\u043b\u0438\u0447\u043d\u043e \ud83d\ude42<\/p>\n<figure class=\"full-width\"><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/figcaption><\/figure>\n<p><strong>\u0412\u0435\u0441\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434:<\/strong><\/p>\n<pre><code class=\"python\">#\u0438\u043c\u043f\u043e\u0440\u0442 \u043c\u043e\u0434\u0443\u043b\u0435\u0439: import pygame as pg from random import randrange import pymunk.pygame_util pymunk.pygame_util.positive_y_is_up = False  #\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b PyGame RES = WIDTH, HEIGHT = 900, 720 FPS = 60  pg.init() surface = pg.display.set_mode(RES) clock = pg.time.Clock() draw_options = pymunk.pygame_util.DrawOptions(surface)  #\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 Pymunk space = pymunk.Space() space.gravity = 0, 8000  #\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 segment_shape = pymunk.Segment(space.static_body, (2, HEIGHT), (WIDTH, HEIGHT), 26) space.add(segment_shape) segment_shape.elasticity = 0.8 segment_shape.friction = 1.0    #\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u043a\u0438 body = pymunk.Body() def create_square(space, pos):     square_mass, square_size = 1, (60, 60)     square_moment = pymunk.moment_for_box(square_mass, square_size)     square_body = pymunk.Body(square_mass, square_moment)     square_body.position = pos     square_shape = pymunk.Poly.create_box(square_body, square_size)     square_shape.elasticity = 0.4     square_shape.friction = 1.0     square_shape.color = [randrange(256) for i in range(4)]     space.add(square_body, square_shape)   #\u041e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 while True:     surface.fill(pg.Color('black'))      for i in pg.event.get():         if i.type == pg.QUIT:             exit()         # \u0441\u043f\u0430\u0432\u043d \u043a\u0443\u0431\u0438\u043a\u043e\u0432         if i.type == pg.MOUSEBUTTONDOWN:             if i.button == 1:                 create_square(space, i.pos)                 print(i.pos)      space.step(1 \/ FPS)     space.debug_draw(draw_options)      pg.display.flip()     clock.tick(FPS)  print('end') <\/code><\/pre>\n<h2>\u0418\u0442\u043e\u0433<\/h2>\n<p>\u041c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043d\u0430 PyGame \u0438 PyMunk \u0441 \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u0435\u0439 \u0444\u0438\u0437\u0438\u043a\u0438.<\/p>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0430\u043c\u0438 \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e, \u0441\u0442\u0430\u0442\u044c\u0438 \u0438 \u0432\u0438\u0434\u0435\u043e \u0441 \u044e\u0442\u044e\u0431\u0430. <br \/>\u041d\u043e \u044f \u0442\u043e\u0436\u0435 \u043d\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0441\u044c \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0442\u044c \u043d\u0430 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e \u044d\u0442\u043e\u0439 \u0442\u0435\u043c\u0435.<\/p>\n<p>\u0414\u043e \u0441\u0432\u044f\u0437\u0438)<\/p>\n<p><code>\u041c\u0430<\/code><\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-388357","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/388357","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=388357"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/388357\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=388357"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=388357"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=388357"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}