Home    LittleBigPlanet 2 - 3 - Vita - Karting    LittleBigPlanet 2    [LBP2] Help!
#1

Original snake!

Archive: 11 posts


I want to recreate the original snake on the Nokia phone. And the one thing that puzzled me when writing the Logic was for example if you move right you cant move left. Unless you press down and left or up or left. Could someone demonstrate the logic or help me with this?2012-11-27 00:01:00

Author:
bizkitboii
Posts: 40


One answer could be to use a selector to cycle between 4 (5?) sets of control logic.

You can't move in the same direction twice in a row. Correct?

So the 4 sets will each have one direction they can't go:
(BLACK = OK, RED = CAN'T GO)
UP, DOWN, LEFT, RIGHT
UP, DOWN, LEFT, RIGHT
UP, DOWN, LEFT, RIGHT
UP, DOWN, LEFT, RIGHT
(plus a 5th set that lets you all directions, at the beginning?)

So when you press DOWN, in any set of logic, it will cycle to the set of logic where DOWN is disabled. The player can only select UP, LEFT or RIGHT. When they select UP, it will cycle to the set of logic where UP is disabled. The player can only select DOWN, LEFT or RIGHT. And so on...

The actual wiring is something you'll have to play with as I'm just theorizing in my head. You'll need to output all DOWN buttons to an "OR gate" which outputs to the DOWN set of logic, output all UP buttons to an "OR gate" which outputs to the UP set of logic, etc.









There may be a simpler version of this:

Wire UP, DOWN, LEFT, RIGHT actions to 4 different one-shot counters. When you press DOWN, it triggers that one-shot counter and resets all others.
2012-11-27 01:24:00

Author:
Unknown User


thanks very much! I will try literally all these methods!!! I tried messing around with it for hours and I couldn't get close. I could only make it Move up down left and right of course. i'm pretty sure I can handle everything else its just these controls that are bugging me. :L2012-11-27 09:57:00

Author:
bizkitboii
Posts: 40


I actually managed this (see the level in my sig). I can get you some screen shots of the logic if you want?
I'm not that great at logic, so it's not that complicated to do.

If I remember correctly (it's been a while), I used a selector for each direction. If you press left, the selector output that makes the snake move left is activated. Once this is active, you can't select the right direction.

If you've not already done so, you'll need to come up with a method so that the snake can't move diagonally, because I had an issue where if you held the left stick in (eg) an up/left position, the snake would move in that direction in sort of a zigzaggy fashion.
The method I used (which should be very similar if not identical to what you do) is to use XOR gates..... I think.

I've not actually got the level saved to my moon at the moment, but it shouldn't be a problem to get it back there to look at the logic if you need any help.
2012-11-27 12:40:00

Author:
Ali_Star
Posts: 4085


I actually managed this (see the level in my sig). I can get you some screen shots of the logic if you want?
I'm not that great at logic, so it's not that complicated to do.

If I remember correctly (it's been a while), I used a selector for each direction. If you press left, the selector output that makes the snake move left is activated. Once this is active, you can't select the right direction.

If you've not already done so, you'll need to come up with a method so that the snake can't move diagonally, because I had an issue where if you held the left stick in (eg) an up/left position, the snake would move in that direction in sort of a zigzaggy fashion.
The method I used (which should be very similar if not identical to what you do) is to use XOR gates..... I think.

I've not actually got the level saved to my moon at the moment, but it shouldn't be a problem to get it back there to look at the logic if you need any help.

I have tried multiple solutions, I tried making a selector for up and down and left and right. I have tried using XOR Gates, I quickly see the idea in my head then it runs away.I haven''t had the time to try the ideas that have been given since I posted this but I will try tonight or tomorrow, Could you possibly send me some screenshots would be very helpful if you can get the level that would be great!
2012-11-27 18:58:00

Author:
bizkitboii
Posts: 40


http://i3.lbp.me/img/ft/a73a6d968fe0ccd1d76060bceaa78777c2a141d5.jpg

The four multi-coloured OR gates on the left are the directional inputs (they're OR gates because there is a multiplayer powerup which reverses the controls).

They lead to 2 microchips. 1 for U/D, and one for L/R movement. The outputs of the microchips lead to a selector. Each output of the selector leads (through some more logic) to the green tags, which tell the snake which direction to move in.

Each output of the selector is connected to a NOT gate, and it is this NOT gate which prevents the Snake from moving in the opposite direction.

In the pic I've shown, the snake is moving RIGHT.

Unfortunately, that's all I can give you really. I'm not 100% sure of what the other bits and bobs do, as it was a while since I did this, all I know is that it works.

Hopefully it's enough of a base to get you going!

EDIT: BTW, the counter in the top right is for the FIRST movement of the Snake, as it is stationary to begin with.
2012-11-27 21:12:00

Author:
Ali_Star
Posts: 4085


http://i3.lbp.me/img/ft/a73a6d968fe0ccd1d76060bceaa78777c2a141d5.jpg

The four multi-coloured OR gates on the left are the directional inputs (they're OR gates because there is a multiplayer powerup which reverses the controls).

They lead to 2 microchips. 1 for U/D, and one for L/R movement. The outputs of the microchips lead to a selector. Each output of the selector leads (through some more logic) to the green tags, which tell the snake which direction to move in.

Each output of the selector is connected to a NOT gate, and it is this NOT gate which prevents the Snake from moving in the opposite direction.

In the pic I've shown, the snake is moving RIGHT.

Unfortunately, that's all I can give you really. I'm not 100% sure of what the other bits and bobs do, as it was a while since I did this, all I know is that it works.

Hopefully it's enough of a base to get you going!

EDIT: BTW, the counter in the top right is for the FIRST movement of the Snake, as it is stationary to begin with.

Gotcha! Cheers for helping! And i know what it is like to make some logic and then completely forget how it works especially when there is just too much stuff I need to make a tidyer way of doing things cheers for your help anyway man I will try this out some point shortly!!
2012-11-28 11:05:00

Author:
bizkitboii
Posts: 40


Gotcha! Cheers for helping! And i know what it is like to make some logic and then completely forget how it works especially when there is just too much stuff I need to make a tidyer way of doing things cheers for your help anyway man I will try this out some point shortly!!

No problemo.

Have you figured out what to do about making the snake "grow"? I had a bit of difficulty with that and had to ask the forum members. I've managed to find the thread for you here:

https://lbpcentral.lbp-hub.com/index.php?t=62042-Logic-Help-Related-to-Selectors-Destroyers-and-Pulses

What are you planning to do with the "walls" of the arena? Are you going to allow the snake to pass from one side to the other?

If you'd like any more help with the logic just let me know and I'll do my best to help you. Of course, feel free to play my level and see if that gives you any more ideas.
2012-11-28 11:56:00

Author:
Ali_Star
Posts: 4085


No problemo.

Have you figured out what to do about making the snake "grow"? I had a bit of difficulty with that and had to ask the forum members. I've managed to find the thread for you here:

https://lbpcentral.lbp-hub.com/index.php?t=62042-Logic-Help-Related-to-Selectors-Destroyers-and-Pulses

What are you planning to do with the "walls" of the arena? Are you going to allow the snake to pass from one side to the other?

If you'd like any more help with the logic just let me know and I'll do my best to help you. Of course, feel free to play my level and see if that gives you any more ideas.

Perhaps if you want we can build the level together?
I take it you have already built this snake level? I'm going to do it anyway but the only reason I was going to build it was because I thought nobody else had done it :L.
And the original snake if you hit the wall its game over, the second snake on the next nokia you could go through the walls. And I do not have a clue on how to do that but would like to. have any ideas on that?

and also I know how to make the snake grow, What I will do is add an emitter of another block of the snake, when making that block there will be a microchip on it with a follower, that's as far as I have worked it out in my head. Its probably going to be more complicated then that but I reckon I could do it just couldn't do the controls for the snake :L
2012-11-28 14:24:00

Author:
bizkitboii
Posts: 40


Perhaps if you want we can build the level together?
I take it you have already built this snake level? I'm going to do it anyway but the only reason I was going to build it was because I thought nobody else had done it :L.
And the original snake if you hit the wall its game over, the second snake on the next nokia you could go through the walls. And I do not have a clue on how to do that but would like to. have any ideas on that?

and also I know how to make the snake grow, What I will do is add an emitter of another block of the snake, when making that block there will be a microchip on it with a follower, that's as far as I have worked it out in my head. Its probably going to be more complicated then that but I reckon I could do it just couldn't do the controls for the snake :L

Yes, I've already made it (link in my sig).
I've seen a few versions of Snake, but (without meaning to sound arrogant) I think mine is one of the better ones out there.

In my game, the snake can pass from one side to the other. It's actually fairly simple to do - just a case of deleting and emitting.

The snake's "body" movement is indeed more complicated than you think. Followers are all well and good, but remember that you'll want the body pieces to follow at right angles. I could not figure out a way to do this.
The body pieces of my snake are stationary. They don't follow the head. The snake moves with pulses (a timer sends a signal every 0.1s to move the snake 1 grid space). As your "level" goes up, it takes 1 extra pulse each time for the piece to disappear. So it appears the snake is growing and the body is moving, when neither is true.

Remember, you will need to keep logic on the body pieces as minimal as possible, as this has a massive effect on the thermo, especially as the snake gets bigger.

I'm working on a pretty big project myself at the moment, which has already taken too long, so all my creation time and pretty much 90% of my LBP time is spent on that. So I don't really have enough time to take on another project. But I'm happy to offer any advice I can and test it when the time comes.

If you want any more pics let me know, but my advice (and this is how I tend to work) is to try and work everything out on your own until you're absolutely 100% stuck. That's part of the fun with logic... seeing what you can do by yourself.
2012-11-28 15:01:00

Author:
Ali_Star
Posts: 4085


By the way I just played your level and it is awesome!!2012-11-28 23:36:00

Author:
bizkitboii
Posts: 40


LBPCentral Archive Statistics
Posts: 1077139    Threads: 69970    Members: 9661    Archive-Date: 2019-01-19

Datenschutz
Aus dem Archiv wurden alle persönlichen Daten wie Name, Anschrift, Email etc. - aber auch sämtliche Inhalte wie z.B. persönliche Nachrichten - entfernt.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.