so i need the pig to walk itself but i dont know how
What boundaries do you want the pig to move in? In what direction do you want it to move?
I can answer your problem if you give me the answer to these questions
Similar to what hihilogic said, It is very difficult to understand what you need help with. If you go into more detail I’m sure we can help you, but right now its pretty vague what you need help with here.
what im trying to say is that i want the pig to move in different direction like up then down the left then right
Hmm, I may have what your looking for. Just give me a little bit, because I can’t be online for too long. Expect a tutorial this evening
Wrong. Expect a tutorial NOW!
Sooooo…
The easy way:
Make 4 blocks. Up, down, left and right.
- On collision with the Up block, set the X velocity to zero and the Y velocity to a positive number
- On collision with the Down block, set the X velocity to zero and the Y velocity to a negative
- On collision with the Left block, set the X velocity to a negative and the Y velocity to zero
- On collision with the Right block, set the X velocity to a positive and the Y velocity to zero
Hard way:
On once, have an ease to go to specified location. On the end of the ease, start the next ease, and once your eases are done connect them back to the first ease to start the loop again.
Or just use a left and right block and use them to rotate the pig 90 degrees, and -90 degrees…
Option numero tres has been presented
I can give you an example that I already have done.
sure i can accupted that thanks i was making a sneek peck at the new flowlab night funkin mod i was doing
Sorry, I didn’t have time to make a simpler example; this one is the same concept just with eases, but I didn’t know if you would know how to switch the eases into single values (snap rotation). Sorry, again I hope this works fine:
thx ill try to do some because im running low on space because i have free
Ah, yes. The 50 object limit. One thing you can do to avoid this is have a bunch of extractors on the object’s position, and if it has a certain position it’s able to execute a certain code. A great example of this is the chair in my new-and-improved Three Aspects game. I only used 25 objects, so you should definitely take a look: Flowlab Game Creator - My Three Aspects
Here’s the filter code for the chair (just as a filter example):
Notice the circles. The red circles are position filters, saying, “Is my X position (blank)? If so, turn on the switch to do this.”
The blue circles indicate the level filters, basically saying, “If the level is (blank), then turn on the switch to execute this code”
You’ll also notice that some are mixed and matched to properly execute code.
So basically, it’s one object within the library, it just has filters which allow it to execute multiple pieces of different code.
The same goes for a lot of objects in the Three Aspects game, such as the teacher, table, and shade objects.
ok but what this havr to do with me knowing what direction the pig goes?
It doesn’t. Just the fact that you’re running low on blocks. If people have a problem I try to find a solution
well ok ill try to find one thanks
Very late reply, but to give the pig a more normal look instead of seeming like a robot you can use the Random Behavior between 1 and 4 put that through a filter to find what direction the pig goes. You need to also add a ray cast to see if it’s getting close to any walls to turn around/not go one way. You can also do this for diagonal which will make it look even better. This is a small detail, but it’s the polish like this that makes a game really good.