Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | AllenTheAlien |
I’m trying to make a game where you click on an object and it will change places on the screen using a random number generator. How do make the random number generator work? Also I just started coding, which is why everything is probably wrong. lol
extends RigidBody2D
#variables
var base_speed = 200
var acceleration = 50
var scale_variation = 2
var motion = Vector2()
func _ready():
randomize()
# Clicks
func _input(event):
RandomNumberGenerator
var random_motiony = (randi_range(1,600))
var random_motionx = (randi_range(1,1024))
if event.type("lmb_click"):
if $UFO_collision:
motion.y = random_motiony
motion.x = random_motionx
Transform2D(scale_variation)
error(16,34): Method ‘randi_range’ is not declared in the current class.
Condition’ _debug_parse_err_line >=0’ is true.returned: _null