Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Eben Blaisdell
blockcode
Commits
9db86fcc
Commit
9db86fcc
authored
Feb 10, 2017
by
Eben Blaisdell
Browse files
dzParseInt in index.js
parent
d72add18
Changes
2
Hide whitespace changes
Inline
Side-by-side
bcfe.js
View file @
9db86fcc
...
...
@@ -335,14 +335,17 @@ builtinfuncs = {
bimove
:
function
(
scope
){
//console.log("move");
scope
.
interp
.
block
.
move
(
ea
(
0
,
scope
));
return
""
;
},
bimessage
:
function
(
scope
){
//console.log("sendMessage");
scope
.
interp
.
block
.
sendMessage
(
ea
(
0
,
scope
));
return
""
;
},
biattack
:
function
(
scope
){
//console.log("sendMessage");
scope
.
interp
.
block
.
attack
(
ea
(
0
,
scope
));
return
""
;
},
biisOpen
:
function
(
scope
){
//console.log("sendMessage");
...
...
index.js
View file @
9db86fcc
...
...
@@ -474,6 +474,9 @@ Block.prototype.move = function(dir){
this
.
actions
--
;
if
(
this
.
isOpen
(
dir
))
{
dir
=
parseInt
(
dir
);
if
(
dir
==
NaN
){
return
;
}
dir
=
this
.
untransformDir
(
dir
);
newx
=
this
.
x
+
Block
.
dx
(
dir
);
newy
=
this
.
y
+
Block
.
dy
(
dir
);
...
...
@@ -489,6 +492,9 @@ Block.prototype.attack = function(dir) {
}
this
.
actions
--
;
dir
=
parseInt
(
dir
);
if
(
dir
==
NaN
){
return
;
}
dir
=
this
.
untransformDir
(
dir
);
attackx
=
this
.
x
+
Block
.
dx
(
dir
);
attacky
=
this
.
y
+
Block
.
dy
(
dir
);
...
...
@@ -507,6 +513,9 @@ Block.prototype.sendMessage = function(dir){
//console.log("sendMessage");
//console.log(dir);
dir
=
parseInt
(
dir
);
if
(
dir
==
NaN
){
return
;
}
dir
=
this
.
untransformDir
(
dir
);
messagex
=
this
.
x
+
Block
.
dx
(
dir
);
messagey
=
this
.
y
+
Block
.
dy
(
dir
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment