« first day (1469 days earlier)      last day (3462 days later) » 

12:01 PM
? da hell is happening
 
I have no idea what just happened
You created a fake move message and invited me to the trash can?
 
huh?
 
No idea
 
> Note: this uses the HTML5 canvas element and the JavaScript API for manipulating it. If you’re using some crappy old browser (in particular, Internet Explorer 8 or earlier), you won’t see much…
2
:-)
 
@Sippy helps a little
 
12:13 PM
@JanDvorak link pls?
 
haha nice
 
do you know how to make a point to point animation.
 
@argentum47 you mean keyframe animation?
it's fairly simple
you have to get two frames you're in between in a given time point and linearly interpolate between their values
for starters, at least.
 
i am trying to make this smooth transition jsfiddle.net/wkpo1j62/2
 
12:17 PM
jQuery.animate?
 
yeah, well i don't know if its suitable. i am not using canvas
 
@argentum47 I'd use css rotation for the arrow direction
 
looking
 
I've no idea how these border tricks are working :O
 
its a standard thing, its in the css-tricks.com
 
@argentum47 change the background to a gradient, or something natural.
 
@Florian But that’s not binary :P
 
p=[2*v&2|4*c&4,p[3]/2&1|v&2|2*c&4|4*p[0]&8,p[3]/4&1|v/2&2|c&4|2*p[0]&8,v/4&2|c/‌​2&4]
Rotate a tetris piece
x=new Date%7*4,p=[h=0,2908739>>x&15,266758006>>x&15]
Generate a random tetris piece
 
12:22 PM
lol
 
@copy I’m not sure whether I want to try to understand that.
 
but uh
why are those different ids
was that on css-tricks too
 
@neil: Yea, that guy was just sad...
 
no. each are different in the borders, i mean for the arrow pointing to left, border-right:...; for top, border-bottom: ... . so i put those styles in different id and subsittued them with jquery.attr
 
Also this @argentum47
 
12:24 PM
@Sippy: "Sluts?" lolwat? xD
 
@argentum47 yeah that's extremely weird
 
@Cerbrus I don't even
 
hai
 
yeah. i didnot know rotate :P
 
I'd just do it on canvas tbh
it would be easier than learning how to hack DOM into this
 
12:26 PM
The comment in question appears to have been removed
 
@Cerbrus I suggested he not come back. :D
 
Saw that :)
 
!!nudge 360
 
@towc Nudge #4 registered.
 
i tried to make a game once. but after some time i got totally confused with canvas. how to use the animateKeyFrames and grids and transform properly.
 
12:27 PM
you don't have to use all that
just establish basic stuff like "draw me a shape" and work from there
once you understand how all of that works you can move on to ready-made primitives
in WebGL you're not gonna have them anyway
 
I just use ImageData :3
 
ow.
but i still don't know how to make and fire bullets and take hits. i have ideas, i can''t just write them.
i always get stuck at this step
:(
 
I think I broke it
 
@argentum47 you lack proper abstraction
 
meaning
 
12:30 PM
@BartekBanachewicz ^ you do too
 
@Cerbrus haha
 
You need more of it
 
@KendallFrey is this supposed to be a joke?
@argentum47 you should build your logic on well-defined functions. Animating the player should be separate from the game logic of bullets.
 
conceptually the easiest way is to treat game state as immutable from the graphics perspective and just copy the necessary data to draw
there's a lot of approaches to rendering games and structuring such code, but if you degenerate it to the most basic example, it would be, more or less...
 
12:33 PM
Make the game state work like a classic state machine and have some drawState(newState) call each frame or something.
 
Player = { x: 0, y: 0; }
function movePlayer(p, dir) { switch(dir) { case "up": p.y -= 1 ...

function drawPlayer(p) { drawRect(p.x, p.y, playerSize ...
 
i see
 
so the main loop would simply be "while (1) { if (events) { processEvent -> movePlayer() } drawPlayer(); }
 
@poke @Cerbrus I made a horse.
 
Hwhwh
 
12:35 PM
ok
 
!!s/w/e/g
 
@Cerbrus Heheh (source)
 
where processEvent -> movePlayer would be var key = event.key; if (key = uparrow) movePlayer(p, up) in JS or something like that
 
@argentum47 - Tutorials, they're awesome: html5rocks.com/en/tutorials/canvas/notearsgame
 
almost every day for 3 years I'm wondering how and why my answer there still goes viral and has like ~5 upvotes/day for like 1000 days
653
A: Is there a standard function to check for null, undefined, or blank variables in JavaScript?

jAndyYou can just check if the variable has a truthy value or not. That means if( value ) { } will evaluate to true if value is not: null undefined NaN empty string ("") 0 false The above list represents all possible falsy values in ECMA-/Javascript. Find it in the specification at the ToBoolea...

 
12:35 PM
Dear god, I just realize something...
 
you explain
 
Hwhwhw
!!s/w/a/g
 
@Cerbrus Hahaha (source)
 
@Laniakea sigh
function update() {
  if (keydown.left) {
    player.x -= 2;
  }
 
That's horrible xD
 
12:36 PM
@jAndy Are you wondering it every day and posting it somewhere to have people look at it? ;P
 
@Cerbrus LOL #swagfag
 
@poke not really
 
@BartekBanachewicz Personally I'd go for an acceleration based model, but baby steps eh? :D
 
Hmm, worth it to ask :D
 
so things stay very loose coupled
 
12:37 PM
That tutorial is full of bad code.
 
> Because this is a No Tears guide we'll be using jQuery.
2
 
@Psychemaster point being reading data should be separate from logic :/
 
it wonders me just because of the fact that I gave so much .. "better" answers with much more knowledge and love in it
 
read input, process logic, draw
see in Haskell mixing logic with input is a compilation error :D
 
12:39 PM
@jAndy It’s always the answers to super basic questions that get upvoted most. Because lots of people will have the same “problem” and find it.
You can write super complicated and awesome answers to specific but incredibly interesting and challenging questions and you’re lucky if you get a two digit vote count.
 
I know, but in this special case, I mean its not really a problem after all more a general question about the language. Pretty wierd that so many people would search for that, in fact I would think its quiet unlikely many people face this "situation"
 
ok, gotta leave for a few hours. brb
 
> In order to simulate the appearance of smooth and continuous gameplay, we want to update the game and redraw the screen just faster than the human mind and eye can perceive.

-- sets FPS to 30...
 
whatever, it will stay a miracle to me
 
that tutorial is just plain bad
 
12:42 PM
@jAndy: You basically got 1/3rd of the rep I have, just from that one answer.
 
@NickDugger Those monsters!
 
and still ongoing
 
Reputation doesn't mean anything? That's news!
 
@NickDugger: What's bad about it?
 
Yea, the moment you get is, you realize it's not that big of a deal :P
 
12:43 PM
envier!
 
@Laniakea there's too many things to list. It's got bad code, bad content, etc.
 
I wouldn't mind a +500 answer, though. :P
 
@NickDugger: The content aside, what's bad about the code exactly?
 
Assuming that the human eye can't perceive FPS above 30 is the biggest dealbreaker. I hate that misconception.
 
all people with some brain know that rep doesn't mean shit (I mean that statement is pretty wrong really since no retard would ever get near to any high count), but still its not too bad in your CV for instance
 
12:45 PM
@Laniakea some of the ways that he accomplishes things could be done better else-wise.
 
having a high-rep account if you applicate somewhere, .. in my experience that helps a lot
at least .. head-hunters catch on me because of that very frequently
 
@jAndy Meh, you can do more sane things that look good on your CV
 
for instance ?
 
x86 emulator in js
 
Contribue to open source projects
 
12:46 PM
@Laniakea var canvasElement = $("<canvas width='" + CANVAS_WIDTH + "' height='" + CANVAS_HEIGHT + "'></canvas>"); is probably the stupidest line of code in the tutorial
 
thats not what any company / headhunter would ever look for
 
> give me a job, or i'll burn down your house.. with lemons!
 
why didn't it format that?
 
multi line
 
@NickDugger: Yikes, that's bad
 
12:47 PM
@jAndy *look for?
 
ninja update was there already
 
Right
 
var canvas = $('<canvas>').get(0);
$(canvas).prop('height', CANVAS_HEIGHT);
$(canvas).prop('width', CANVAS_WIDTH);
@NickDugger clearly, he wants this
 
but even if I agree that so rep doesn't mean a ton (I know enough people who seem clueless enough to me with 50k+ counts), it still shows to a company who looks for someone that there is somewhat knowledge available
 
12:48 PM
I mean really, 100k rep on so does mean something
 
True that, @jAndy
 
@jAndy yeah... it means you're a rep-whore
 
fun one
 
hard to believe that there is some zombie who is around the site for several years collecting that much rep, without any learning :P
 
12:49 PM
@jAndy Same if they see your code on github
 
@rlemon Virtually every connection that site makes to other sites is blocked by my workplace firewall lol
 
I just realized I out-rep @JanDvorak by 5k :D
 
it's easy to get 100K rep if you ask 6k questions
 
@jAndy it means you have 100k rep on SO
 
Time to get asking questions :D
 
12:51 PM
@rlemon even that needs to be some reasonable stuff, if you don't want to drive that count to 0 my downvoting
in fact, if I was a headhunter I would rather look into the questions a guy asked
 
@jAndy I personally don’t use my rep count for my CV, but the actual content of answers. I think SO answers are a great way to show how you are solving things.
 
> my crew is big and it keeps getting bigga, that's because Jesus Christ is my nigga
 
Blankman, blankville
38k 129 412 770
 
Oh, and the content of questions too. Those might be even more interesting.
 
another 4K questions and he should have 100k+ rep
 
12:53 PM
2k questions and 12 answers. hwhwhwhw.
 
lawl
 
but thats exactly what I said, looking into the quality of questions asked is much more interesting to get an idea of the "level" which the guy might be around
 
@rlemon 129 gold badges, holy…
 
12:54 PM
 
he's getting gold badges on dupes and closed questions
lame!
 
@rlemon his "tags" section looks lame though
 
Yeah, I am fully able to look at profiles myself ;P
 
> 1931 questions, 12 answers
waat!!!
 
!!wat
 
@NickDugger Oh shit. Please let it die :D
 
@poke sorry for helping?
 
;D
 
lol
declined
 
It’s actually sad how most of those questions would be closed immediately if they were asked today…
Not sure if “sad” is the right word.
 
12:58 PM
@NickDugger wow
 
@poke They'd be dupes, so yeah :)
 
@rlemon Old white people rapping about jesus. Just how I wanted to start off my friday
 
Not just dupes, but most simply don’t show any effort.
> I want to open a text file, append a single line to it, then close it.
 
I almost spit out my coffee when they started calling him "my nigga"
wasn't expected
 
I'm wondering that nobody posted the friday-song for at least one hour
 
Take the initiative
Shit, I wasn't fast enough.
 
thanks robert
 

« first day (1469 days earlier)      last day (3462 days later) »