|
var myform:TclForm; timer1:TCLTimer; img1:TCLImage; DeviceMotionSensor:TclMotionSensor; void GameLoop; const BallSpeed=5;{ if(Clomosy.PlatformIsMobile){ case DeviceMotionSensor.GetDirectionX of { 1:img1.Position.X=img1.Position.X - Ballspeed; 2:img1.Position.X=img1.Position.X + Ballspeed;} case DeviceMotionSensor.GetDirectionY of { 1:img1.Position.Y=img1.Position.Y-Ballspeed; 2:img1.Position.Y=img1.Position.Y+Ballspeed; }}} { myform=TclForm.Create(Self); myform.SetFormBGImage(' https://e7.pngegg.com/pngimages/428/453/png-clipart-blue-triangular-border-blue-wave-border-texture.png" rel="nofollow - https://e7.pngegg.com/pngimages/428/453/png-clipart-blue-triangular-border-blue-wave-border-texture.png '); img1=myform.AddNewImage(myform, 'img1'); img1.ALign=alCenter; img1.Align=alNone; img1.width=200; img1.height=200; myform.SetImage(img1,' https://img.freepik.com/premium-psd/balloon-isolated-transparent-background-png_699917-812.jpg?semt=ais_hybrid" rel="nofollow - https://img.freepik.com/premium-psd/balloon-isolated-transparent-background-png_699917-812.jpg?semt=ais_hybrid '); timer1=myform.AddNewTimer(MyForm,'timer1', 1000); timer1.Interval=30; timer1.Enabled=True; myform.AddNewEvent(timer1,tbeOnClick,'GameLoop'); DeviceMotionSensor=myform.AddnewSensorsMotion(myform,'DeviceMotionSensor'); DeviceMotionSensor.Active=True; myform.Run; } sensor ile yaptığım uygulamada (Telefon hareketlerine göre hareket eden balonlar) mobilden girdiğimde hata almıyorum fakat çalışmıyor da. Şimdiden teşekkür ederim. https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015" rel="nofollow - https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015" integrity="sha512-ZpsOmlRQV6y907TI0dKBHq9Md29nnaEIPlkf84rnaERnq6zvWvPUqr2ft8M1aS28oN72PdrCzSjY4U6VaAw1EQ==" data-cf-beacon="{"version":"2024.11.0","token":"439455f3e46c40b98dbd42a2f1a954d8","r":1,"server_timing":{"name":{"cfCacheStatus":true,"cfEdge":true,"cfExtPri":true,"cfL4":true,"cfOrigin":true,"cfSpeedBrain":true},"location_startswith":null}}" crossorigin="anonymous">
|