« first day (1767 days earlier)      last day (3406 days later) » 

00:14
Politics in Canada be like..
This is great ^
@Loktar what terminal emulator do you use for windows again?
nvm, forgot I already had terminator on this pc
figured if i needed one I'd try a new one
00:31
hardly relevant here, but it is coded in js, and not getting much of a response so
0
Q: How can I implement lights & shadows in a multi-layer 2d tilemap?

Danie ClawsonI am in the process of writing an isometric game from scratch, and I'd like to know how/if I can add lights and shadows. The code I have so far can be found here, but it should be enough to know that right now, the maps are simple 3d arrays of true/false values. Here is a shot of the environment...

> not getting much of a response so
> asked 42 mins ago
:P I wonder why
lol
all im sayin is an upvote'd be cool :P
I don't know enough about gamedev.se to know if that is even a good question there
sorry
00:33
s'cool. I guess it must be poorly written or something but idk enough to tell either
01:24
@rlemon cmdr
Good morning.
@DanieClawson FWIW, I don't know of any isometric game that has realistic shadows. It's not a simple task, and probably outside the scope of one SE question.
fair enough
As for my personal opinion, I feel realistic shadows would detract from the simple and beautiful art style that is isometric graphics.
well that is an interesting point
01:28
They can be very pretty in some.
is it 3d rendered with an isometric view?
I don't know what look you're going for, but it might be worth using a 3D engine instead of sprites and tiles.
but thats still blob shadows
or just 2d layers?
@Luggage its 2d layers
01:30
the 'realistic' shadows might be harder..
im imagining something like this (just in isometric obvs)
Could always mix it, your terrain/land what have you is 3d (voxel, ect.), characters, ect. are sprites
@DanieClawson pixel art style as well?
@Loktar yeah i am considering that
@KendallFrey vector graphics style
01:32
Besides the chatting room we are in here, are there any other tools you use to communicate with each other in the form of a group?
but I did shading with that
was fun, but not realistic for realtime shadows
@DanieClawson MM, then you probably want to use a 3D lib
also generated a voxel map from it, just baked the shadows onto it
@ZhengquanBai We do Hangouts sometimes
and snuggle parties.
01:33
@Loktar nice
even bastion didn't worry about shadows much
@KendallFrey I'm far away, can't reach you.
@ZhengquanBai Don't worry, Hangouts has infinite reach
lol
In China, we use QQ group to chat together.
01:34
@Loktar wow, good point. I always picture shadows when i think of that game but yeah theyre just little blobs :P
@DanieClawson haha yeah same here actually
was trying to find an example with good realtime shadows (thats not actually 3d)
closest thing I can find is Diablo 2, but those are even lack luster
topdown games are easier to make shadows for, no 3D required
^ No shadows.
@Luggage lol
01:38
zaxxon had them though! :p
one of my favorite Colecovision games
i suppose i could still do some lighting + blob shadows without complicating things too much
per-block lights maybe
@DanieClawson Ok.
10 messages moved to JS trash
Im just going to move this before it gets ugly or anything :p
01:43
good thinking
wise move
<patronizes Loktar>
wondering if i should just remove my gamedev question...
No, it's Ok to be there because it's related to programming.
Yeah but as others said its kind of too vague a question
im honestly surprised it wasnt locked
will i lose rep if it does end up being deemed too vague?
01:50
OK, back to the JS topic. Yesterday, I was wondering if there is any method to retrieve the widths of borders of an element using JavaScript.
yes
window.getComputedStyle(node).borderWidth;
@rlemon If a border is set to "thick", what does this method return? "thick" or corresponding pixel?
I want the width to be given in pixels no mattar how it was specified in the CSS
why do you need that level of precision?
That's a little bit long story to tell. But just accept the fact that there is a need of that.
After searching the stackoverflow,
getComputedStyle(document.getElementById('myDiv'),null).getPropertyValue('border-left-width')
seems to work.
yeah it always gives pixels
01:55
Here is a link for ya to try with: jsbin.com/hefecasaza/edit?html,css,js,output
i was surprised to see getComputedStyle's browser support was so good
ie9 n all :P
02:09
I have been reading JavaScript: The Definite Guide. This book is overall awesome, even though there are several errors in it.
I have a question about the mouse event section.
oh boy mouse events :P whats your question
There is such statements in that section:
It is important to note that the mousemove and mouseup handlers are registered as capturing event handlers. This is because the user may move the mouse faster than the document element can follow it, and if that happens, some of the mousemove events occur outside the original target element. Without capturing, those events will not be dispatched to the correct handlers.
right
and so what is your question about that?
I don't think that is the reason why we should register mousemove and mouseup handlers as capturing event handlers. I think that is the reason why we should register mousemove and mouseup handlers on the outermost containing element such as document because thoes events don't have to be invoked in the capturing phase, they can also be invoked in the bubbling phase.
i'd tend to agree with you there, thats the way i've done it in the past
02:17
:P
@ZhengquanBai from my experience, simply setting useCapture to true doesn't always help. If you're building a draggable or something, its really easy to drag outside of the element's bounds and just that alone doesn't solve it
02:49
Yes. When the mouse is outside of the dragging target, it's still inside of the containing element. So the containing element should be where to register the mousemove event so it can handle the event. Whether mousemove is handled in the capturing phase doesn't matter that much. JavaScript is the first pramming language where I am exposed to the concept of event capturing. I don't know if I've got it right.
03:24
@DanieClawson insertAdjacentHTML is even better, ever since IE 4. Don't know why so few developer use it.
03:51
Sheep is a nice animal
04:20
Yes. We even eat TNT to help clean up the world.
04:38
Speaking of TNT, a really intensified bomb occurred in China serveral days ago.
04:55
@Sheepy wow, that's great. Can't believe I havent seen that before. Blame jquery I guess
@ZhengquanBai It's a chemical warehouse. That is not certified to store 700+ tons volatile chemicals. That is close to many houses and a supercomputer complex. The computing room's door(s?) literally blew inside from the blast.
Next time they talk on Slashdot about how China has the fastest supercomputer, we can comment that China also build the supercomputers closest to volatile chemical warehouses.
05:16
Sheep are awesome. Ask any welshman.
Say if I want to drag some element, is it the prerequisite that the element is absolutely positioned?
I think you may want it fixed while dragging. Absolute is relative to the nearest positioned element.
@rlemon you might like deathtrap apparently its a revamped more in depth vs of the tower defense leves from Van Helsing
I friggin love this game
if you like tower defense games + diablo type games its a great buy imo.
also its MP coop and VS
bleh crap sales over for it, I got it for $10, its worth $20 but I guess id wait.
@Sheepy It's OK to drag and move an abosolutely positioned element. JavaScript:The Definite Guide includes an example of that.
user2620028
05:34
@loktar have you tried playing oGame ever? Its an RTS meant to be played 24x7
guys, using if condition most of the times is good ????, what i mean is i use if else most of the time, i feel like i can acheive this task my using predefined functions or something, anyway i know that depends on my task,but still using if else conditions makes me feel like I'm no professional developer :(
@ZhengquanBai If you want you can get it work with relative too. Saves the trouble of creating a placeholder, even. My point is it doesn't have to be absolute, but it is ultimately your code.
Yeah, I got it.
@Simply If is not bad. It is a cornerstone of imperative languages. When you If the same things many times it is bad, but the bad part is the repetitive, the duplication of logic, not the if statements.
If you have lots of ifs in a function, you should split it into smaller, easier to manage parts. How many if is too much depends on your... style.
@ZhengquanBai
05:51
hmmm thanks @Sheepy
foo && (alert("foo is true")) || alert("foo is false");
// this alerting both foo is true and foo is false
my foo variable is true, it must only alert foo is true, buy y alering foo is false too ?
Actually it would throw an error
how ?
Oh wait my bad
@Simply Your code is the same as true && (alert("foo is true")) || alert("foo is false");
coffeetime, didn't spot the closing parens after the first alert
05:54
That's because the return value of alert("foo is true") is false!
what rly alert returns something ?? o.O
The result of && is false, that is the left part of ||, which trigger the evaluation of the right part of ||
@Simply alert does not return anything, thus it evaluates to false. foo && false is false.
alert is a statement. So I does have a return value.
alert is a function, whose return value is undefined.
Occasionally this is a convenience style. But if you are confusing yourself, you may be pushing it too far.
05:56
If a function doesn't return anything, it returns undefined.
hmmm i got it, but little confusion, i thought i can replace this with if else statements
easy one line statement but :\
@ZhengquanBai Well, alert is not by itself a statement. And statement does not have "return value".
@Sheepy Okay, my fault.
Don't sweat. I have made much, much more fault in this room :p
No, I won't. Thank you.
06:02
true && /*what ever the functions or statements must return the true here ??*/ || alert("foo is false");
Instead of saying "return true", it's more accurate to say "evaluate to true"
because 3*2 does not return anything, but evaluates to 6.
i got it ....
var foo = true;
        var name = "";
        foo && (name = "Annie") || (name = "Dark Child");
        alert(name);
@Simply Are you a native English speaker
i got name == annie
Yes. That's because the right part of || does not evalute anymore.
Because (name = "Annie") evaluates and gets converted to true.
06:06
No, I'm pretty poor in english
I'm not a native English speaker. I am a Chinese.
hmmm, why did you ask me ?
user3119231
morning you native js speaker
It's afternoon here in China
can i have something like this ?
var foo = 3;
        var name = "";
        foo == 3 && (name = "Annie") || (name = "Dark Child");
       // not possible right ??
oh, i live in India, here it is 11:35 AM
06:10
India time is 2.5 hours slower than China.
11:40 now
@ZhengquanBai behind not slower
in react is it possible to use contextTypes without getChildContext and childContextTypes ?
@Abhishrek Thank you. I got it.
user3119231
	(function(){
		var command = document.getElementById("console");
		command.value = "";
		var code = "";

		command.addEventListener("input", function(){
			code += this.value + "❚";
		});
	})()
user3119231
06:11
anyone an idea why this doesn't work? (I mean the square isnt visible behind the text
I'm afraid of getting married.
Then don't :)
@ZhengquanBai Oh. I mean, a statement does not evaluate to any value. If it evaluates to a value, it would be an expression.
@Sheepy Yes. I got your meaning. And it is only an expression that can be present in && or ||, not a statement.
@ZhengquanBai LOL, dont marry then
foo == 3 && /*here we'll be having only 1 statement cant keep multiple lines of statements */ || (name = "Dark Child");
06:19
I don't know if it's common not gettting married in other countries. But in China, your parents usually urge you to get married when you are old enough.
It's always hard for gay people whatever country we are in.
that happens in almost all the countries
@ZhengquanBai My parents would probably like me to get married but I'm not going to do something like that if I don't want to. It wouldn't be fair to the other person.
@ZhengquanBai Don't fear. China's divorce rate is only 27%! :D
If they wanted grandchildren they should have increased their odds a bit by having more than one child themselves
guys what are scala, ruby on rails ?? i head of them many times, but I've no idea for what they are used ?
06:23
Scala is a language that compiles to Java bytecode. Ruby on Rails is a MVC framework.
我也不知道。呵呵。
user3119231
lol
user3119231
		command = document.getElementById("console");
		code = "";

		command.addEventListener("input", function(){
			code = command.value + this.value;
			command.value = code + "❚"
		});
we know we have ternaries --> foo ? bar() : quux();
then y --> ( foo && bar() ) || quux();
any difference between these two ?
oh thanks @iv
@ZhengquanBai you will be anxious first, then all fears will go away except for her.
06:27
@Abhishrek except for whom?
the one you get married to.
@ZhengquanBai Depends on what qualifies as common. In Hong Kong a third of adult male is unmarried. Does that count as common?
bride
I can't marry a woman. How aweful it is that I have to have sex with a woman!
:\ are you ???
06:29
@HatterisMad glad to hear your Thai friend is ok
@Simply you bet.
user2620028
@taco yeah.... from what i heard there were three separate bombs but only one of them blew
user2620028
Actually sorry two of them blew up and one disarmed
Know who is responsible for the bombing?
Terrorists ?
06:31
f***ing terrorists here in India also one bomb blasted
user2620028
Uhh well the government here just likes to blame the easiest and most likely sources first. So the muslim thai population is taking the blame initially for this one and then they might research past that later.
Well, he/she/they must be terrorists by definition. I mean which group.
@Sheepy By definition they should be erased from existence but darn it we lack the technology.
user2620028
There is a muslim population in southern thailand / northern malaysia and thailand has been in a civil war with this group for like 40 years... They will take the initial blame although they haven't previously targeted people in mass like this. They usually target empty public places to make a point.
I don't think technology can solve this problem sigh
06:34
when did this happen ?? @HatterisMad
user2620028
@simply which part? lol
south india
I see. Do they usually claim responsibility in the past?
@Sheepy when you can disintegrate these people, reading their thoughts -- sure it can.
yes technology can solve for eg: there is very very less chance to blast a bomb in USA, bcoz it is highly secured by technology
06:36
or london. where they can monitor every single person by software if they want to atleast on the road that is.
user2620028
@sheepy who knows lol the government filters everything published
Preventing, not solving. Workaround instead of bug fix, in programming term.
@Sheepy you propose a major war against these people ?
@HatterisMad Riiight. Like China. facepalm
Technically china doesn't filter
they completely change the truth.
06:38
@Simply Uhm, yet they had a bomb attack just 2 years ago, and mass shootings are practically common
@Abhishrek Wow. +5 Insightful!
@ivarni come to india ?
@Sheepy As per their maps half of India is them
And the whole south sea.
Erm they also have the naval power for that claim
user3119231
var value = command.value;
			value = value.substring(0, value.length - 1);
user3119231
06:40
this isn't removing the last character
I wish i was born in star trek like earth
user3119231
it is removing the first? :D
united, and stupidity gone
From what I heard from dad, not there yet. China navy don't have sufficient (and big enough) far sea vessels. Yet.
And building warships takes time. Long time.
You know what, several days ago, a chemical warehouse blasted in China. We still dont know the cause of the bomb.
06:43
use replace or splice
names = names.replace(/,\s*$/, "");
@Sheepy you kidding me ?
@Maurize value = value.substring(0, value.length - 2);
Their navy is much bigger in terms of submarines and ships than Indian
and thats disclosed figures
user3119231
@Simply nope & @ZhengquanBai of course - nope. :P
user3119231
Simply's does it nearly
06:45
@ZhengquanBai yes i heard of this, but it is not related to terrorists
user2620028
@ivarni Yes but in Thailand (which is smaller than Texas) we have a bomb blast every month at least?
names = names.replace(/,/*instead of comma keep what chared ted you what to delete here*/\s*$/, "");
user3119231
huh regex
@Abhishrek If you think only about India, sure. China's target is much higher.
@ZhengquanBai yes i head of this but it is no related to terrorists
@Maurize yes regex :P
06:49
@Sheepy I am next to china, unless i move to highers its mustn't be thought
America though must restart being america again -_-, as in the space race time america
user3119231
So this does not work. BUT I think it is up to input because if I simply use console this works well:
user3119231
		command = document.getElementById("console");
		command.oninput = function(){
			var value = command.value;
			console.log(value + "❚");
			return false;
		};
If China really have a large scale sea war with India, I fear that it won't be only India with China.
user3119231
If I try to change command.value there is a square behind every text
But let's talk about something happier. What do you like most in ES6?
06:51
@Sheepy And who will fight on our side ?
@Sheepy everything
Including class?
yes
Something is better than nothing. :-)
Impurist! We only need prototype! >.< (and super, yeah :p )
@Maurize did you try slice(0,-1)??
str.slice(0,-1)
we know we have ternaries --> foo ? bar() : quux();
then y --> ( foo && bar() ) || quux();
any difference between these two ?
user3119231
@Simply seems like it is slicing only the text.
06:58
@Maurize hmm i guess your last character is not a text
did you try toString() before slice
user3119231
this is the script by now.
whats your task ?
user3119231
To have this square behind anything which is the value
after user typed the value or on typing ?
user3119231
07:06
Hm, after typing is easier?
user3119231
Should be similiar to old consoles
try this
command = document.getElementById("console");
        command.onkeypress = function () {
            var value = command.value;
            command.value = value + "❚";
            alert(command.value);
            return false;
        };
no alert
user3119231
makes only squares
07:25
knock knock
user3119231
who's there
user3119231
@Simply must do it with input to prevent action from system keys
user3119231
so we're here: jsfiddle.net/7hfjuyxj/4
give me some time
user3119231
this is very tricky. Maybe it is because the input time of the event
07:37
-5
Q: What is lorem ipsum?

vksDont know if such sort of questions are entertained but does nebdy has an idea what lorem ipsum means? I have seen 100's of questions on this.Some removing,finding etc this text? Which language is this in ?

Asked by a 36k 37k user
I'd expect someone to know how to google by then... I guess that's more difficult than I thought
Seems deleted now
but who is this "nebdy"?
Heh, wat o.O
didn't notice that at first
try this
command = document.getElementById("console");
        command.onkeyup = function () {
            var value = command.value;
            var lastChar = value.substr(value.length - 1);
            if (value.length >= 2) {
                value = value.slice(0, -2);
                value = value + lastChar
            }
            command.value = value + "❚";
        };
working ?
user3119231
		command = document.getElementById("console");
		command.oninput = function(){
            var value = command.value;
            var lastChar = value.substr(value.length - 1);
            if (value.length >= 2) {
                value = value.slice(0, -2);
                value = value + lastChar
            }
            command.value = value + "❚";
		};
user3119231
yep this is fine :D
user3119231
07:48
onkeyup isn't good choice because system buttons and so on
hmmm ok :)
user3119231
very good very good.
user3119231
Did you try to click in the input and place cursor in text somewhere? :P
08:04
Hi I need suggestion
I have many independent js files
they all are compressed
will there be any enhancement if I do pack them all to one js file?
I mean by time and performance
@ssube not a stick, a spoon
user3119231
Not really. doesnt really matter if 4 small or 1 large gets loaded. the result is nearly the same
user3119231
But be aware of globals and stuff
user3119231
function names
I think the requests to server will become one, so there should be a fall in time.. right?
08:09
@Mr_Green yes. Doing a single request instead of 100 is much better.
user3119231
Thats what I just wanted to write
every time you do a request, you have to send all the http headers, and the server has to send back all the response headers
thanks florian. I was going to ping you :)
user3119231
If you request data once the performance is better than 100 times
user3119231
I've heard about that's better to load a script in body instead of head
08:12
a misconception though, is that you have to open a new connection for each request
If you can split out just the scripts needed for the initial rendering of the landing page then you can see better performance with doing 2 requests instead of 1
Especially on mobile where bandwidth might be less
that's false since HTTP/1.1 (i.e. 199*), since there is a keep-alive header to keep the connection open for some timeout (so that resources in the html page use the same connection)
Best thing ofc is to not require any javascript for initial render at all
@Maurize try to replace your cursor with "❚" on mouse enter
@FlorianMargaine if the code breaks in one place, loading of the code related to other files also stop if they are minified to one right?
08:14
@Mr_Green yes, so what? Do you ship broken code?
I came at the last moment to rescue them and I can see some errors in console.
then fix it
ok thanks
user3119231
@Simply maybe it would be easier to do css :after
user3119231
:after content
user3119231
08:17
but how to get the inner of the input?
08:40
@Maurize its better to replace your cusor
.custom {
   cursor: url(images/my-cursor.png), auto;
}
user3119231
yeah
I would like to discuss with you about something related to mouse drag.
To drag an element, the element being dragged must be repositioned as the mouse moves so that it follows the mouse.
@Maurize Putting <script>s at </body> will make sure dom is ready, script is loaded in order, script is pre-fetched, script does not block css/html, and saves the time of waiting for domready event, for all browsers.
Here is a question about how to reposition an element.
@Maurize its not working cursor option :\
08:48
Setting Object.style.left/top moves an element only if the element is positoned. If the element is static positioned, setting this attribute doesn't move the element.
take X,Y values bfore you drag
How to move an element if it is static positioned?
user3119231
@Simply sure. If we take .ico cursor which looks like and then add it on input focus it will :)
@ZhengquanBai 1. It is Element.style.left/top. 2. use margin-left/margin-top.
@Simply Yes. That's the prerequisite of dragging an element.
08:49
after you done with dragging, by using X,y position it again
@Sheepy Element.style.left/top won't work if the element is static positioned?
@ZhengquanBai marginLeft/Top. You can also use translateX/Y.
@Maurize oh you sure that works ? try and tell me if it works

« first day (1767 days earlier)      last day (3406 days later) »