View Full Version : How do i make a side-scroller?
InfestedDemon
December 24th, 2005, 04:42 AM
I have an idea of a side-scroller (Halo peeps) but i need the actionscript for:
Moving,
Shooting,
Picking up weapons.
I have all the sprites and wonder, please, please can you make me by giving me actionscript/ tutroial! Many thanks! :kir:
Joppe
December 24th, 2005, 04:49 AM
There are 1 platform tutorial at kirupa.com
there are 2 pretty old platform tutorials here on the forum
there are 20+ scripts for platform games here on the forum.
I suggest you use the search function we have here on this forum.
InfestedDemon
December 24th, 2005, 05:00 AM
i am using flash mx, most of those tuts dont work :'( anyway, this is a SIDE-SCROLLER, not a PLATFORMER.
Joppe
December 24th, 2005, 05:07 AM
most of those tuts are written for mx.
whats the dif. between Sidescroller and platformer :S
nathan99
December 24th, 2005, 06:42 AM
just bout all of my codes should work in MX.
InfestedDemon
December 24th, 2005, 07:32 AM
kk. Well a side-scroller is like double-dragon (or mine and nathans pokemon poject which was scapped), a platform game is like jak 3 gold (newgrounds) .etc. But can anybody give me actioscript for running and jumping in side-scroller?!?!?!?:kommie:
Joppe
December 24th, 2005, 08:26 AM
wtf? Its basicly the same coding Ryan.. And if you cannot work something little out of the tutorials here im not so sure you really should do an "SIDE-SCROLLER"...
InfestedDemon
December 24th, 2005, 11:46 AM
lol, so what do i do to make the floor walkable?
Joppe
December 24th, 2005, 04:32 PM
well. Just make the char go up on up key. and have an collision check at the top. Simple?
Smily
December 25th, 2005, 06:09 PM
#make floor_movieclip walkable
char can "jump"
char can pickup "weapons"
char can "shoot"
there thats the actionscript
to put the joke aside, don't expect someone to just give you the actionscript. Flash isn't just a game making development, it's much more than that. You should understand the basics of programming in general and start thinking in math. You can't learn actionscript through the night so start with easier stuff.
For a side-scrolling example you should know the principles of making particles if you want bullets and some math to do the physics of collision detection & reaction with gravity on multiple platforms.
There, there's my 2-cents on "How do I make a <insert a game type>?" type of topics.
:devious:
karvee2005
December 26th, 2005, 01:21 AM
you people are truly amazing, where do you come from, mars ?
Pasquale
December 26th, 2005, 03:56 AM
nope just earth ;)
Lord Rahl
December 26th, 2005, 09:58 AM
K, well before you can do anything with collisions, weapon pickups, etc. You have to start with the basics to understand the rest. So first thing you want is normal key movement. So just think of the workspace as a grid, and depending on which key is down the movieclip of your main character will move in the given direction. So for the LEFT & RIGHT key you would do something like this.
//this goes in the main character movieclip
onClipEvent(enterFrame){
if(Key.isDown(Key.LEFT)){
this._x-=5;
}
if(Key.isDown(Key.RIGHT)){
this._x+=5;
}
}
Then if you want the character to be able to move up and down also, just add in the script for the up and down key with +/- y movement.
With movement down, you can try out wall collision. Most people would use a very simple opposition script. So something like this for a wall to the right of the character.
//this goes in the wall movieclip
onClipEvent(enterFrame){
if(_root.character.hitTest(this)){
_root.character._x-=5;
}
}
As for weapon pickup, I have attached a file that will show how this is done.
Now to explain this all.
1.) character is the Instance Name of the main character movieclip under its properties for those who don't know.
2.) the whole _x-=5 thing is the speed of the character and the oppostion must be => to the speed so that it has a push against the character when the touch it.
3.) As for weapon pickup, well its simple checking variables, and goto certain frames in a movieclip.
NOTE: The keys for the attached file are the following.
UP: Jump
LEFT/RIGHT: Movement
Key A: Unarmed
Key S: Handgun
Key D: Sniper Rifle
Joppe
December 26th, 2005, 11:22 AM
he wanted an side scroller not platformer..
Lord Rahl
December 26th, 2005, 08:50 PM
he wanted an side scroller not platformer..
...Its the exact same coding as I said. It can have +/- y position movement also. And the rest of the script is exactly like that which I have posted.
As I have said before, its all based off x/y positioning and would go good with depth perception aswell.
Check out pictures and descriptions of both game styles off of yahoo. I would suggest you all understand the game style layout you want before you try working on anything.
InfestedDemon
December 29th, 2005, 09:17 AM
K, well before you can do anything with collisions, weapon pickups, etc. You have to start with the basics to understand the rest. So first thing you want is normal key movement. So just think of the workspace as a grid, and depending on which key is down the movieclip of your main character will move in the given direction. So for the LEFT & RIGHT key you would do something like this.
//this goes in the main character movieclip
onClipEvent(enterFrame){
if(Key.isDown(Key.LEFT)){
this._x-=5;
}
if(Key.isDown(Key.RIGHT)){
this._x+=5;
}
}
Then if you want the character to be able to move up and down also, just add in the script for the up and down key with +/- y movement.
With movement down, you can try out wall collision. Most people would use a very simple opposition script. So something like this for a wall to the right of the character.
//this goes in the wall movieclip
onClipEvent(enterFrame){
if(_root.character.hitTest(this)){
_root.character._x-=5;
}
}
As for weapon pickup, I have attached a file that will show how this is done.
Now to explain this all.
1.) character is the Instance Name of the main character movieclip under its properties for those who don't know.
2.) the whole _x-=5 thing is the speed of the character and the oppostion must be => to the speed so that it has a push against the character when the touch it.
3.) As for weapon pickup, well its simple checking variables, and goto certain frames in a movieclip.
NOTE: The keys for the attached file are the following.
UP: Jump
LEFT/RIGHT: Movement
Key A: Unarmed
Key S: Handgun
Key D: Sniper Rifle
T.Y
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.