[as3]Custom vCam and Collision in SideScroller help

A place for tutorials on how to get the most out of Flash

[as3]Custom vCam and Collision in SideScroller help

Postby Terrantor!!! » Sun Feb 02, 2014 11:08 am

Log 2-10:

Sup, ppls. Made some major improvements to the vCam and now Just working on the platformer aspect. I decided to just do away with hitTests for sometime as my head is now aching and I need some rest. The method I have works fine and it's already ready to deploy. As I hope you will read, the engine was made for easy addition of content to the map maker. It's built to automatically cycle through worlds you can create, so just double click the peach symbol on frame one, and find the readme text in the timeline. This point, I might reopen LoK project if I can find some willing artists. ;)

SWF:
Spoiler (click to show/hide):

Click to Play
(Javascript Required)

As3 Platformer.swf [ 90.02 KiB | Viewed 1152 times ]


FLA:


old logs:
Spoiler (click to show/hide):

Log 2-7-14:
Hey guys, thanks for all your help. As promised, I'm posting the .fla, this time. Nothing too pretty, yet. But It's well on the way. Things I'm having trouble with are:

-Ground Collision: Supposed to hitTest with the grey transparent blob. It ignores height and width of the damn thing.
-Zoom Easing: Smooth is not the word I'd use for it.
-Actress Centering: at low scale, she is too far up and left, at high scales, too far down and right.

@gorePete: thanks for that tip, it's way easier than the way I'm doing it. I'll try it out, tonight.

Greetings, I come to you with a few questions. Leme get my story in real briefly. I'm trying to build something along the lines of Corta's Splatformer. I love the fluidity in animation and controls and am particularly fond of his use with the vCam. I intend to build my own vCam entirely for use in 2d platforming. My question being, what would be the best way to do this. Currently I have a movieclip with a map and character. The said movieclip's xcoordinates are tied to a point that is constantly tracking the character's coordinates, this seems to be working; but I'm looking for that smooth tracking system that sort of chases the focal point around a la splatformer.

Next up, I'm looking to finetune the collision a bit as you may notice it is complete shit, as of now. What are some cool tricks I can learn. Things I have trouble with are walking uphill, falling through platforms before the hittest can even run, and good gravitational constants and jump strengths. Any and all help is appreciated. If you like my art, I'll be willing to reward you with a request.
Last edited by Terrantor!!! on Mon Feb 10, 2014 11:04 am, edited 2 times in total.
User avatar
Terrantor!!!
 
Joined: Thu Aug 23, 2012 10:36 am

Re: [as3]Custom vCam and Collision in SideScroller help

Postby OwnerOfSuccuby » Sun Feb 02, 2014 12:22 pm

Can you post your fla file ? :mrgreen: :roll:

But let us be serious. A little do not understand what the question is ?

Why the platformers game named platformer - becouse they use platforms. If hit test do not work make platforms bigger.

If you make it with out platforms with bend lines or blocks like platform - you have to use points like hitTestPoint.

May be even 2 or motr points for that. Like for example 1 point ditect collision with ground And if gravity<=0 (falling down) it makes body go up for y=y-1;
The second point ditects if it hits ground then body do not fall down for example. And collision boxex are not just a lines but are like bended boxes.

If there are more then one boxes you can make system like in cartoons. Check for each box is collision or not - if it is make timer =2 for example.
But on main time line each time timer goes for timer - 1 - so if it will not hit any block it will start falling down.

There are a lot of difrent ideas how to make things. What system do you want to create ? Just try to tell about it - and i think that you will not have questions how to make it ;)

But if you do (technical part of it) - it will be simpler to discuss it. Becouse if we do not know how did you make your system - and how do you want to make it it is harder to advise something.
OwnerOfSuccuby
 
Joined: Fri Jun 11, 2010 9:33 pm

Re: [as3]Custom vCam and Collision in SideScroller help

Postby Terrantor!!! » Sun Feb 02, 2014 11:00 pm

Fla is going out, when I turn it into a class. Right now everything is running on a frame. I intend to allow for both frame scripts and classes for all my objects so both schools can build stuff with it. But here's a hypothetical: my character clip moves based on a yVelocity var. what if I calculated a hit on a point located yVelocity units below said character. Upon hit yVelocity diminished then use the character's actual y value to reverse yVelocity?
User avatar
Terrantor!!!
 
Joined: Thu Aug 23, 2012 10:36 am

Re: [as3]Custom vCam and Collision in SideScroller help

Postby GoRepeat » Mon Feb 03, 2014 5:52 am

For the chase-like focal point you would pretty much do the same thing, except instead of vCam.x = char.x, it would be more of an algorithm... something along the lines of:

Code: Select All Code
switch(true){
    case vCam.x < char.x: vCam.x += (vCam.x-char.x)/2; break;
    case vCam.x > char.x: vCam.x -= (vCam.x-char.x)/2; break;
    case vCam.x==char.x: vCam.x = char.x; break;
}


The idea is that the vCam will be checking to see how far it's x,y is from the characters x,y and speed up or slow down until it catches up.
Picarto LiveStream: https://picarto.tv/GoRepeat
Other Stuff: Click Here
User avatar
GoRepeat
Moderator
 
Joined: Wed Jul 21, 2010 2:26 am
Location: Behind the Looking Glass

Re: [as3]Custom vCam and Collision in SideScroller help

Postby Terrantor!!! » Fri Feb 07, 2014 11:39 pm

Bump
User avatar
Terrantor!!!
 
Joined: Thu Aug 23, 2012 10:36 am


Return to Tutorials



Who is online

Users browsing this forum: No registered users