[pre release] Turret Behavior

Post your completed addons to share with the community

Post » Mon Sep 05, 2011 12:15 pm

Error: assignment to undeclared variable i
Source File: http://localhost:50000/Turret_behavior.js
Line: 256
==>
Turret_behavior.js
Line: 256 Col 1:

     for(i = 0, len=instances.length; i < len; i++){ //iterate through instances


I wanted to fix these errors, but Fimbul is on top of it, you see it better through. Also I began to create my own turret behavior just to get hang of coding again, plus I need to create a slow custom movement for my destroyers.

Thank You for the shortcut, Ashley!
B
25
S
5
G
5
Posts: 138
Reputation: 5,638

Post » Mon Sep 05, 2011 12:22 pm

for(var i = 0, len=instances.length; i < len; i++){ //iterate through instances

Should fix it.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Mon Sep 05, 2011 1:12 pm

Okay, "for(Var i =".. then comes the error:
Error: this.targetUID is not extensible Source File: http://localhost:50000/Turret_behavior.js Line: 323

Anyway, fixed it. Now turret behavior works.

runtime.js

But Fimbul will change the runtime, so this was only a debug exercise.
B
25
S
5
G
5
Posts: 138
Reputation: 5,638

Post » Mon Sep 05, 2011 11:21 pm

fun. I can't reproduce it. It's probably due to the way firefox handles strict modes - it works ok on my end. I'll see if I can get some browsers to error out on me.
B
35
S
8
G
8
Posts: 532
Reputation: 6,868

Post » Mon Sep 05, 2011 11:32 pm

IE9 doesn't support strict mode so will let you get away with strict mode errors. Try on the latest Chrome - I find their dev tools are best anyway.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Mon Sep 05, 2011 11:51 pm

[QUOTE=Ashley] IE9 doesn't support strict mode so will let you get away with strict mode errors. Try on the latest Chrome - I find their dev tools are best anyway.[/QUOTE]
Apparently firefox 3.6.20 is also forgiving, as well as the latest opera and my build of chrome. I don't have ie9 to test, but it should be working as well. It now works with firefox 6 as well. Link updated.
B
35
S
8
G
8
Posts: 532
Reputation: 6,868

Post » Tue Sep 06, 2011 1:40 pm

Example.capx runs now in Firefox 5.1. Good job!
B
25
S
5
G
5
Posts: 138
Reputation: 5,638

Post » Wed Oct 26, 2011 9:33 pm

Hi, i just tested this and found that it doesn't work with 360 range, but it does work with -360.
Strange.
saludos :DAlexmosuTSP2011-10-26 21:33:57
B
9
S
2
G
4
Posts: 19
Reputation: 2,648

Post » Thu Jan 19, 2012 9:05 am

"This account is suspended" - Might want to upload somewhere else.
B
22
S
3
G
6
Posts: 52
Reputation: 4,387

Post » Thu Jan 19, 2012 8:53 pm

Fixed.Fimbul2012-01-19 21:20:58
B
35
S
8
G
8
Posts: 532
Reputation: 6,868

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 0 guests