i have a question though, how can you change the script so instead of using arrow keys you could use the mouse to contol the player, with scripted cam? Im bad with mouse scripts
i have a question though, how can you change the script so instead of using arrow keys you could use the mouse to contol the player, with scripted cam? Im bad with mouse scripts
Ok wow, I have a solution everyone (except for alot) will find satisfactory, make a tutorial to teach newbs like myself such fun stuff, or better yet will someone add me to thier messanger, and help me (n00b) make a sidescrolling shooter? I can be of some help, and it would be great help even though being a noob can give you cancer I know, however it probally wouldnt be that bad, I can make backgrounds pretty decently, character ok, and environs pretty good as well, just need to get someone who know action script or can teach me step by step. If you have an answer add vgguy99
@hotmail.com or go to my site and start my flash section : www.rolleth.proboards57.com Thanks all GB - Rolleth
How do you make the backround scroll at a slower pace? What variable do you change?
At 2/25/06 12:09 PM, meandthemoon9 wrote: How do you make the backround scroll at a slower pace? What variable do you change?
If you look at the first post:
onClipEvent (enterFrame) {
// When the right key is down, it starts scrolling left.
if(Key.isDown(Key.RIGHT)) {
this._x=_x-10;
}
}
onClipEvent (enterFrame) {
// When the left key is down, it starts scrolling right.
if(Key.isDown(Key.LEFT)) {
this._x=_x+10;
}
}
//You can change the speed (the 10) to whatever you want.
how bout you move the character with the arrow keys, and you move the back round with wasd, so then you can change it at will...
Hey DrDeath, you're kinda dumb.... you don't have to say this._x = _x-whatever. Just put this._x -= whatever number. I'm tired of seeing people do dumb things like that. I also can't stand it when people screw up on the simplest code in the world. Sure, everyone does it sometime, me too, but now I'm pretty good at script and am tired of noobs. DON'T SAY I SUCK BECAUSE ALL MY SUBMISSIONS HAVE LOW SCORES. I HAVEN'T SUBMITTED IN A WHILE. THOSE ARE OLD.
~boney_man
At 4/22/06 03:49 PM, boney_man wrote: Hey DrDeath, you're kinda dumb.... you don't have to say this._x = _x-whatever. Just put this._x -= whatever number.
It's just two different ways of doing the same thing, one slightly shorter. It doesn't make him dumb, just makes you look like an idiot. Some people may prefer doing it the other way, it's a bit like using ?.
aww....in my case the MC rotates and then moves the way the MC is facing. I want the backgroung to follow it though. what would be the code?
At 12/29/05 11:04 AM, True_Darkness wrote: I think it would be easiest if you were to make the background follow the player and scroll as it does. It's simple.
I did just that. And it already works.
But how do i stop the background from moving once my character moves to the farthest left and farthest right? Just like the one made by Spawn. The Naruto example just a few post above me. ^^
Thanks
how do you make it stop scrolling when you are at the end of the level?
How do you make it so when you hittest something, you stop moving altogether, instead of going through it???
At 12/29/05 11:04 AM, TrueDarkness wrote:
Then on the background just add a script like...
onClipevent(enterFrame){
this._x=_root.player._x/5
}
or you could do the same thing with a scripted camera.
onClipEvent(enterFrame){
this._x=_root.player._x
}
placed on the camera
At 10/29/06 01:27 AM, Glutton wrote: How do you make it so when you hittest something, you stop moving altogether, instead of going through it???
I have absolutly no idea how old this post was, but i was reading threw it trying to teach myself a thing or two cause im still learning. anyway..
to make your character not go through the object you have to just cancel out the movement of the background. if the background is moving at _x +=10 then you want to make flash no that when your touching the wall, _x -=10, that way, your not moving at all, when you touch the wall, your movement is canceled out so your merely stuck in place. sometimes it helps to do 10.1 or something so your character doesnt glitch through the walls, i have had this happen before.
heres the script if you didnt understand my explanation.
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
this._x = _x-8;
}
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
this._x = _x+8;
}
}
// you want to put that on the background movieclip itself
onClipEvent (enterFrame) {
if (this.hitTest (_root.player)) {
_root.bg._x -= _root.moveSpeed+.1;
}}
"movespeed" is a variable that equals the speed of the background, so if your background moves at 8, you make the "movespeed variable 8. so all its saying is to cancel out the movement of, well your movement in the first place.
the +1 there is something i added because i was glitching through my walls a little bit, this resolved it for me. you however may not want it at first if your doing ok.
hope i helped, or just completely braught back a dead thread... either way o well, i refreshed my own memory on the matter lol.
-Porter
Hey how do you stop create boundaries for the scrolling. I don't make someone to be able to scroll into infinity.
At 11/26/05 07:27 AM, DemitriW wrote: this is good but i want scrolling background for a movie not a game
then why are you posting in a specific game thread?
if you want a scrolling background for a movie just motiontween it, no code required
so wat happens when my character hits a boundary and the background keeps goin??
Speaking of scrolling backgrounds and characters moving in place in the middle, I have a small problem : I am making an RPG (bird's-eye-view stuff). I have this code on the background :
onClipEvent (load) {
movespeed = 5;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
_x -= movespeed;
}
if (Key.isDown(Key.LEFT)) {
_x += movespeed;
}
if (Key.isDown(Key.UP)) {
_y += movespeed;
}
if (Key.isDown(Key.DOWN)) {
_y -= movespeed;
} else {
_root.man.gotoAndStop(1);
}
}
And this code on the character :
onClipEvent (load) {
movespeed = 0;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
this.gotoAndStop(2);
_rotation = 90;
_x += movespeed;
}
if (Key.isDown(Key.LEFT)) {
this.gotoAndStop(2);
_rotation = 270;
_x -= movespeed;
}
if (Key.isDown(Key.UP)) {
this.gotoAndStop(2);
_rotation = 0;
_y -= movespeed;
}
if (Key.isDown(Key.DOWN)) {
this.gotoAndStop(2);
_rotation = 180;
_y += movespeed;
}
if (Key.isDown(Key.RIGHT) && Key.isDown(Key.UP)) {
_rotation = 45;
}
if (Key.isDown(Key.LEFT) && Key.isDown(Key.UP)) {
_rotation = 315;
}
if (Key.isDown(Key.RIGHT) && Key.isDown(Key.DOWN)) {
_rotation = 135;
}
if (Key.isDown(Key.LEFT) && Key.isDown(Key.DOWN)) {
_rotation = 225;
}
}
My problem is that the character is only moving diagonally. Any way to fix this? Thanks and hope someone replies! :)
Even better
onClipEvent(enterFrame){
if(Key.isDown(Key.RIGHT)){
this._x+=5;
_parent._x-=5;
}
if(Key.isDown(Key.LEFT)){
this._x-=5;
_parent._x+=5;
}
if(Key.isDown(Key.UP)){
this._y-=5;
_parent._y+=5;
}
if(Key.isDown(Key.DOWN)){
this._y+=5;
_parent._y-=5;
}
}
:D