Be a Supporter!

Sidescroller.

  • 273 Views
  • 3 Replies
New Topic Respond to this Topic
linc186
linc186
  • Member since: Jun. 17, 2009
  • Offline.
Forum Stats
Member
Level 06
Blank Slate
Sidescroller. 2010-04-07 03:26:50 Reply

I'm making a side scroller beat em' up game. I have a couple qu's. One, is on the vcam. Now, i noq how to use a vcam in animation, but i dont know how to implement it into a side scrolling game. From what i think, you have a statement declaring that if you hit the left key, it tweens to the left side of the screen and then you would have a statement saying if your not hitting left, it stops. Now, please show me how to do this, im new to vcams. Another question (not relevant to vcams) but, if i were to make a beat em' up game, how would i make a punch feature? like : if(Key.isDown(Key.punchkey)){
this.gotoAndStop(2); (the frame with a movieclip of him punching)
and then inside of that move clip, the arm would have its own movieclip saying: if(this.hitTest(_root.enemy)){
this.gotoAndStop(2);
}
so, like this?


BBS Signature
CompleteDouche
CompleteDouche
  • Member since: Dec. 1, 2008
  • Offline.
Forum Stats
Member
Level 09
Musician
Response to Sidescroller. 2010-04-07 07:24:02 Reply

One, V-cam isn't used for games. (At least in GOOD games)
A V-cam in AS2 is solely used for animation, but when used in games causes lag.
For a Sidescroller, you would have to set up a scrolling method.


No matter what your weaknesses are, make sure your own abilities supersede them.

Numer0us
Numer0us
  • Member since: Oct. 22, 2008
  • Offline.
Forum Stats
Member
Level 02
Blank Slate
Response to Sidescroller. 2010-04-07 07:50:18 Reply

So you recommend not using a V-cam, and recommend an unspecified other way? What's a "scrolling method"? If that means what it normally means,a V-cam would count as a method of scrolling.
You really should explain what you mean.

Innermike
Innermike
  • Member since: Sep. 11, 2009
  • Offline.
Forum Stats
Member
Level 14
Blank Slate
Response to Sidescroller. 2010-04-07 08:36:10 Reply

On the frame

function Cam()	
		{
			var NX:int =-(Char.x-400)
			var NY:int=-(Char.y-300)
			
			x+=(NX-x)/10
			y+=(NY-y)/10
		}

Add underscores to x and y (since you are using AS2) and changes Char to the instance name of your character then just call the function in your game loop


nobody