USERNAME:
PASSWORD:
Save Info!
Logging in…
This topic is 1 page long.
[ Profile | Posts | Contact ]
Posted at: 12/7/05 06:22 PM
Sign-Up: 10/12/04
Posts: 22
I need some help with a code. im trying to make a sidescroller. I got this code online. whats wrong with it? says that the syntax error is on line 7, function moveMan() any help is appreciated.
stop(); function initGame() { attachMovie("man", "man", 999999); man._x = 275; man._y = 350; } funtion moveMan() { if (man._currentFrame>4) { dx = 0; } else if (Key.isDown(Key.RIGHT)) { dx = dgspeed; man.gotoAndStop("right"); } else if (Key.isDown(Key.LEFT)) { dx = -dgspeed; man.gotoAndStop("left"); } else { dx = 0; man.gotoAndStop("normal") } rect._x += dx; if (man._x<45) { man._x = 45; } if (man._x<650) { man._x = 650; } if (bgspeed<5) { bgspeed += .05; } }
Posted at: 12/7/05 06:26 PM
Sign-Up: 08/04/05
Posts: 6,957
it says funtion.
change it to function.
Posted at: 12/7/05 06:27 PM
omg...lol ok thanks
Posted at: 12/7/05 06:30 PM
At 12/7/05 06:27 PM, Wrongfire wrote: omg...lol ok thanks
Dont know how you didnt see that. XD but, its okay. We all make mistakes.
Good luck with your platformer, even though i'd rather make my own code.
.:Blaze:.
Posted at: 12/7/05 06:41 PM
thanks. but i have another problem, if anyone knows how to fix it. Ok i have my char made with all the codes to turn left right and to move there. and on this website it says to make a circle, and make its alpha=0. the code for this circle is:
onClipEvent(load) { _root.initGame(); } onClipEvent(enterFrame) { _root.moveMan(); }
problem is, it sends my character to the corner of the screen, anyone know why?
Posted at: 12/7/05 06:46 PM
Sign-Up: 10/16/05
Posts: 829
yes that's exactly what it does...
man._x = 275; man._y = 350;
i think you need to learn actionscript, or your game is going nowhere
Posted at: 12/7/05 06:49 PM
lol, yeah, it would be nice to know... cant find a place to learn it. those are coordinates right? if so then i can figure this out. thanks.
Posted at: 12/7/05 06:51 PM
At 12/7/05 06:49 PM, Wrongfire wrote: lol, yeah, it would be nice to know... cant find a place to learn it. those are coordinates right? if so then i can figure this out. thanks.
yes. _x is the X line. Which is from right to left 0 Being right. _y is top down. 0 being top.
You can always try AS: MAIN to learn AS.
Posted at: 12/7/05 06:58 PM
aww, i thought i figured it out. i put in
man._x = 18.0; man._y = 167.5;
as the new coordinates. but when i test movie, hes still in that corner. this website lies, says it should work perfectly... Thanks for that link, if i cant figure it out ill just delete it all and remake using AS: Basic
Posted at: 12/7/05 07:02 PM
At 12/7/05 06:58 PM, Wrongfire wrote: as the new coordinates. but when i test movie, hes still in that corner. this website lies, says it should work perfectly... Thanks for that link, if i cant figure it out ill just delete it all and remake using AS: Basic
no prob. If you ever have more problems, keep posting in the Flash Forum. I'll try to answer.
Posted at: 12/7/05 07:10 PM
Ok cool. I just started over. gonna try actually LEARNING actionscript before i start making game.
Posted at: 12/7/05 07:12 PM
At 12/7/05 07:10 PM, Wrongfire wrote: Ok cool. I just started over. gonna try actually LEARNING actionscript before i start making game.
Sweet, thats better. I learnt by some of the tuts on AS: Main, and now working on a game all by myself mastering my own techniques. Good luck!
All times are Eastern Standard Time (GMT -5) | Current Time: 12:14 PM
<< Back