Join for FREE | Take the Tour Lost Password?
[x]

deviantART

 
About Me Member Flash Animator ArowanaW15/Male/Netherlands Recent Activity Deviant for 2 Years
Needs Premium Membership
Statistics 36 Deviations
433 Comments
1,765 Pageviews

YUSS Breakthrough!

Wed Jul 15, 2009, 11:26 AM
YUSSSSS.
I just had a breakthrough.
It isn't much, but I've been wondering about this for the past, what, 5 months?
So I'm really happy I finally figured it out.

I guess I'll explain what I found out :3
When making a flash game, you can move a movieclip with the < and > buttons.
Now with a circle as your main character that wouldn't be a problem, but once you use an actual character with a walking animation, you'll notice that the movieclip won't change directions if you walk left or right. So your main character would use the same animation for walking left and right.

The normal code for moving a character would be:

if(Key.isDown(Key.RIGHT)){
this._x += speed;
}
if(Key.isDown(Key.LEFT)){
this._x -= speed;
}

Now finally!
After a lot of stupid research and mistakes, I found out!

Next to the functions of x and y, you also have xscale and yscale.
I never knew D:

So yah, if you put

if(Key.isDown(Key.RIGHT)){
this._x += speed;
this._xscale = -100;
}
if(Key.isDown(Key.LEFT)){
this._x -= speed;
this._xscale = 100;
}

The character suddenly turns around when you press the other button. :)


Tiny discovery, but I am really happy.
And I also have a journal now that isn't completely random.

  • Playing: My own game bitches
  • Eating: Starving

deviantID

Thanks for viewing my page :)

Devious Info

  • Current Residence: Netherlands
  • Interests: Animating, photoshop.
  • Favourite genre of music: Pretty much anything. Reggae, rock, punk, hiphop, anything.
  • Operating System: PC
  • MP3 player of choice: iPod Nano

deviantART Community Board

[x]

Comments


:iconmarchuks:
thanks for the fav!! =)
:iconanabase:
Thanks a lot for the watch! :)
:iconbridget-harrison:
I like your icon :D

--
I'm a lover
Not a fighter
But I'll fight
For what I love :heart:

[link]

The Skunk fu message board! Come join us!
[link]
:iconarowanaw:
Haha, thank you :]
:iconbridget-harrison:
Your welcome :D

I just saw it and I couldn't say nothing! Its just too awesome!!!

--
I'm a lover
Not a fighter
But I'll fight
For what I love :heart:

[link]

The Skunk fu message board! Come join us!
[link]
:iconkiliwatch:
Nog in de lach gevlogen laatste tijd? :XD:

--
It's nothing really.
:iconlord-zasz:
Thanks for faving my Wall-E sculpture, truly appreciated! :)

--
:bulletblue: Check out my new Birthday Contest and win BIG prizes! [link]
:iconarowanaw:
Haha, that's some time ago =P
Anyways, no problem.
Huge fan of the movie, and I loved your sculpture :D
:iconlord-zasz:
Yeah, i got a DD, so I'm STILL going through all my messages. ^^;

--
:bulletblue: Check out my new Birthday Contest and win BIG prizes! [link]
:iconarowanaw:
Haha =P
Don't act like you dont want it! :)
:iconlord-zasz:
I do, I do... it just takes forever! I'm waiting to upload any new art till I get everything cleared out.

--
:bulletblue: Check out my new Birthday Contest and win BIG prizes! [link]
:iconoctobig:
Look what I got for you! =D

[link]

--
Every artist dips his brush in his own soul, and paints his own nature into his pictures.
~ Henry Ward Beecher
:iconarowanaw:
Wooo thanks :O
999 wouldve been cooler tho xD
Or 1337!
But thanks alot anyways!
Yay, 1000.
:iconoctobig:
Sorry, missed the 999. :XD:

But I'll definitely be on the lookout for 1337. And your game of ballz is very, very addictive.

--
Every artist dips his brush in his own soul, and paints his own nature into his pictures.
~ Henry Ward Beecher
:iconarowanaw:
Thanks :P
Atm im trying to fix some majorrrr glitches. (apparantly white blocks only keep you back if you come from up or down, not from the left or right >< ..)

Site Map