Падение с ускорением

Падение с ускорением

Программа демонстрирует процесс падения мячика с ускорением.

Расположите на форме два компонента Shape1 и Shape2: TShape с вкладки Additional и компонент Timer1: TTimer с вкладки System, а также Button1: TButton

В инспекторе объектов (Object Inspector) выставьте начальные значения для каждого компонента

Shape2
 Left: 88 (отступ слева)
 Top: 8  (отступ сверху)
 Width: 17  (ширина шарика)
 Height: 17  (высота шарика)
 Shape: stCircle;  (вид фигуры - круг)

Shape1
 Left: 65 (отступ слева)
 Top: 24  (отступ сверху)
 Width: 63  (ширина доски)
 Height: 9  (высота доски)
 Shape: stRectangle;  (вид фигуры - прямоугольник)

Timer1
 Enabled: False;
 Interval: 100 (скорость вызова процедуры движения 0.1 c)

Теперь в инспекторе объектов переключитесь на вкладку Events и для компонента Timer1 задайте название процедуры OnTimer (лучше это сделать автоматически кликнув два раза в пустом поле)

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  Shape2.Top := Shape2.Top + G; // приращение движения
  G := G + 1; // приращение ускорения
  // проверка на достижения нижней границы формы
  if Shape2.Top > Form1.ClientHeight - 2 * Shape2.Height then
      Timer1.Enabled := false;
end;

Аналогично выберите кнопку Button1 и создайте процедуру на событие OnClick

procedure TForm1.Button1Click(Sender: TObject);
begin
  Shape1.Visible := false;
  Timer1.Enabled := true;
  Button1.Enabled := false;
  Shape2.Top := 8;
  G := 1;
end;

В окне кода не забыть в разделе Var прописать

var
  Form1: TForm1;
  G : Integer;

Запустите программу. Run.

СКАЧАТЬ ПРОГРАММУРазмер
Демо-урок: Падение с ускорением (344)912 кб

Отправил Сб, 07/15/2017 - 16:54

We sell the sale of iPhones 7 directly from Apple warehouses unofficially for 30% of the market value. Always available and in large quantities:
1. New Apple iPhone 7 Plus 256 GB (Jet Black) (FACTORY UNLOCKED) International Version no warrants - $ 303
2. New Apple iPhone 7 Plus 256GB Factory Unlocked CDMA / GSM Smartphone - Black (Certified Refurbished) - $ 307
3. New Apple iPhone 7 PLUS (5.5-inch) A1661 128GB Unlocked Smartphone for GSM + CDMA Carriers - Rose Gold - $ 303
We work all over the world and only on an advance payment, we accept only bitcoin. Attention!!! We do not work with Russia and the CIS countries. When ordering from 10 pcs. The price is 20% of the market value. We have a priority in wholesale customers. If you do not trust us, or you do not like something, you pass by, we will not respond to stupid reports. To receive the details for payment, please write to the e-mail: apple@apple-cheap-iphone.xyz

Отправил Сб, 07/15/2017 - 11:16

google.com - #yyryrooooo666555

Отправил Ср, 02/15/2017 - 00:19

http://female-viagra.pw how does female viagra work female pink viagra

Отправил Втр, 02/14/2017 - 18:46

http://female-viagra.pw viagra dose riddim womens viagra for sale

Отправил Втр, 02/14/2017 - 18:04

http://generic-viagra.review Generic Viagra Prices generic sildenafil citrate

Отправил Втр, 02/14/2017 - 17:21

http://sildenafil-rx.accountant sildenafil 20 mg sildenafil dosage

Отправил Втр, 02/14/2017 - 16:40

http://buy-viagra-online.review viagra online canadian pharmacy cheap generic viagra

Отправил Втр, 02/14/2017 - 15:59

http://female-viagra.pw female viagra video natural female viagra

Отправил Втр, 02/14/2017 - 15:18

http://generic-viagra.review best place to buy generic viagra online Generic Viagra in the US

Отправил Втр, 02/14/2017 - 14:37

http://female-viagra.pw cheapest viagra price female viagra name

Отправил Втр, 02/14/2017 - 13:56

http://sildenafil-rx.accountant sildenafil 20 mg sildenafil generic

Отправил Втр, 02/14/2017 - 13:15

http://female-viagra.pw female pink viagra female pink viagra

Отправил Втр, 02/14/2017 - 12:34

http://generic-viagra.review best place to buy generic viagra online generic viagra

Отправил Втр, 02/14/2017 - 11:54

http://buy-viagra-online.review viagra online canadian pharmacy where to buy viagra over the counter

Отправил Втр, 02/14/2017 - 11:13

http://sildenafil-rx.accountant sildenafil dosage Sildenafil 100Mg Price

Отправил Втр, 02/14/2017 - 10:32

http://buy-viagra-online.review cheap viagra 100mg viagra

Отправил Втр, 02/14/2017 - 09:50

http://generic-viagra.review best place to buy generic viagra online viagra

Отправил Втр, 02/14/2017 - 09:07

http://viagra-100mg.men viagra 100mg price viagra 100mg

Отправил Втр, 02/14/2017 - 08:23

http://viagra-rx.accountant how to buy viagra online buy viagra

Отправил Втр, 02/14/2017 - 07:42

http://female-viagra.pw how does female viagra work womens viagra for sale

Отправил Втр, 02/14/2017 - 07:01

http://sildenafil-rx.accountant Sildenafil 20 Mg Tablet Generic sildenafil 20 mg

Отправил Втр, 02/14/2017 - 06:20

http://female-viagra.pw natural female viagra buy female viagra

Отправил Втр, 02/14/2017 - 05:38

http://sildenafil-rx.accountant sildenafil price sildenafil 100mg

Отправил Втр, 02/14/2017 - 04:51

http://female-viagra.pw female viagra natural female viagra

Отправил Втр, 02/14/2017 - 04:07

http://female-viagra.pw female viagra video female pink viagra

Отправил Втр, 02/14/2017 - 03:26

http://female-viagra.pw female viagra female viagra video

Отправил Втр, 02/14/2017 - 02:44

http://viagra-rx.accountant viagra online how to buy viagra online

Отправил Пнд, 02/13/2017 - 10:41

http://buy-viagra-online.review viagra viagra

Отправил Пнд, 02/13/2017 - 10:00

http://viagra-rx.accountant viagra rx Viagra 50 mg Price

Отправил Пнд, 02/13/2017 - 02:14

canadian pharmacy cialis cialis online no prescription

Отправил Пнд, 02/13/2017 - 01:27

online payday loans for bad credit review of payday loans

Отправил Пнд, 02/13/2017 - 00:49

canadian pharmacy viagra viagra effects women

Отправил Пнд, 02/13/2017 - 00:13

online payday loans no credit check help pay off payday loans

Отправил Вс, 02/12/2017 - 23:36

payday loans online same day payday loans hartford ct

Отправил Вс, 02/12/2017 - 23:00

levitra online overnight delivery how long effective generic levitra

Отправил Вс, 02/12/2017 - 22:23

online cash advance payday loans new jersey

Отправил Вс, 02/12/2017 - 21:47

buy cialis online overnight shipping buying cialis online without prescription

Отправил Вс, 02/12/2017 - 21:10

buy cialis online overnight shipping cialis cheap online

Отправил Вс, 02/12/2017 - 20:33

canadian drug stores cialis pills for men

Отправил Вс, 02/12/2017 - 19:55

best place to buy viagra online what does viagra do

Отправил Вс, 02/12/2017 - 19:19

my canadian pharmacy viagra picture

Отправил Вс, 02/12/2017 - 18:41

reputable canadian online pharmacies buy viagra internet

Отправил Вс, 02/12/2017 - 18:05

viagra online prescription free viagra sales in canada

Отправил Вс, 02/12/2017 - 17:27

cialis online canada ordering cialis online

Отправил Вс, 02/12/2017 - 16:51

best online payday loans payday loan marysville wa

Отправил Вс, 02/12/2017 - 16:14

buy levitra online cheap viagra pharmacies levitra online

Отправил Вс, 02/12/2017 - 15:37

payday loans online same day payday laws in texas

Отправил Сб, 02/11/2017 - 04:26

http://www.horvatia-nedvizhimost.ru/clanak/constant-investment-increase-gods-have-arrived-to-adriatica/ru-3-109-1.html generic cialis buy online http://pc-helpy.it/index.php/component/users/?option=com_k2&view=itemlist&task=user&id=2856 20mg professional cialis http://agroconsulting.mn/index.php/component/users/?option=com_k2&view=itemlist&task=user&id=67385 cialis tablets for sale http://vttr.com.tw/index.php?option=com_k2&view=itemlist&task=user&id=236082 generic levitra without prescription http://www.ideri.com/nc/downloadcenter/open-source-produkte/detail/filezilla/?amp%3BcHash=238cfa8d38c9ef63873d729af41da006&cHash=689effc4a48a9702c9f891cb82586888 soft cialis pharmacy http://profiles.menaluxury.com/index.php?option=com_k2&view=itemlist&task=user&id=45788 viagra buy online

Отправил Сб, 02/11/2017 - 03:53

http://acs-me.com/index.php?option=com_k2&view=itemlist&task=user&id=914 generic softtabs levitra online http://quimeta.com/index.php?option=com_k2&view=itemlist&task=user&id=443 viagra panama generic levitra http://151.236.20.35/es/textpattern/skins/advanced/base.php mail order levitra absolute http://www.alenya.fr/index.php?option=com_k2&view=itemlist&task=user&id=190670 buy levitra overnight http://abiib.com/index.php?option=com_k2&view=itemlist&task=user&id=2712 viagra online usa http://betterbaitsystems.com/index.php?option=com_k2&view=itemlist&task=user&id=14546 generic cialis at discount prices

Отправил Сб, 02/11/2017 - 03:20

http://smrorenburg.ru/index.php?option=com_k2&view=itemlist&task=user&id=5263 buy levitra ottawa http://213.183.56.15/forum/comments_form.asp/.r%7B%7D_vti_cnf/components/com_mtree/Savant2/ihm.php buy now viagra http://www.wagstermagic.com/index.php?option=com_k2&view=itemlist&task=user&id=127681 buy cialis generic drugs http://arcologic.com.au/index.php?option=com_k2&view=itemlist&task=user&id=1116 viagra images http://wppco.com/index.php/component/users/?option=com_k2&view=itemlist&task=user&id=623801 order cialis online canada http://acs-me.com/index.php?option=com_k2&view=itemlist&task=user&id=914 order cialis online without over the counter

Последние комментарии

  • Sorry, if not around the topic. I had a bit embarrassment. I randomly lost my essay and I urgently have to have to write a new one. I can not write with my own strength, so I wanted to apply for the essay writing service for revenuel. Located a few web content about this, but I don't know if you...
  • uknk chaturbate http://cumpee.win/post/lostinside-chaturbate-record Let's see what I can find in my nose. I put my pinkie in and I start digging as far as I can.Video is HD 1080pVideo contains: NOSE FETISH leraimholly webcam http://www.litecum.win/post/nikkicarr72-chaturbate-record-mp4 An...
  • pharmacy without dr prescriptions canadian pharmacy online pharmacy without a prescription generic viagra most reliable canadian pharmacies what is metoprolol used for

Счетчики