move to the points of graphic

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Samuele
Posts: 282
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

Re: move to the points of graphic

Post by Samuele » Sun Jan 16, 2022 8:29 pm

Klaus wrote:
Sun Jan 16, 2022 7:45 pm
That way your movement will be much smoother, which is you current problem, right?
in a way, yes but that's not entirely the problem, the poblem is that the image actually start going the right way (the points of graphic) then then you can't see it anymore for half a second and then it starts again to go to the points of the graphic.
richmond62, did you have a chance to see it? maybe you can explain the problem better.
thanks
Samuele.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9359
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: move to the points of graphic

Post by richmond62 » Sun Jan 16, 2022 8:43 pm

No, I did not see the problem.

Samuele
Posts: 282
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

Re: move to the points of graphic

Post by Samuele » Sun Jan 16, 2022 9:24 pm

the right post:
Samuele wrote:
Mon Jan 17, 2022 12:48 pm
you're right didn't think of that options so that's the clip, the bug is in the end. https://www.dropbox.com/s/usfigf7kejrd1 ... 4.zip?dl=0
Last edited by Samuele on Mon Jan 17, 2022 12:51 pm, edited 2 times in total.
Samuele.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9359
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: move to the points of graphic

Post by richmond62 » Sun Jan 16, 2022 9:48 pm

I don't know who is going to watch that film on Instagram: I'm not: I have just spent 5 minutes trying to do that
and cannot. :?

Please just zip the film and upload it to DropBox or a GoogleDrive and post a link here.

Samuele
Posts: 282
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

Re: move to the points of graphic

Post by Samuele » Mon Jan 17, 2022 12:48 pm

you're right didn't think of that options so that's the clip, the bug is in the end, https://www.dropbox.com/s/usfigf7kejrd1 ... 4.zip?dl=0
the problem is that the game over image repeats a movement and the graphic is not like that. Thanks
Samuele.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9359
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: move to the points of graphic

Post by richmond62 » Mon Jan 17, 2022 1:02 pm

I must be very stupid, but I could not understand anything from that film.

Samuele
Posts: 282
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

Re: move to the points of graphic

Post by Samuele » Mon Jan 17, 2022 1:12 pm

did you see that after the timer became 0 the game over image was shown?
Samuele.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9359
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: move to the points of graphic

Post by richmond62 » Mon Jan 17, 2022 1:22 pm

This reminds me of what a Senior Lecturer in Philosophy (called 'Barry the bastard') said to us
at the start of our second year:

"You arrogant sh*ts, you think you know everything in Philosophy: of course you don't: you
have to go back to first principles now."

-----------

He was, of course, right (it didn't stop us giving him a rude name), and I think that is what you may have to do.

You may have been attempting to run before you can walk.

You will also see that my examples are VERY BASIC indeed.

Set up a new stack and start with FUNCTIONALITY.

Perhaps, BEFORE you do that, go away from the computer and draw some pictures . . .

-----

That disgusting person, 'Uncle Richmond', will hold your hand. 8)

-----

BUT, not now, as I have 3 sets of 6-9 year olds between 2.30 and 7.00 who are here to learn English
and I have to work very hard to traumatise them. :lol:

Samuele
Posts: 282
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

Re: move to the points of graphic

Post by Samuele » Mon Jan 17, 2022 1:41 pm

hahaha, allright I'm gonna do that (BTW, my math teacher sais the same thing about math problems, if you can't solve one for a long time, just stay away from it for a bit and then retry) :D
Samuele.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7228
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: move to the points of graphic

Post by jacque » Mon Jan 17, 2022 6:34 pm

You said it used to work until you changed something. What did you change?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Klaus
Posts: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: move to the points of graphic

Post by Klaus » Mon Jan 17, 2022 6:52 pm

richmond62 wrote:
Sun Jan 16, 2022 7:48 pm
coublettes
Um; 'doublets' ?
Yes, Sir, what else? 8)

Samuele
Posts: 282
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

Re: move to the points of graphic

Post by Samuele » Mon Jan 17, 2022 7:16 pm

jacque wrote:
Mon Jan 17, 2022 6:34 pm
You said it used to work until you changed something. What did you change?
I still have a version where it works.
the old version that works:

Code: Select all

 on ActivateTimer
   HideStart
   if field "timer"  > 0
   then
      subtract 1 from field "timer"
      send ActivateTimer to me in 1 sec
      put the result into _pendingMessage
   else
      StopMoveMe
     #hide button "Stop" with visual effect zoom out very fast  
     show button "Restart" with visual effect dissolve very fast
     show button "Info" 
     show button "Home" 
     show button "Settings" 
    GameOver
    DisableObjects
    HighScore
 end if
end ActivateTimer


on HideStart
   if field "timer" = 1
   then
      hide button "Start" #with visual effect zoom out very fast
      hide button "Stop" with visual effect zoom in very fast
      end if
end HideStart


on StopMoveMe
   lock screen
   cancel _gmoveMePendingMethodID
      cancel _gmoveMePendingMethodID1
   cancel _gmoveMePendingMethodID2
   cancel _gmoveMePendingMethodID3
end StopMoveMe


on GameOver
   show image "GameOverSign" with visual effect dissolve slow
   move image "GameOverSign" to the points of graphic "Curve" in 3 seconds without waiting
   show graphic "GrayThing"
   show field "RestartInfo"
end GameOver


on DisableObjects
   disable button "minus100"
   disable button "doublePoints"
   disable button "clickMe"
   disable button "bonus1000"
end DisableObjects
the new version with a bug in the move...

Code: Select all

on ActivateTimer
   HideStart
   if field "timer" > 0 then
      subtract 1 from field "timer"
      send "ActivateTimer" to me in 1 sec
      put the result into _pendingMessage
   end if
   
   if field "timer" = 50 then show btn "Bomb"
   else if field "timer" = 30 then show btn "doublePoints"
   else if field "timer" = 20 then show btn "bonus1000"
   
   else if field "timer" = 0 
      then
      GameOver
      aeStopMoving "all"
      DisableObjects
      show button "Restart" #with visual effect dissolve very fast
      show widget "Info" 
      show widget "Home" 
      show widget "Settings" 
      HighScore
      HideBonuses
   end if
end ActivateTimer

on HideStart
   if field "timer" = 1
   then
      hide button "Start"
      hide button "Stop" with visual effect zoom in very fast
      end if
end HideStart


on GameOver
   show image "GameOverSign"
   move image "GameOverSign" to the points of graphic "Curve" in 3 seconds without waiting
   show graphic "GrayThing"
   show field "RestartInfo"
end GameOver


--this is from the animation stack--
on aeStopMoving tControl
   if tControl="all" then
      delete variable tAEEasing
   else
      delete variable tAEEasing[the long id of tControl]
   end if
end aeStopMoving


on DisableObjects
   disable button "minus100"
   disable button "doublePoints"
   disable button "clickMe"
   disable button "bonus1000"
end DisableObjects


on HighScore
   if field "userScore" > field "HighScore" of card "HomeCard"
   then
      put field "userScore" into _ghighScore
      put _ghighScore into field HighScore of card "HomeCard"
      answer "You've reached your high score!!:" & _ghighScore
      save this stack
   end if
end HighScore


on HideBonuses
   hide btn "doublePoints"
   hide btn "bonus1000"
   hide btn "Bomb"
end HideBonuses
I'm sharing all the script because the problem is almost 100% here and i can't find it...
BTW that's the animation stack https://github.com/derbrill/animationEngine
Thanks!
Samuele.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7228
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: move to the points of graphic

Post by jacque » Mon Jan 17, 2022 10:51 pm

It's hard to tell what's happening, but my guess is that the move commands are conflicting somehow. Try changing this:

Code: Select all

GameOver
aeStopMoving "all"
to this:

Code: Select all

aeStopMoving "all"
GameOver
That way you have stopped the current moves before starting the GameOver move.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Samuele
Posts: 282
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

Re: move to the points of graphic

Post by Samuele » Mon Jan 17, 2022 11:20 pm

jacque wrote:
Mon Jan 17, 2022 10:51 pm
It's hard to tell what's happening, but my guess is that the move commands are conflicting somehow. Try changing this:

Code: Select all

GameOver
aeStopMoving "all"
to this:

Code: Select all

aeStopMoving "all"
GameOver
That way you have stopped the current moves before starting the GameOver move.
nope, the same problem
Samuele.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7228
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: move to the points of graphic

Post by jacque » Mon Jan 17, 2022 11:42 pm

The only other thing I can think of is that you need to use acceleratedRendering and set the layermode of the moving objects to "dynamic".

When the stack opens, in a preOpenStack handler or wherever you set up the app when it launches, add this line:

Code: Select all

set the acceleratedRendering of this stack to true
In the moving object's property inspector, go to the Advanced pane and chose "dynamic" as the layermode.

This allows LC to cache the object in RAM so it doesn't stutter when it moves. Only the moving objects should be dynamic, things that don't move should remain static, which is the default.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”