Page 2 of 2
Re: walking man
Posted: Tue Sep 09, 2014 6:44 pm
by AstghikM
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

TOOOOO MUCH

wow very simple, yeah now i understand why you said my code is too much

great job

oops i guess i put again much smiles

p.s. my name is NOT unpronouncable, it is very nice name, in armenian it means "little star"

Re: walking man
Posted: Tue Sep 09, 2014 6:47 pm
by AstghikM
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

Re: walking man
Posted: Tue Sep 09, 2014 6:50 pm
by endernafi
Klaus wrote:Ah, that bunch of code war from the game academy, that explains much!
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
Re: walking man
Posted: Tue Sep 09, 2014 6:54 pm
by AstghikM
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

Re: walking man
Posted: Tue Sep 09, 2014 6:55 pm
by endernafi
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
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
Re: walking man
Posted: Tue Sep 09, 2014 6:57 pm
by Klaus
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?
Here some hardly used smileys for later postings:
Muhnak parov, little star!
Best
Klaus
Re: walking man
Posted: Tue Sep 09, 2014 7:00 pm
by AstghikM
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
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?

Re: walking man
Posted: Tue Sep 09, 2014 7:06 pm
by AstghikM
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?
Here some hardly used smileys for later postings:
Muhnak parov, little star!
Best
Klaus
no no that capital M is first letter of my last name

yeah you are right Game academy is hard for me for now

i understand your code fully

Re: walking man
Posted: Tue Sep 09, 2014 7:09 pm
by endernafi
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
Best,
~ Ender
Re: walking man
Posted: Tue Sep 09, 2014 7:14 pm
by AstghikM
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
Best,
~ Ender
wow

you impressed me, i believe you

wow , okay... no questions , thanks

Re: walking man
Posted: Tue Sep 09, 2014 7:20 pm
by endernafi
You're welcome Աստղիկ, keep coding...
Best,
~ Ender
Re: walking man
Posted: Tue Sep 09, 2014 7:25 pm
by AstghikM