Simple Clone Project Tutorial

Hello, I just want to share a simple project about cloning and spawn objects…
Simple_Clone_Tutorial9-3-2020_12-09-55AM.wick (3.8 KB)

CloneProject

This project only has 3 clips, the blue player, the purple enemy and the yellow ammo. All the code is divided in those objects, but also in the main frame. I hope this could help some of you to get started with game development using the Wick Editor. Have fun!

1 Like

I think this is exactly what I need!! I needed to figure out how to make clones interact with clones, and this seems perfect. Maybe I will add enemies to my platformer engine after all :]

1 Like

@Jovanny

you made made a tutorial about cloning in about 20 times faster then it took me to learn anything about cloning and start up neon flight two years ago

i have much to learn form the commuity :)

1 Like

Hmmm, I already had some cloning knowledge, but I decided to give your tutorial a try, and it was great! I actually learned new things looking through ur code, every single-lined was well explained through the comments, these type of projects are pretty helpful, so thanks : )

1 Like

I can understand that programming could be hard at the beginning… I have to program every day at work… I have been learning programming languages the past 20 years… half of my life. Javascript is new for me so no expect my js code to be perfect or anything.

I made this tutorial in 1.5 hrs. With practice and help we could be better and better. Im still learning. The good thing is that google is your friend. We have a lot of references for js in the internet, so if you search on how to do stuff in js you will find tons of info.

1 Like

yay!
(also HOW IS IT 4KB ONLY)

1 Like

This demo only has 5 to 6 simple shapes and one text object made in the Editor, and no Sounds.

Ah makes sense

that is a very good tutorial.
hope it gets more visibility.

I have some question on clones handling tough
Let’s say I want to keep reference of different cloned clips (eg. different kinds of enemies)
I’d like to have all the clips in the same array to be able to cycle through them.
I would not use mybaseclip.clones as this take account only of clones of mybaseclip

i made something like:

clips = [];
for (i = 0; i < 5; i++) {
newclip=mybaseclip.clone();
newclip.x=100*i;
newclip.y=200;
clips.push(newclip);
}
for (j = 0; j<clips.length; j++ ){
clips[i].y +=10;
}

while the creation of the clips does work retriving the clips stored from array does not.
can you help me? is that a variable scope issue?
And btw is there a debugging tool or console in the desktop release of wickeditor?

That is because you are using the same clips[i] instead of clips[ j ]

An easy way is to add a variable in your baseclipEnemies…

this.type = 0;  // Enemy type 0
this.type = 1;  // Enemy type 1
this.type = 2;  // Enemy type 2

Then, at your loop you could have something like:

for(var enemy of clips)
{
    if(enemy.type == 0)
    {
        // do something for enemy type 0
    }
    else if(enemy.type == 1)
    {
        // do something for enemy type 1
    }
    else
    {
        // do something for enemy type 2
    }
}

thanx man
I made such a foolish errors

do you know how to debug in desktop mode? any way to log other than changing a textfield text?

I haven’t used the desktop version yet… Let me summon @Hamzah_Al_Ani. Hamzo, do you know if there is a way to log things using the desktop app?

Same here… @pumpkinhead or @awc95014 might know the answer

Also…

This looks interesting, were u trying to write Hanzoh, or Hamzah, or just mixed both?
I’m just curious cause I never thought about my name this way

I actually haven’t gotten the desktop editor yet, despite my excitement for it being released.

Your nickname reminds me to Samurai Shodwon Hattori Hanzo…

1 Like

Cool, first time I hear about Hattori Hanzo

off topic

Hanzoh is a warrior name (I actually researched that a bit),
and so is Hamzah, which means the lion hunter.

:open_mouth: It is from an old amazing Japanese game…

Summary

Here is Hanzo in action from SS2.
https://www.youtube.com/watch?v=45Xbkys6Opo

1 Like