Page 1 of 1
Motion Algoritms System
Posted:
Wed Sep 11, 2013 1:43 pm
by OwnerOfSuccuby
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
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.
Re: Motion Algoritms System
Posted:
Wed Sep 11, 2013 6:18 pm
by QuizmasterBos
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
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.
Re: Motion Algoritms System
Posted:
Wed Sep 11, 2013 8:08 pm
by OwnerOfSuccuby
Fixed some bugs and added new functions. No floating now - or may be just a 1 pixel +- from box.
Re: Motion Algoritms System
Posted:
Wed Sep 11, 2013 9:24 pm
by QuizmasterBos
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.
Re: Motion Algoritms System
Posted:
Fri Sep 13, 2013 6:58 am
by BlueLight
I as a java person demand to know what this code is for this!... I'm to damn tired to type, nite all.
Re: Motion Algoritms System
Posted:
Sat Sep 14, 2013 1:11 am
by hat973
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
Re: Motion Algoritms System
Posted:
Sat Sep 14, 2013 12:58 pm
by OwnerOfSuccuby
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);
Re: Motion Algoritms System
Posted:
Sat Sep 14, 2013 5:25 pm
by hat973
so for eximple Krystal.gotoAndStop(KrystalRight)
Re: Motion Algoritms System
Posted:
Sat Sep 14, 2013 7:15 pm
by OwnerOfSuccuby
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);
Re: Motion Algoritms System
Posted:
Sat Sep 14, 2013 9:36 pm
by hat973
im still having problems getting to work
Re: Motion Algoritms System
Posted:
Tue Sep 17, 2013 12:01 pm
by OwnerOfSuccuby
It is much simple to see an example of what do not work - and then say what do not work like it have to
Re: Motion Algoritms System
Posted:
Wed Sep 18, 2013 2:35 pm
by KaTsuO_O
hat973 was having a problem where the first frame of the walking animation kept repeating, but I helped him with that.
Re: Motion Algoritms System
Posted:
Wed Sep 25, 2013 10:57 am
by OwnerOfSuccuby
Sounf effects and Music added. May be make a little game with this algoritms ?
Re: Motion Algoritms System
Posted:
Thu Sep 26, 2013 12:12 am
by AnotherArrow
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!
Re: Motion Algoritms System
Posted:
Thu Sep 26, 2013 5:04 pm
by OwnerOfSuccuby
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
becouse if it will be 4 unwinable levels i will not need to make 5 th and etc
Just a joke
Like that or even a little more to add ?
Re: Motion Algoritms System
Posted:
Sat Sep 28, 2013 10:46 am
by GoRepeat
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).
Re: Motion Algoritms System
Posted:
Sun Sep 29, 2013 1:37 am
by IrrelevantComment
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.
Re: Motion Algoritms System
Posted:
Sun Sep 29, 2013 2:20 am
by AnotherArrow
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.
Re: Motion Algoritms System
Posted:
Mon Sep 30, 2013 9:57 pm
by GoRepeat
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.