#okay I give 10€ to anyone who can help me fast :sob: still need help :)
51 messages · Page 1 of 1 (latest)
it's a challenge we had
and the rule is to use only one big script attach to a node 2D
hmmm...i imagine it'll be very hard to make something like space invaders with just 1 script. Are sprites allowed?
yes
I did almost everything
I can send you the script if you want to see and test the game by yourself
it's fine, i don't need paying (mainly because I don't have a debit card or paypal)
i was more just curious
I see 😂
well the problem is here:
this is those few lines:
var aliens = get_tree().get_nodes_in_group("Alien")
if aliens.size() != 0:
for alien in aliens:
if laser_sprite.position == alien. position:
alien.queue_free()
laser_sprite.queue_free()
laser_sprite = null
score[0]+=1
laser_sprite is a sprite that is generated when I press ui_up
and alien is more complicated
what's a video of it playing?
you want me to share my screen while open the game ?
no, i'm busy doing something on another screen and it'll distract me
ohhh so the sprites arn't in the actual scene
yes
but I made them in a group
so they move in the same time and the same direction
func spawn_alien_grid():
var alien = Sprite.new()
if (random_alien == 1):
alien=alien1_node.duplicate()
add_child(alien)
so does everything function as you expect or is there any bugs?
basically that's how they are made
there is a bug
when the laser touch an alien nothing going on
if event.is_action_pressed("ui_up"):
if laser_sprite == null:
# Cree un sprite pour le laser
laser_sprite = Sprite.new()
var laser_texture = load("res://laser.png")
laser_sprite.texture = laser_texture
laser_sprite.scale = Vector2(4, 2)
laser_sprite.position = joueur_node.position
add_child(laser_sprite)
i assume then the code for the lazer would be an if statement if the lazer touches a sprite on screen.
yes
I've never worked with sprites like this before, so I can't give specific code
i'm sorry
it's okay
maybe ask in one of the text channels to see if there's a expert who knows what to do
yes I will thanks