How to make Inventory?

I’m making a survival game and how do I make it where the player can switch through each item and use one of them?

1 Like


try this :slight_smile:

1 Like

This is the advanced version

The example page is a great way to learn, make sure to always check it out if you need to do something because it might have what you’re looking for.

1 Like

wow code alpaca. i feel inferior now

2 Likes

Those were made by JR01, not me. I just gave the link

2 Likes

still… you supplied a whole game while i gave a little code

1 Like

drama :skull:
But yea, both examples r good, the first one just doesn’t really have UI (sry pal)

3 Likes

well the button click is just an example for a trigger. you could use clicking on another sprite or other things for the trigger instead. i simply put the basic “in between” code that he asked for, while he can put the results anywhere he wants.

1 Like

or her

okee jeez
*el backs off *

1 Like

XD sry i am defensive lots and can whip up a good argument very quickly

1 Like

Well that’s all good I need it so you can switch to a axe and then a gun without still having the axe

1 Like

Switches. Just press 1 for example to get the gun out, then press 2 to get the axe out. If you need to pick these items up/drop them just use Switches.

2 Likes

{“data”:{“behavior”:{“v”:“2”,“nodes”:[{“inputCount”:2,“outputCount”:1,“name”:“Emitter”,“behaviorType”:“logic.components.Emitter”,“x”:-450,“y”:-496,“group”:“”,“id”:“3c575ec2a2f24f4c”,“entityClassId”:18363106,“maxAge”:999999,“force”:10,“rotate”:false,“angle”:0,“independent”:false,“oX”:6,“oY”:1,“pin”:false},{“inputCount”:0,“outputCount”:4,“name”:“MouseClick”,“behaviorType”:“logic.triggers.MouseClick”,“x”:-630,“y”:-496,“group”:“”,“id”:“3c5788194a9c5545”,“global”:true,“rightClick”:false,“skipAlpha”:false},{“inputCount”:0,“outputCount”:2,“name”:“Keyboard”,“behaviorType”:“logic.triggers.Keyboard”,“x”:-450,“y”:-288,“group”:“”,“id”:“3c5873a87f7b4345”,“keyCode”:40},{“inputCount”:0,“outputCount”:2,“name”:“Keyboard”,“behaviorType”:“logic.triggers.Keyboard”,“x”:-450,“y”:-176,“group”:“”,“id”:“3c5881188e43d641”,“keyCode”:39},{“inputCount”:0,“outputCount”:2,“name”:“Keyboard”,“behaviorType”:“logic.triggers.Keyboard”,“x”:-450,“y”:-64,“group”:“”,“id”:“3c5894e91daf0040”,“keyCode”:37},{“inputCount”:0,“outputCount”:2,“name”:“Keyboard”,“behaviorType”:“logic.triggers.Keyboard”,“x”:-450,“y”:48,“group”:“”,“id”:“3c58a0cd9680ce4f”,“keyCode”:38},{“inputCount”:3,“outputCount”:3,“name”:“Animation”,“behaviorType”:“logic.properties.Animation”,“x”:-90,“y”:-400,“group”:“”,“id”:“3c58d447d4a5d545”,“animationName”:“Duck”,“priority”:0},{“inputCount”:3,“outputCount”:3,“name”:“Animation”,“behaviorType”:“logic.properties.Animation”,“x”:0,“y”:-240,“group”:“”,“id”:“3c58d56ab256e94e”,“animationName”:“Run”,“loop”:true,“priority”:0},{“inputCount”:3,“outputCount”:3,“name”:“Animation”,“behaviorType”:“logic.properties.Animation”,“x”:90,“y”:-96,“group”:“”,“id”:“3c58d6bb46a8aa41”,“animationName”:“Run”,“loop”:true,“priority”:0},{“inputCount”:3,“outputCount”:3,“name”:“Animation”,“behaviorType”:“logic.properties.Animation”,“x”:270,“y”:16,“group”:“”,“id”:“3c58d832ee7f234e”,“animationName”:“Jump”,“loop”:true,“priority”:0},{“inputCount”:3,“outputCount”:3,“name”:“Animation”,“behaviorType”:“logic.properties.Animation”,“x”:0,“y”:160,“group”:“”,“id”:“3c58d97ca4e1084a”,“animationName”:“Mystery puncher”,“priority”:0},{“inputCount”:0,“outputCount”:1,“name”:“Collision”,“behaviorType”:“logic.triggers.Collision”,“x”:-360,“y”:128,“group”:“”,“id”:“3c5a663d5e24ec42”,“targetClassId”:18363089,“targetEntityId”:0,“collisionFilter”:15,“collideWithEntity”:false,“delay”:0},{“inputCount”:0,“outputCount”:0,“name”:“Run & Jump”,“behaviorType”:“logic.NodeGroup”,“x”:-180,“y”:-128,“group”:0,“id”:“3c5b3ed35ef1e64a”,“notes”:null,“n_o”:0,“isMenuItem”:false},{“inputCount”:3,“outputCount”:1,“name”:“Number”,“behaviorType”:“logic.logic.Value”,“x”:180,“y”:-32,“group”:“3c5b3ed35ef1e64a”,“id”:“3c5b3ed492296949”,“startVal”:-6,“tag”:“move left”},{“inputCount”:3,“outputCount”:3,“name”:“Velocity”,“behaviorType”:“logic.properties.Physics”,“x”:360,“y”:96,“group”:“3c5b3ed35ef1e64a”,“id”:“3c5b3ed4146f1647”},{“inputCount”:3,“outputCount”:3,“name”:“Flip”,“behaviorType”:“logic.properties.Flip”,“x”:360,“y”:-32,“group”:“3c5b3ed35ef1e64a”,“id”:“3c5b3ed5afe37a43”,“vertical”:false},{“inputCount”:3,“outputCount”:1,“name”:“Number”,“behaviorType”:“logic.logic.Value”,“x”:180,“y”:96,“group”:“3c5b3ed35ef1e64a”,“id”:“3c5b3ed5bf73ab41”,“startVal”:6,“tag”:“move right”},{“inputCount”:0,“outputCount”:2,“name”:“Keyboard”,“behaviorType”:“logic.triggers.Keyboard”,“x”:0,“y”:320,“group”:“3c5b3ed35ef1e64a”,“id”:“3c5b3ed54be57640”,“keyCode”:38,“repeats”:false,“delay”:0},{“inputCount”:0,“outputCount”:2,“name”:“Keyboard”,“behaviorType”:“logic.triggers.Keyboard”,“x”:0,“y”:96,“group”:“3c5b3ed35ef1e64a”,“id”:“3c5b3ed6037df846”,“keyCode”:39,“repeats”:true,“delay”:0},{“inputCount”:0,“outputCount”:2,“name”:“Keyboard”,“behaviorType”:“logic.triggers.Keyboard”,“x”:0,“y”:-32,“group”:“3c5b3ed35ef1e64a”,“id”:“3c5b3ed6b3a2f248”,“keyCode”:37,“repeats”:true,“delay”:0},{“inputCount”:3,“outputCount”:1,“name”:“Number”,“behaviorType”:“logic.logic.Value”,“x”:180,“y”:320,“group”:“3c5b3ed35ef1e64a”,“id”:“3c5b3ed6744a8d46”,“startVal”:12,“tag”:“jump force”},{“inputCount”:0,“outputCount”:1,“name”:“Collision”,“behaviorType”:“logic.triggers.Collision”,“x”:180,“y”:224,“group”:“3c5b3ed35ef1e64a”,“id”:“3c5b3ed615824c4f”,“targetClassId”:0,“targetEntityId”:0,“collisionFilter”:15,“collideWithEntity”:false},{“inputCount”:3,“outputCount”:1,“name”:“Switch”,“behaviorType”:“logic.logic.Switch”,“x”:360,“y”:224,“group”:“3c5b3ed35ef1e64a”,“id”:“3c5b3ed645951047”,“_startVal”:0,“dataType”:2},{“inputCount”:3,“outputCount”:3,“name”:“Impulse”,“behaviorType”:“logic.components.Impulse”,“x”:540,“y”:224,“group”:“3c5b3ed35ef1e64a”,“id”:“3c5b3ed6d167224d”},{“inputCount”:5,“outputCount”:5,“name”:“Camera”,“behaviorType”:“logic.components.View”,“x”:270,“y”:-336,“group”:“”,“id”:“3c633c45b554ff47”,“parallax”:100,“scrollX”:true,“scrollY”:true,“minLeft”:0,“maxRight”:84,“top”:0,“bottom”:11,“repeatBG”:true}],“links”:[{“input_id”:“3c575ec2a2f24f4ci0”,“output_id”:“3c5788194a9c5545o0”},{“input_id”:“3c575ec2a2f24f4ci0”,“output_id”:“3c5788194a9c5545o0”},{“input_id”:“3c58d447d4a5d545i0”,“output_id”:“3c5873a87f7b4345o0”},{“input_id”:“3c58d447d4a5d545i1”,“output_id”:“3c5873a87f7b4345o1”},{“input_id”:“3c58d56ab256e94ei0”,“output_id”:“3c5881188e43d641o0”},{“input_id”:“3c58d97ca4e1084ai1”,“output_id”:“3c5881188e43d641o0”},{“input_id”:“3c58d56ab256e94ei1”,“output_id”:“3c5881188e43d641o1”},{“input_id”:“3c58d6bb46a8aa41i0”,“output_id”:“3c5894e91daf0040o0”},{“input_id”:“3c58d6bb46a8aa41i1”,“output_id”:“3c5894e91daf0040o1”},{“input_id”:“3c58d832ee7f234ei0”,“output_id”:“3c58a0cd9680ce4fo0”},{“input_id”:“3c58d832ee7f234ei1”,“output_id”:“3c58a0cd9680ce4fo1”},{“input_id”:“3c58d447d4a5d545i0”,“output_id”:“3c5873a87f7b4345o0”},{“input_id”:“3c58d447d4a5d545i1”,“output_id”:“3c5873a87f7b4345o1”},{“input_id”:“3c58d56ab256e94ei0”,“output_id”:“3c5881188e43d641o0”},{“input_id”:“3c58d56ab256e94ei1”,“output_id”:“3c5881188e43d641o1”},{“input_id”:“3c58d6bb46a8aa41i0”,“output_id”:“3c5894e91daf0040o0”},{“input_id”:“3c58d6bb46a8aa41i1”,“output_id”:“3c5894e91daf0040o1”},{“input_id”:“3c58d832ee7f234ei0”,“output_id”:“3c58a0cd9680ce4fo0”},{“input_id”:“3c58d832ee7f234ei1”,“output_id”:“3c58a0cd9680ce4fo1”},{“input_id”:“3c58d97ca4e1084ai0”,“output_id”:“3c5a663d5e24ec42o0”},{“input_id”:“3c58d97ca4e1084ai1”,“output_id”:“3c5881188e43d641o0”},{“input_id”:“3c58d97ca4e1084ai0”,“output_id”:“3c5a663d5e24ec42o0”},{“input_id”:“3c5b3ed5afe37a43i0”,“output_id”:“3c5b3ed492296949o0”},{“input_id”:“3c5b3ed4146f1647i0”,“output_id”:“3c5b3ed492296949o0”},{“input_id”:“3c5b3ed5afe37a43i1”,“output_id”:“3c5b3ed5bf73ab41o0”},{“input_id”:“3c5b3ed4146f1647i0”,“output_id”:“3c5b3ed5bf73ab41o0”},{“input_id”:“3c5b3ed6744a8d46i1”,“output_id”:“3c5b3ed54be57640o0”},{“input_id”:“3c5b3ed5bf73ab41i1”,“output_id”:“3c5b3ed6037df846o0”},{“input_id”:“3c5b3ed492296949i1”,“output_id”:“3c5b3ed6b3a2f248o0”},{“input_id”:“3c5b3ed645951047i2”,“output_id”:“3c5b3ed6744a8d46o0”},{“input_id”:“3c5b3ed645951047i1”,“output_id”:“3c5b3ed615824c4fo0”},{“input_id”:“3c5b3ed645951047i0”,“output_id”:“3c5b3ed645951047o0”},{“input_id”:“3c5b3ed6d167224di1”,“output_id”:“3c5b3ed645951047o0”}]}}}

1 Like

This topic is 2 years old. There isn’t a need to post here.

2 Likes