Hey all!
I’m building a 2D vertical climbing game in GDevelop (kind of like a Flappy Bird meets Pac-Man in a skyscraper raccoon chaos vibe).
I’ve set up a grid system with node sprites that the player (a raccoon) should move between using arrow keys. The idea is:
• The raccoon moves up/down when aligned with a green “climb node”
• It should move left/right when aligned with a horizontal orange sill node
• Each node is a sprite placed in the scene (not created at runtime)
The problem:
Right now, the raccoon can move up and down fine, but refuses to turn or move left/right—even when the input is triggered and the sill node should be reachable.
I’ve tried:
• Duplicating the up/down logic and modifying for left/right
• Using scene variables to check node alignment
• Checking for collision with points or overlapping node sprites
• Tween logic for smooth movement between nodes
No luck so far.
Screenshot attached (I’ve got startup events as well, but can only include one screenshot with this post)
What I want to happen:
Prior to (or when) the raccoon reaches alignment with a sill node and the player hits left or right, it should move to the corresponding node in that direction and rest in the sill.
Any ideas what I might be missing? I’m relatively new to GDevelop and just spinning my wheels for endless hours on this issue that seems like it shouldn’t be as difficult as I’m making it. Grateful for any help or examples!
Thanks in advance,
Joe
1 Like
How large are the nodes and where is the player object’s origin? If the origin is in the default upper left corner (0,0) then the point minus the spacing might not be inside the node. You might need to either move the origin or use CenterX() and CenterY()
Note : with recent versions of GD, the variable() expressions are no longer needed. You can use just the variable name.
Here’s a crude drawing. The circle is the player. Square the node.
1 Like
Thanks for writing - yep, I was sure to have node and objects with centered origins. Good to know I don’t need vairable() expressions going forward.
Here’s a screenshot of the scene - super simple grid and everything is in alignment…
Also, not sure if my Startup Events could have an impact - here are those, if it helps.
I’m not sure why yours isn’t working. I tried doing it on my phone and on my first try my spacing was too small. I added a shape painter to draw a circle at the position plus/minus my grid size.
Since I don’t have keys on my phone, I tested it with a joystick. I used a bunch of ANDs inside an OR. Once one AND is created, it can be copied an pasted. I used the position of the picked object for the destination.
2 Likes
Thanks for recreating the concept - it looks simple and clear. I’ve entered what you’re suggesting, and my result is the raccoon climbs only straight upward (directional keys aren’t having any effect).
Could it be a previous event or setting overriding something?
Here are the beginning of scene events… does anything jump out as conflicting?
Can you post a screenshot of how you used my events? I don’t see an issue. I tested it with nodes that were evenly spaced in both directions. Depending on the size of your nodes, you might need to modify the offset values.
It might help to either draw a circle at the offset positions or position a test object. Something to verify that the right area is being targeted with the point is inside. Put the action on line with conditions so it’s not affect by anything else.
Here’s my version of your suggested events. When I set up the nodes, I assumed it was fine to simply created sprites and named them nodes (climbnode, sillnode), create temporary square shapes for them with the intention of removing the square shape from the sprite when the layout is complete and functional so they would be invisible. Maybe that has something to do with it, if nodes need to be created a certain way (?)
It’s testing against 2 different nodes. It might help if you create a group with both objects and then use the group name for all of the conditions and actions. As is, it’s using only have of the coordinates when a key is pressed and getting the other coordinate from I’m assuming the earliest created instance of the other object. Or maybe not. I would need to test it. Using a group, it could use both X and Y from the picked object.
Up and down should be checking Racoon.Y() +/- the grid spacing. It’s currently using X.
Make sure the tween is also deleted when finished like in my example. Otherwise, you would only be able to move once.
Those were good tips, but didn’t change the result. I thought perhaps the node variables could be the cause (screenshot attached), like “AllowLeft/Down/Right/Up” were all set to false for some reason. But that didn’t change the result either. Also, I’ve set all nodes Z layer to match the raccoon at “10”, but that didn’t solve it.
I would double check the grid sizes. Either use a shape painter and draw a circle or position an object. Use the racoon X and Y, do one direction at a time like racoon.X() - the appropriate grid variable. You’ll be able to tell if the point is inside condition is looking in the correct positions.
You could also temporarily disable the earlier events. To make sure they’re not interfering.
Geesh, still no luck, lol. I also tried adding nodes at every grid location (rather than spacing the nodes out along the grid), but still the direction triggers have no affect. At a loss 
I’ll probably just have to start from scratch with a template - any suggestions of a game similar for what I’m trying to do? I know there are a couple 2D top-down game templates on GDevelop…
I can’t think of anything similar. You might want to try breaking it down. Try getting 1 direction at a time. I still think. It might be the grid spacing.