Discuss Scratch

derfloppmiau
Scratcher
11 posts

Advanced Coding

Feel free to comment here on anything that you consider “advanced” coding (from Scratch or elsewhere)







Doing scrolling with the Mouse Wheel is possible!!!

when [up_arrow v] key pressed
if <not <key [up_arrow v] pressed?>> then
change [scroll v] by (-1)
if <(scroll) < [0]> then
set [scroll v] to [0]
end
end

when [down_arrow v] key pressed
if <not <key [down_arrow v] pressed?>> then
change [scroll v] by (1)
if <(scroll) < (max_scroll)> then
set [scroll v] to (max_scroll)
end
end
AbdelkefiSlim
Scratcher
12 posts

Advanced Coding

I was thinking how are we gonna implement a way to display the abilities for several clones , [
not only that , the clones of the abilities needs to be identified from what clone it was triggred in order to inflict the right amount of damage.
-Squiggle
Scratcher
500+ posts

Advanced Coding

AbdelkefiSlim wrote:

I was thinking how are we gonna implement a way to display the abilities for several clones , [
not only that , the clones of the abilities needs to be identified from what clone it was triggred in order to inflict the right amount of damage.
(woah that's a confusing way of explaining it…)
Do you mean you need to find a way to show what each clone is doing, or get each clone to do a different thing - or is that really basic compared to what you're intending to do?
Or do you want something to detect how much damage it needs to inflict on each specific clone?

I have a studio for new/hesitant forum users https://scratch.mit.edu/studios/34049909/
—–
Squi (she/they)
derfloppmiau
Scratcher
11 posts

Advanced Coding

AbdelkefiSlim wrote:

I was thinking how are we gonna implement a way to display the abilities for several clones , [
not only that , the clones of the abilities needs to be identified from what clone it was triggred in order to inflict the right amount of damage.

In our case, it probably may be more efficient if we handle each Bot as a different object, because many clones always cause laggs. But in other cases, the only way I know, how to give a clone an “ID”, is with different costumes, so each clone has another costume-number.
-Squiggle
Scratcher
500+ posts

Advanced Coding

derfloppmiau wrote:

AbdelkefiSlim wrote:

I was thinking how are we gonna implement a way to display the abilities for several clones , [
not only that , the clones of the abilities needs to be identified from what clone it was triggred in order to inflict the right amount of damage.

In our case, it probably may be more efficient if we handle each Bot as a different object, because many clones always cause laggs. But in other cases, the only way I know, how to give a clone an “ID”, is with different costumes, so each clone has another costume-number.
Yes, either costume names or a ‘this sprite only’ variable which changes after each clone is created.

I have a studio for new/hesitant forum users https://scratch.mit.edu/studios/34049909/
—–
Squi (she/they)
AbdelkefiSlim
Scratcher
12 posts

Advanced Coding

derfloppmiau wrote:

AbdelkefiSlim wrote:

I was thinking how are we gonna implement a way to display the abilities for several clones , [
not only that , the clones of the abilities needs to be identified from what clone it was triggred in order to inflict the right amount of damage.

In our case, it probably may be more efficient if we handle each Bot as a different object, because many clones always cause laggs. But in other cases, the only way I know, how to give a clone an “ID”, is with different costumes, so each clone has another costume-number.


But what if the champion was picked twice ?
in that case we need clones
derfloppmiau
Scratcher
11 posts

Advanced Coding

AbdelkefiSlim wrote:

derfloppmiau wrote:

AbdelkefiSlim wrote:

I was thinking how are we gonna implement a way to display the abilities for several clones , [
not only that , the clones of the abilities needs to be identified from what clone it was triggred in order to inflict the right amount of damage.

In our case, it probably may be more efficient if we handle each Bot as a different object, because many clones always cause laggs. But in other cases, the only way I know, how to give a clone an “ID”, is with different costumes, so each clone has another costume-number.


But what if the champion was picked twice ?
in that case we need clones


That was not what I said
I meant that every Bot has his own object, with all the scripts and animations for each champion. That's much work, but it will perform much better than working with clones (we may still work with clones for the abilities and minions).
AbdelkefiSlim
Scratcher
12 posts

Advanced Coding

yes ! we need clones for abilities now tell me
how are u gonna define each clone of an ability in order to inflict the right amount of damage
is there any way to detect from who this clone was made.
AbdelkefiSlim
Scratcher
12 posts

Advanced Coding

im going to work on a prototype soon and see if i can figure out the best way possible for this.
derfloppmiau
Scratcher
11 posts

Advanced Coding

AbdelkefiSlim wrote:

yes ! we need clones for abilities now tell me
how are u gonna define each clone of an ability in order to inflict the right amount of damage
is there any way to detect from who this clone was made.

In a MOBA we do not need to know who cast the spell, we just need to know in which team he was, so we know who gets damaged and who not. To do this, probably two costumes would be nice (one for team 1, one for team 2).
AbdelkefiSlim
Scratcher
12 posts

Advanced Coding

derfloppmiau wrote:

AbdelkefiSlim wrote:

yes ! we need clones for abilities now tell me
how are u gonna define each clone of an ability in order to inflict the right amount of damage
is there any way to detect from who this clone was made.

In a MOBA we do not need to know who cast the spell, we just need to know in which team he was, so we know who gets damaged and who not. To do this, probably two costumes would be nice (one for team 1, one for team 2).
im gonna try and see if it works perfectly
AbdelkefiSlim
Scratcher
12 posts

Advanced Coding

derfloppmiau wrote:

AbdelkefiSlim wrote:

yes ! we need clones for abilities now tell me
how are u gonna define each clone of an ability in order to inflict the right amount of damage
is there any way to detect from who this clone was made.

In a MOBA we do not need to know who cast the spell, we just need to know in which team he was, so we know who gets damaged and who not. To do this, probably two costumes would be nice (one for team 1, one for team 2).
your idea is good though easy and effecient
derfloppmiau
Scratcher
11 posts

Advanced Coding

AbdelkefiSlim wrote:

derfloppmiau wrote:

AbdelkefiSlim wrote:

yes ! we need clones for abilities now tell me
how are u gonna define each clone of an ability in order to inflict the right amount of damage
is there any way to detect from who this clone was made.

In a MOBA we do not need to know who cast the spell, we just need to know in which team he was, so we know who gets damaged and who not. To do this, probably two costumes would be nice (one for team 1, one for team 2).
im gonna try and see if it works perfectly

And? Did it worked out for you?

Powered by DjangoBB