How to use JavaScript JDK?

For developers using the Construct 2 Javascript SDK

Post » Tue Oct 28, 2014 1:34 pm

Is there any book or tutorial that shows us how to make a plugin or behavior for C2? like I want to make a Magnet behavior from line-sight behavior and few events from it to create it, and plus I want to make it two types: North Pole and South Pole to either repel or attract. I don't have a clue. BTW I have basic knowledge on Javascript.
:roll:
ImageImageImageImageImage
B
57
S
16
G
5
Posts: 852
Reputation: 11,536

Post » Tue Oct 28, 2014 1:43 pm

There are some resources around; but the best place to start learning how to use SDK is to read the sources (runtime.js) directly; You'll learn how to read source code, you'll learn how are things done in SDK, and you'll learn a lot of javascript along the way.

You could start with how the line-sight behavior is implemented, and than continue from there!

Also, check out the SDK template, you'll se that some of the basic stuff is implemented so you can get a good start...
Be nice until it's time to not be nice
B
36
S
10
G
9
Posts: 293
Reputation: 6,712

Post » Tue Oct 28, 2014 2:01 pm

JohnnySheffield wrote:There are some resources around; but the best place to start learning how to use SDK is to read the sources (runtime.js) directly; You'll learn how to read source code, you'll learn how are things done in SDK, and you'll learn a lot of javascript along the way.

You could start with how the line-sight behavior is implemented, and than continue from there!

Also, check out the SDK template, you'll se that some of the basic stuff is implemented so you can get a good start...

Thanks for the info I will try them, and I want to ask you if you are a programmer, is Java near to javascript?
ImageImageImageImageImage
B
57
S
16
G
5
Posts: 852
Reputation: 11,536

Post » Tue Oct 28, 2014 4:26 pm

Naji wrote:is Java near to javascript?


Have you read the SDK overview ever? You should read the whole manual too, if you're serious about the writing plugins...
Be nice until it's time to not be nice
B
36
S
10
G
9
Posts: 293
Reputation: 6,712

Post » Tue Oct 28, 2014 5:12 pm

JohnnySheffield is more than likely referring to the following paragraph from the SDK docs:

Javascript is not Java! Java is an application programming language developed by Sun (which, confusingly, can also run in browsers via a plugin). Javascript is the native programming language for web pages in browsers. Make sure you're clear on the difference.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
137
S
31
G
87
Posts: 5,556
Reputation: 60,456

Post » Wed Oct 29, 2014 8:15 am

@zenox98

Yes, i did! I just did not want to simply c/p it, not because i'm lazy or mean, i just believe when somebody is learning it's valuable to let a 'student' discover stuff on his own; just give him push in the right direction...

The whole java/javascript story is interesting in it's historical contest. There's a lot of interesting details on javascript wiki page. Also, the web is full of articles on the topic. A simple google search results in a wealth of resources!
Be nice until it's time to not be nice
B
36
S
10
G
9
Posts: 293
Reputation: 6,712


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 0 guests