2/26/2023 0 Comments Marky markxHi XeduR you for the response, I appreciate it. I also added a few extra steps to the bottom of the function since you need to release focus and set isFocus to false once you are done to prevent bugs. These would be easy to calculate manually too. Seems like xDelta and yDelta are undocumented atm. local function f\_planeTouchEvent( im\_event ) if ( im\_event.phase = "began" ) then -Lets the program focus on the touched object display.getCurrentStage():setFocus( im\_event.target, im\_event.id) im\_ = true -Store the original X and Y values of touched object im\_ = im\_ im\_ = im\_ elseif ( im\_event.phase = "moved" ) then -Object was moved/dragged if ( im\_ ) then im\_ = im\_ event.xDelta im\_ = im\_ event.yDelta end else display.getCurrentStage():setFocus( im\_event.target, nil ) im\_ = false end end the measure of how far the touch event has moved) and add those to the ship’s original coordinates, i.e. You’ll get the correct movement if you use delta x and y (i.e. This means that the ship will jump wherever you touch. Your issue seems to be that you are setting the coordinates for your ship based on the event.x and event.y. You should update to the latest daily build. If this is already solved from other post/sites. If there are things that I forgot to include, please let me know. Apologies as I am not a native English speaker. Let me know if there are statements that are confusing in my post. Simulation views encountered: All devices The plane should still be at the bottom part with movement imitating my swipe Start of simulation, image is at the bottom partĪs I swipe the upper part, the plane character teleported to where I swiped. Simulation (please see attached image for visualization ) Ĭurrent code chunk: local function f\_planeTouchEvent( im\_event ) if ( im\_event.phase = "began" ) then -Lets the program focus on the touched object display.getCurrentStage():setFocus( im\_event.target, im\_event.id) im\_ = true -Store the original X and Y values of touched object im\_ = im\_ im\_ = im\_ elseif ( im\_event.phase = "moved" ) then -Object was moved/dragged if ( im\_ ) then im\_ = im\_event.x im\_ = im\_event.y end end end -\ ld\_s\_plane:addEventListener( "touch", f\_planeTouchEvent) I came across to this topic and gave it a try. Most tutorials I’ve searched in Google is either Plane fighter with D-pad controller or the character should be dragged (event.target during run time) The design is to move the character by swiping anywhere on the screen. The Plane character “teleports to the swiping position” You believe firmly that your judgment is preeminent over all others.As most of the plane fighter / arcade shoot em up games nowadays, the basic control is to swipe anywhere in the screen to move the plane character. You have the courage and the confidence to lead others. Whether it is in business, community, or in your general area of expertise, you are driven to be the reigning figure. Your dream is to become the leader of whatever field you enter. “Your overpowering need is to be independent and to direct your own life according to what you believe. ” Inner analysis of Markx by heart number 1 Of all the numbers, yours possesses the greatest potential for accomplishment. There is no limit to what you are capable of, nor any on what you dream of doing. You want to make your mark on human civilization. You dream of creating something that will last centuries. Every goal you have is enormous in scope. You possess a unique gift for perceiving something in the archetypal world - infinite and divine - and making some semblance of it manifest on earth. Talent analysis of Markx by expression number 22 Markx name Numerology Numerology (Expression Number)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |