I make other game and i want a moving background is moving literally with the player… Like Sonic 2D games
I have a game with this feature. Flowlab Game Creator - Vironia: The Tales of Elden BETA
It is in Beta. Basically, you want to extract the Player’s X and Y set into a pair of globals:
This global can be extracted in any other object in the game.
In the background, make an object that is the size of the game screen and import this code into it:
{"data":{"behavior":{"v":"2","nodes":[{"inputCount":0,"outputCount":1,"name":"Always","behaviorType":"logic.triggers.Always","x":-450,"y":96,"group":"a9f751e60e394d43","id":"a9f7763e4e986b47"},{"inputCount":3,"outputCount":1,"name":"Global","behaviorType":"logic.logic.Global","x":-270,"y":0,"group":"a9f751e60e394d43","id":"a9f77f1ef1609642","tag":"PX:Number","version":2,"dataType":2},{"inputCount":3,"outputCount":1,"name":"Global","behaviorType":"logic.logic.Global","x":-270,"y":128,"group":"a9f751e60e394d43","id":"a9f780b7c682234f","tag":"PY:Number","version":2,"dataType":2},{"inputCount":4,"outputCount":2,"name":"Position","behaviorType":"logic.properties.Position","x":-90,"y":80,"group":"a9f751e60e394d43","id":"a9f7ba0ede87b548","pixelUnits":true,"resetVelocity":false}],"links":[{"input_id":"a9f77f1ef1609642i1","output_id":"a9f7763e4e986b47o0"},{"input_id":"a9f780b7c682234fi1","output_id":"a9f7763e4e986b47o0"},{"input_id":"a9f77f1ef1609642i1","output_id":"a9f7763e4e986b47o0"},{"input_id":"a9f7ba0ede87b548i0","output_id":"a9f77f1ef1609642o0"},{"input_id":"a9f780b7c682234fi1","output_id":"a9f7763e4e986b47o0"},{"input_id":"a9f7ba0ede87b548i1","output_id":"a9f780b7c682234fo0"},{"input_id":"a9f7ba0ede87b548i0","output_id":"a9f77f1ef1609642o0"},{"input_id":"a9f7ba0ede87b548i1","output_id":"a9f780b7c682234fo0"}]}}}
This will move the background to the middle of the player every frame of the game.
If you need any more help, tag me here and I will see what I can do.
-Ember.Y
its not work check by yourself in my game
you mean parralax? Thats in camera settings
don’t work and this is a image of what i want
and just leaving it in its current screen position but only following the player like a game that just wants to keep that one screen of levels
You need some code to make it work. I showed an example of the code needed in each object, and it’s quite simple. Huff
I will make bundles for you to import.
{"data":{"behavior":{"v":"2","nodes":[{"inputCount":0,"outputCount":0,"name":"Position gloabls.","behaviorType":"logic.NodeGroup","x":-1170,"y":128,"group":"","id":"34072826fc9d2b4a","isMenuItem":false},{"inputCount":0,"outputCount":1,"name":"Always","behaviorType":"logic.triggers.Always","x":-1350,"y":368,"group":"34072826fc9d2b4a","id":"340695dccadc8741"},{"inputCount":1,"outputCount":1,"name":"Extractor","behaviorType":"logic.properties.Extractor","x":-1170,"y":304,"group":"34072826fc9d2b4a","id":"3406aa4ce5b17b45","targetId":0,"prop":"x","version":2},{"inputCount":1,"outputCount":1,"name":"Extractor","behaviorType":"logic.properties.Extractor","x":-1170,"y":416,"group":"34072826fc9d2b4a","id":"3406ab165244f743","targetId":0,"prop":"y","version":2},{"inputCount":3,"outputCount":1,"name":"Global","behaviorType":"logic.logic.Global","x":-990,"y":288,"group":"34072826fc9d2b4a","id":"3406ceafb7fc2444","tag":"Player X position:Number","version":2,"dataType":2},{"inputCount":3,"outputCount":1,"name":"Global","behaviorType":"logic.logic.Global","x":-990,"y":416,"group":"34072826fc9d2b4a","id":"3406cf1d6dd82044","tag":"Player Y position:Number","version":2,"dataType":2}],"links":[{"input_id":"3406aa4ce5b17b45i0","output_id":"340695dccadc8741o0"},{"input_id":"3406ab165244f743i0","output_id":"340695dccadc8741o0"},{"input_id":"3406ceafb7fc2444i0","output_id":"3406aa4ce5b17b45o0"},{"input_id":"3406cf1d6dd82044i0","output_id":"3406ab165244f743o0"}]}}}
This code needs to be imported into your ‘player’ object. There is a copy icon in the upper right of the code I posted above. Use this to copy the code text and then click in the player’s behavior editor. Press on ‘Import’
and paste the code text.
Next, do the same with this code for the background object you want to follow the player.
{"data":{"behavior":{"v":"2","nodes":[{"inputCount":0,"outputCount":0,"name":"Global Follow","behaviorType":"logic.NodeGroup","x":-540,"y":16,"group":"","id":"340993addade8643","isMenuItem":false},{"inputCount":0,"outputCount":1,"name":"Always","behaviorType":"logic.triggers.Always","x":-540,"y":16,"group":"340993addade8643","id":"34094bdc3a8c9a45"},{"inputCount":3,"outputCount":1,"name":"Global","behaviorType":"logic.logic.Global","x":-360,"y":-32,"group":"340993addade8643","id":"3409549fd3104a46","tag":"Player X position:Number","version":2,"dataType":2},{"inputCount":3,"outputCount":1,"name":"Global","behaviorType":"logic.logic.Global","x":-360,"y":64,"group":"340993addade8643","id":"340955246097a045","tag":"Player Y position:Number","version":2,"dataType":2},{"inputCount":4,"outputCount":2,"name":"Position","behaviorType":"logic.properties.Position","x":-180,"y":0,"group":"340993addade8643","id":"34097d44dd047f44","pixelUnits":true,"resetVelocity":false}],"links":[{"input_id":"3409549fd3104a46i1","output_id":"34094bdc3a8c9a45o0"},{"input_id":"340955246097a045i1","output_id":"34094bdc3a8c9a45o0"},{"input_id":"34097d44dd047f44i0","output_id":"3409549fd3104a46o0"},{"input_id":"34097d44dd047f44i1","output_id":"340955246097a045o0"}]}}}
Remember, this code needs to be imported into the background object you want to follow the player.
Edit: For goodness’ sake, here’s an easy example to copy.
-Ember.Y