0 votes

I'm making an top down RPG that requires jumping. I haven't used anything in 3D yet and would rather start this project in 2D. It's like Mario & Luigi but as a Fawful inspired character. How could I replicate this? I am trying to use a system that you use with Node that operates with all objects with the group "Altitude", It is supposed to jump and at some point pass collision. I am at least looking for operation and fixes in my errors. Let me show you pictures and my code.

https://www.linkpicture.com/view.php?img=LPic6139cd675ca3f1735302768

extends Node

onready var offgrnd = false

onready var altitude = 0

var node = gettree().getroot().getnodesin_group("Altitude")

var sort = gettree().getroot().getnodesingroup("Sort").addchild(high)

onready var high = node.position.y * 0

func _process(delta):
print(altitude)
#high.position = Vector2(node.position.x, node.position.y)

if node.offgrnd == true:
    altitude = node.y * 0
    if node.y > altitude + 16:
        node.z_index = 1
    elif node.y > altitude + 32:
        node.z_index = 2
    elif node.y > altitude + 48:
        node.z_index = 3
    elif node.y > altitude + 64:
        node.z_index = 4
    elif node.y > altitude + 80:
        node.z_index = 5
    elif node.y > altitude + 96:
        node.z_index = 6
    elif node.y > altitude + 112:
        node.z_index = 7
    elif node.y > altitude + 128:
        node.z_index = 8
    elif node.y > altitude + 144:
        node.z_index = 9
    elif node.y > altitude + 160:
        node.z_index = 10
    elif node.y > altitude + 176:
        node.z_index = 11
    elif node.y > altitude + 192:
        node.z_index = 12
    elif node.y > altitude + 208:
        node.z_index = 13
    elif node.y > altitude + 224:
        node.z_index = 14
    elif node.y > altitude + 240:
        node.z_index = 15
    elif node.y > altitude + 256:
        node.z_index = 16
    elif node.y > altitude + 272:
        node.z_index = 17
    elif node.y > altitude + 288:
        node.z_index = 18
    elif node.y > altitude + 304:
        node.z_index = 19
    elif node.y > altitude + 336:
        node.z_index = 20
    elif node.y > altitude + 320:
        node.z_index = 21
    elif node.y > altitude + 352:
        node.z_index = 22
    elif node.y > altitude + 368:
        node.z_index = 23
    elif node.y > altitude + 384:
        node.z_index = 24
    elif node.y > altitude + 400:
        node.z_index = 25
    elif node.y > altitude + 416:
        node.z_index = 26
    elif node.y > altitude + 432:
        node.z_index = 27
    elif node.y > altitude + 448:
        node.z_index = 28
    elif node.y > altitude + 464:
        node.z_index = 29
    elif node.y > altitude + 480:
        node.z_index = 30
    elif node.y > altitude + 496:
        node.z_index = 31
    elif node.y > altitude + 512:
        node.z_index = 32
    elif node.y > altitude + 528:
        node.z_index = 33
    elif node.y > altitude + 544:
        node.z_index = 34
    elif node.y > altitude + 560:
        node.z_index = 35
    elif node.y > altitude + 576:
        node.z_index = 36
    elif node.y > altitude + 592:
        node.z_index = 37
    elif node.y > altitude + 608:
        node.z_index = 38
    elif node.y > altitude + 624:
        node.z_index = 39
    elif node.y > altitude + 640:
        node.z_index = 40
else:
    null
Godot version 3.3.3
in Engine by (14 points)
edited by

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.