Is there a possible way to make the same sprite change direction... like say this is your sprite: and you wanted him to turn around without having a seperate sprite made is that possible... ---------------------------------- I saw it on a game I played before but I don't know how...
Umm... I don't know how to apply the code and where to apply the codes...
_________________ Pure Awesomeness
Tue May 26, 2009 7:36 pm
Sora12
Joined: Fri Mar 27, 2009 8:55 pm Posts: 282 Location: Why do you want to know you perv!
Gender: Male
Skype: lomeli1241
Currently Playing: Kingdom Hearts Re:Coded (JP)
1. Click on the movie clip the character's in 2. Click on actions at the bottom of the screen(assuming you have Flash 8) 3. Type X2i's code
Code:
onClipEvent (load) { //Sets the initial speed speed = 5; } onClipEvent (enterFrame) { //Keys to move left and right if (Key.isDown(Key.LEFT)) { _x -= speed; } if (Key.isDown(Key.RIGHT)) { _x += speed; } }
4. Then edit the code like this
Code:
onClipEvent (load) { //Sets the initial speed speed = 5; } onClipEvent (enterFrame) { //Keys to move left and right if (Key.isDown(Key.LEFT)) { _x -= speed; _xscale = -100; //makes character turn left } if (Key.isDown(Key.RIGHT)) { _x += speed; _xscale = 100; //makes character turn right } }
The best part about the changes is that it doesn't have any side effect(well, for me there was no problem)
BICURIOUS GEORGE daniel King Master X12 Neo_Fire_Sonic Racerx52 Sora Tycron Tyli User Avatar yoh Envoyez-moi un message pour ĂȘtre mon ami! Ha! That's French 4 Pm to be Friends
Tue Sep 08, 2009 6:30 pm
JeniferThomsan
Joined: Sat Jul 30, 2011 5:40 am Posts: 2
Gender: Anime Girl
Users browsing this forum: No registered users and 1 guest
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum