Motion Algoritms System

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

Motion Algoritms System

Postby OwnerOfSuccuby » Wed Sep 11, 2013 1:43 pm

There are different ways of how to make it. Find one more funny solution - not like in my earlier versions with massives. Now just a lot of variables and timers :lol: It is funny but it works.

Just test it on Ron Papers model. I like that model so i hope you will like it too.

Just showing the idea of how is possible to make motion work like.
Last edited by OwnerOfSuccuby on Mon Sep 23, 2013 4:12 pm, edited 3 times in total.
OwnerOfSuccuby
 
Joined: Fri Jun 11, 2010 9:33 pm

Re: Motion Algoritms System

Postby QuizmasterBos » Wed Sep 11, 2013 6:18 pm

OwnerOfSuccuby Wrote:There are different ways of how to make it. Find one more funny solution - not like in my earlier versions with massives. Now just a lot of variables and timers :lol: It is funny but it works.

Just test it on Ron Papers model. I like that model so i hope you will like it too.

Just showing the idea of how is possible to make motion work like.

Control is quite fluent, I like it. The hitboxes all work properly. You should introduce your code to Ivan, he can use a new physics engine with MiM PUT.
Only weird thing about the hitboxes I noticed is the fact that Krystal never really is located on the ground, she's always 'floating' above it.
If I jump on the wall just to the left of where she starts and jump off, she generally lands on the ground completely. But if I walk off that wall, or jump on top of the wall, she floats.

Other than that, this is great. I haven't seen something this well-coded in a long time.
User avatar
QuizmasterBos
 
Joined: Wed Aug 15, 2012 1:31 pm

Re: Motion Algoritms System

Postby OwnerOfSuccuby » Wed Sep 11, 2013 8:08 pm

Fixed some bugs and added new functions. No floating now - or may be just a 1 pixel +- from box.
Last edited by OwnerOfSuccuby on Tue Sep 17, 2013 11:48 am, edited 1 time in total.
OwnerOfSuccuby
 
Joined: Fri Jun 11, 2010 9:33 pm

Re: Motion Algoritms System

Postby QuizmasterBos » Wed Sep 11, 2013 9:24 pm

OwnerOfSuccuby Wrote:Fixed some bugs and added new functions. No floating now - or may be just a 1 pixel +- from box.

I noticed a few things more:
-Krystal's head and hands can appear inside the wall when you jump at it. Standing still next to the wall makes her head mostly appear inside. I think it would require a slight change with how Krystal's body interacts with walls to provide a more believable effect.
- Camera should move quite a bit earlier. She should move a number of pixels before the screen starts moving, but not as much as now.

I've got no idea what you have planned with this, so I'll stop it there.
User avatar
QuizmasterBos
 
Joined: Wed Aug 15, 2012 1:31 pm

Re: Motion Algoritms System

Postby BlueLight » Fri Sep 13, 2013 6:58 am

I as a java person demand to know what this code is for this!... I'm to damn tired to type, nite all.
User avatar
BlueLight
Gangs n' Whores Developer
 
Joined: Sat Jun 04, 2011 8:23 am

Re: Motion Algoritms System

Postby hat973 » Sat Sep 14, 2013 1:11 am

how do u do that the whole left makes them face Left and right makes them face right im having a bit of a problem with that
Red light panda

:ugeek: Tumbler: Tumbler
:geek: I have a Blog: Red Light Blog
;) I stream to Give me a Watch over at: Picarto
:mrgreen: Donate: Patreon
:roll: Discord:Discord
User avatar
hat973
 
Joined: Tue Apr 24, 2012 12:44 am

Re: Motion Algoritms System

Postby OwnerOfSuccuby » Sat Sep 14, 2013 12:58 pm

I check - if some variable - that have - "if press right" for example - is true - Krystal gotoAndStop(SomeRightPosition)
Then i check - if right and left is pressed - I have one more variable - what button right or left was pressed last - and if it is Right i go to right position another to the left.

I make string variable - that lets me to remember what position to play - lets name this KrystalWhatPositionToPlay.

Now i can check anything with it. If Left is pressed KrystalWhatPositionToPlay = GoLeft. If Down is pressed and KrystalWhatPositionToPlay==GoLeft - then KrystalWhatPositionToPlay = creepleft - and etc.

Then when i check what position is - i just make Krystal.gotoAndStop(KrystalWhatPositionToPlay);
OwnerOfSuccuby
 
Joined: Fri Jun 11, 2010 9:33 pm

Re: Motion Algoritms System

Postby hat973 » Sat Sep 14, 2013 5:25 pm

so for eximple Krystal.gotoAndStop(KrystalRight)
Red light panda

:ugeek: Tumbler: Tumbler
:geek: I have a Blog: Red Light Blog
;) I stream to Give me a Watch over at: Picarto
:mrgreen: Donate: Patreon
:roll: Discord:Discord
User avatar
hat973
 
Joined: Tue Apr 24, 2012 12:44 am

Re: Motion Algoritms System

Postby OwnerOfSuccuby » Sat Sep 14, 2013 7:15 pm

Yes if you have position "KrystalRight" - you just gotoAndStop("KrystalRight") - or the frame you need to stop. If it is 10 frame for example you can wright - gotoAndStop(10);
OwnerOfSuccuby
 
Joined: Fri Jun 11, 2010 9:33 pm

Re: Motion Algoritms System

Postby hat973 » Sat Sep 14, 2013 9:36 pm

im still having problems getting to work
Red light panda

:ugeek: Tumbler: Tumbler
:geek: I have a Blog: Red Light Blog
;) I stream to Give me a Watch over at: Picarto
:mrgreen: Donate: Patreon
:roll: Discord:Discord
User avatar
hat973
 
Joined: Tue Apr 24, 2012 12:44 am

Re: Motion Algoritms System

Postby OwnerOfSuccuby » Tue Sep 17, 2013 12:01 pm

It is much simple to see an example of what do not work - and then say what do not work like it have to ;)
OwnerOfSuccuby
 
Joined: Fri Jun 11, 2010 9:33 pm

Re: Motion Algoritms System

Postby KaTsuO_O » Wed Sep 18, 2013 2:35 pm

hat973 was having a problem where the first frame of the walking animation kept repeating, but I helped him with that.
Don't create a porn game if you're only interested in porn.
Wise words regarding criticism http://www.youtube.com/watch?v=-98ZFl1sKt4
User avatar
KaTsuO_O
 
Joined: Tue Nov 02, 2010 6:03 pm

Re: Motion Algoritms System

Postby OwnerOfSuccuby » Wed Sep 25, 2013 10:57 am

Sounf effects and Music added. May be make a little game with this algoritms ? :?: :mrgreen:
Last edited by OwnerOfSuccuby on Thu Sep 26, 2013 4:58 pm, edited 1 time in total.
OwnerOfSuccuby
 
Joined: Fri Jun 11, 2010 9:33 pm

Re: Motion Algoritms System

Postby AnotherArrow » Thu Sep 26, 2013 12:12 am

I think you need to set it so as Krystal is moving right, she is positioned further to the left of the screen so I can see whats coming up. Kind of hard to make a jump decision when I can't see what is ahead. Kind of like how I have it set in AT3 test files.

Other then that, cool stuff!
User avatar
AnotherArrow
 
Joined: Fri Oct 29, 2010 3:22 am

Re: Motion Algoritms System

Postby OwnerOfSuccuby » Thu Sep 26, 2013 5:04 pm

Thank you. A little fix it - if it will be too easy to jump it will be bad too ;) I will need to add more levels then :lol: becouse if it will be 4 unwinable levels i will not need to make 5 th and etc :lol:

Just a joke ;) Like that or even a little more to add ?
OwnerOfSuccuby
 
Joined: Fri Jun 11, 2010 9:33 pm

Re: Motion Algoritms System

Postby GoRepeat » Sat Sep 28, 2013 10:46 am

Another easier way to do it (which is what I do) is have a direction variable set to 0 for right and 1 for left (lets say krysDir). Then you have one variable that controls the current animation such as 1 for idle 3 for run 5 for attack etc etc (lets say krysAct). That way you only need to call one universal command:

krystal.gotoAndStop(krysDir + krysAct);

So a value of 1 would be idle right and a value of 4 would be run left etc etc. Just make the animation frames on your stage character match their respective values. This way your direction and animation calls are seperated from each other but still correct (you can call idle, walking or fighting without having to mess with flipping directions and you can call a direction swap without worrying about checking animations etc etc).
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: Motion Algoritms System

Postby IrrelevantComment » Sun Sep 29, 2013 1:37 am

Creating a variable to hold the direction the player is facing is superfluous when you already have one: scaleX. By setting scaleX to +-scaleY you can change the direction the player is facing without having to create double the frames in your character's timeline.
IrrelevantComment
 
Joined: Tue Mar 15, 2011 7:46 pm

Re: Motion Algoritms System

Postby AnotherArrow » Sun Sep 29, 2013 2:20 am

IrrelevantComment Wrote:Creating a variable to hold the direction the player is facing is superfluous when you already have one: scaleX. By setting scaleX to +-scaleY you can change the direction the player is facing without having to create double the frames in your character's timeline.

True. Unless you create a character that has unique left and right sides... like Samus in her power suit.
User avatar
AnotherArrow
 
Joined: Fri Oct 29, 2010 3:22 am

Re: Motion Algoritms System

Postby GoRepeat » Mon Sep 30, 2013 9:57 pm

IrrelevantComment Wrote:Creating a variable to hold the direction the player is facing is superfluous when you already have one: scaleX. By setting scaleX to +-scaleY you can change the direction the player is facing without having to create double the frames in your character's timeline.


Doesn't work when the Left and Right sides of the character aren't symmetrical. Also, you are using a variable (the xscale) to track it regardless - might as well have direct control. xscale method also gets so messy when dealing with containers and other possible non-stage conforming objects. I always follow the KISS rule.
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


Return to Tutorials



Who is online

Users browsing this forum: No registered users