walking man

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

AstghikM
Posts: 45
Joined: Mon Sep 08, 2014 8:35 pm

Re: walking man

Post by AstghikM » Tue Sep 09, 2014 6:44 pm

Klaus wrote:OK, Madame with the unpronouncable name (AstghikM?), here my stack which does exactly what you want:
Click anywhere on the card and the man moves to that point and anminates in the meantime.

I deleted all previous scripts and started anew, all is in the CARD script with lots of comments!

THANK YOU FOR YOUR CODE :D TOOOOO MUCH :) :) :) wow very simple, yeah now i understand why you said my code is too much :D great job :) oops i guess i put again much smiles :D
p.s. my name is NOT unpronouncable, it is very nice name, in armenian it means "little star" ;)

AstghikM
Posts: 45
Joined: Mon Sep 08, 2014 8:35 pm

Re: walking man

Post by AstghikM » Tue Sep 09, 2014 6:47 pm

endernafi wrote:
AstghikM wrote: So the problem is that i can.t move my player to mouseloc() at the same time when it is changing skins.
Hi there AstghikM,

Try this one:
man_revamped.zip
It's the same structure as yours and Game Academy's.
Klaus's code works, too, if you think that Game Academy code is overkill for this job.
But if you want animate many other objects, more than one player, then you should proceed with Game Academy way.


Hope it helps...


~ Ender

Hello :) thank you for reply :) yeah i saw your code :) it is amazing it is moving fast and clear :) but can you explain please what means

put 1 + ((sFrame div sMovementFactor) mod sMovementFactor) into sPlayerAnimation


this sentence? :) thanks :)

endernafi
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 296
Joined: Wed May 02, 2012 12:23 pm
Location: New York
Contact:

Re: walking man

Post by endernafi » Tue Sep 09, 2014 6:50 pm

Klaus wrote:Ah, that bunch of code war from the game academy, that explains much!
:wink:
Klaus wrote:But the moving itself is still jerky, Ender, the button moves a bit, then stops and finally kind of jumps to where I clicked!?
I couldn't reproduce that behavior Klaus, maybe it's about the horse-power of underlying cpu...
The opposite is true for me, your stack behaves jerky; weird, huh?
Though, I admit that *updateScreen* routine and *move* command are interfering.
So, that definitely should be optimized.
But AstghikM is kinda beginner, let's leave her to improve herself dealing with it...


Best,

~ Ender
~... together, we're smarter ...~
__________________________________________

macOS Sierra • LiveCode 7 & xCode 8

AstghikM
Posts: 45
Joined: Mon Sep 08, 2014 8:35 pm

Re: walking man

Post by AstghikM » Tue Sep 09, 2014 6:54 pm

Klaus wrote:Ah, that bunch of code war from the game academy, that explains much!

But the moving itself is still jerky, Ender, the button moves a bit, then stops and finally kind of jumps to where I clicked!?

i didn't understand your question , you still about my code? :) i just changed in your code that 200 milliseconds and now that man alk fast and clear :)

endernafi
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 296
Joined: Wed May 02, 2012 12:23 pm
Location: New York
Contact:

Re: walking man

Post by endernafi » Tue Sep 09, 2014 6:55 pm

AstghikM wrote:but can you explain please what means
put 1 + ((sFrame div sMovementFactor) mod sMovementFactor) into sPlayerAnimation
this sentence?
Sure.
Look at the topRight field, you see that Frame: numbers are incrementing too fast, right?
But PlayerAnimation: numbers are changing slower.
That sentence does that :wink:

Reason?
Well, if you don't slow it, then the player animation would be unrealistic.
So, I slowed it down 5 times.

You can test it by setting the sMovementFactor to 1, 2, 3, 4, 10, etc.

You may ask, "what if we decrease the fps in updateScreen routine?".
It wouldn't be wise.
Probably, you'll need those high fps {frame per second} values later in your project.


Best,

~ Ender
~... together, we're smarter ...~
__________________________________________

macOS Sierra • LiveCode 7 & xCode 8

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

Re: walking man

Post by Klaus » Tue Sep 09, 2014 6:57 pm

AstghikM wrote:THANK YOU FOR YOUR CODE TOOOOO MUCH wow very simple, yeah now i understand why you said my code is too much
It is HIGHLY important that you understand every little bit in Livecode, before you start with something very complex like the game academy and all its complicated scripts.
That's why I created a fresh, simple and new approach with some details. Hope you understand everything I commented and scripted here!
AstghikM wrote:p.s. my name is NOT unpronouncable, it is very nice name, in armenian it means "little star" ;)
So "AstghikM" means "littel star" in armenian? With a capital M at the end? 8)

Here some hardly used smileys for later postings:
:D :) :) :) :D :) :D ;)

Muhnak parov, little star!


Best

Klaus

AstghikM
Posts: 45
Joined: Mon Sep 08, 2014 8:35 pm

Re: walking man

Post by AstghikM » Tue Sep 09, 2014 7:00 pm

endernafi wrote:
AstghikM wrote:but can you explain please what means
put 1 + ((sFrame div sMovementFactor) mod sMovementFactor) into sPlayerAnimation
this sentence?
Sure.
Look at the topRight field, you see that Frame: numbers are incrementing too fast, right?
But PlayerAnimation: numbers are changing slower.
That sentence does that :wink:

Reason?
Well, if you don't slow it, then the player animation would be unrealistic.
So, I slowed it down 5 times.

You can test it by setting the sMovementFactor to 1, 2, 3, 4, 10, etc.

You may ask, "what if we decrease the fps in updateScreen routine?".
It wouldn't be wise.
Probably, you'll need those high fps {frame per second} values later in your project.


Best,

~ Ender

One more question :) that frame numbers how far they goes??? what if i leave open the game in 3 or 4 hours? :)

AstghikM
Posts: 45
Joined: Mon Sep 08, 2014 8:35 pm

Re: walking man

Post by AstghikM » Tue Sep 09, 2014 7:06 pm

Klaus wrote:
AstghikM wrote:THANK YOU FOR YOUR CODE TOOOOO MUCH wow very simple, yeah now i understand why you said my code is too much
It is HIGHLY important that you understand every little bit in Livecode, before you start with something very complex like the game academy and all its complicated scripts.
That's why I created a fresh, simple and new approach with some details. Hope you understand everything I commented and scripted here!
AstghikM wrote:p.s. my name is NOT unpronouncable, it is very nice name, in armenian it means "little star" ;)
So "AstghikM" means "littel star" in armenian? With a capital M at the end? 8)

Here some hardly used smileys for later postings:
:D :) :) :) :D :) :D ;)

Muhnak parov, little star!


Best

Klaus
no no that capital M is first letter of my last name :D yeah you are right Game academy is hard for me for now :D i understand your code fully :)

endernafi
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 296
Joined: Wed May 02, 2012 12:23 pm
Location: New York
Contact:

Re: walking man

Post by endernafi » Tue Sep 09, 2014 7:09 pm

AstghikM wrote:One more question :) that frame numbers how far they goes??? what if i leave open the game in 3 or 4 hours? :)
Excellent question :)
Livecode engine is using *probably* float values for number-type variables, if not double.
And the ceiling value of float is 3.4e38.
Your game works at 50fps.
Let's divide them and we'll find that your game can run 6.8e36 seconds = 2e29 years {it's 29 zeros after 2}.
For a comparison, the universe's estimated age is 13e9 years.

So, we can assume that you're safe to keep open your game for several weeks :wink:


Best,

~ Ender
~... together, we're smarter ...~
__________________________________________

macOS Sierra • LiveCode 7 & xCode 8

AstghikM
Posts: 45
Joined: Mon Sep 08, 2014 8:35 pm

Re: walking man

Post by AstghikM » Tue Sep 09, 2014 7:14 pm

endernafi wrote:
AstghikM wrote:One more question :) that frame numbers how far they goes??? what if i leave open the game in 3 or 4 hours? :)
Excellent question :)
Livecode engine is using *probably* float values for number-type variables, if not double.
And the ceiling value of float is 3.4e38.
Your game works at 50fps.
Let's divide them and we'll find that your game can run 6.8e36 seconds = 2e29 years {it's 29 zeros after 2}.
For a comparison, the universe's estimated age is 13e9 years.

So, we can assume that you're safe to keep open your game for several weeks :wink:


Best,

~ Ender

wow :) you impressed me, i believe you :D wow , okay... no questions , thanks :)

endernafi
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 296
Joined: Wed May 02, 2012 12:23 pm
Location: New York
Contact:

Re: walking man

Post by endernafi » Tue Sep 09, 2014 7:20 pm

You're welcome Աստղիկ, keep coding...


Best,

~ Ender
~... together, we're smarter ...~
__________________________________________

macOS Sierra • LiveCode 7 & xCode 8

AstghikM
Posts: 45
Joined: Mon Sep 08, 2014 8:35 pm

Re: walking man

Post by AstghikM » Tue Sep 09, 2014 7:25 pm

endernafi wrote:You're welcome Աստղիկ, keep coding...


Best,

~ Ender

very surprised :o :o :o :D

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”