#okay I give 10€ to anyone who can help me fast :sob: still need help :)

51 messages · Page 1 of 1 (latest)

turbid prism
#

why only in 1 script and without collision?

thick kayak
#

it's a challenge we had

#

and the rule is to use only one big script attach to a node 2D

turbid prism
#

hmmm...i imagine it'll be very hard to make something like space invaders with just 1 script. Are sprites allowed?

thick kayak
#

yes

#

I did almost everything

#

I can send you the script if you want to see and test the game by yourself

turbid prism
#

okay then

#

I'll try my best to give advice

thick kayak
#

alright

#

first what's you PayPal for the bounty ^^

turbid prism
#

it's fine, i don't need paying (mainly because I don't have a debit card or paypal)

thick kayak
#

ohh

#

as you wish

turbid prism
#

i was more just curious

thick kayak
#

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

turbid prism
#

what's a video of it playing?

thick kayak
#

you want me to share my screen while open the game ?

turbid prism
#

no, i'm busy doing something on another screen and it'll distract me

thick kayak
#

okayy

#

it look like that

turbid prism
#

ohhh so the sprites arn't in the actual scene

thick kayak
#

yes they are generated in the scipt

#

script*

turbid prism
#

i've never seen that bofore

#

can the aliens move?

thick kayak
#

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)

turbid prism
#

so does everything function as you expect or is there any bugs?

thick kayak
#

basically that's how they are made

#

there is a bug

#

when the laser touch an alien nothing going on

turbid prism
#

hmmm

#

what's the lazer's script?

thick kayak
#

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)

turbid prism
#

i assume then the code for the lazer would be an if statement if the lazer touches a sprite on screen.

thick kayak
#

yes

turbid prism
#

I've never worked with sprites like this before, so I can't give specific code

#

i'm sorry

thick kayak
#

it's okay

turbid prism
#

maybe ask in one of the text channels to see if there's a expert who knows what to do

thick kayak
#

yes I will thanks