Tag Archives: game

Interactive Physics Animations Javascript Canvas 17

canvas17

I’m really enjoying giving a control panel of sorts to the end user and letting them control the physics rules of their canvas. Let’s add more motion to it by applying a jitter to the velocity of each dot. This is similar to earlier, when we first started animating by applying a random number to [...]

Posted in interactive javascript canvas, tutorial | Also tagged , , , , , , , , , , , , , , , , , , | 1 Comment

Interactive Physics Animations Javascript Canvas 16

canvas16

I always want to give the end user (at least some) control of how they view and interact with data. Earlier we gave users control over gravity. Here let’s give them control over the canvas edges. Rather than having our dots bounce on the edges of the canvas, lets have them wrap across to the [...]

Posted in interactive javascript canvas, tutorial | Also tagged , , , , , , , , , , , , , , , , , , | Leave a comment

Interactive Physics Animations Javascript Canvas 15

canvas15

Earlier we worked on making all the dots draggable, but what’s better than simply dragging dots? Let’s set up a way to throw the dots! Now as we drag it we record the positions and use that to calculate a new velocity. Then when a dot is dropped, it will have a trajectory to follow [...]

Posted in interactive javascript canvas, tutorial | Also tagged , , , , , , , , , , , , , , , , , , | Leave a comment

Interactive Physics Animations Javascript Canvas 14

canvas14

Here is an update to allow the end user to create more dots. A good way to do that is to just let users click on the canvas, and if they click a dot, drag it, if they don’t click a dot, create a new dot at the point of click. I moved the dot [...]

Posted in interactive javascript canvas, tutorial | Also tagged , , , , , , , , , , , , , , , , , , | Leave a comment

Interactive Physics Animations Javascript Canvas 13

canvas13

Now that we have gravity we’re really seeing some natural looking movement. Yet, it’s still missing something. In the real world we have friction or drag (or even air resistance) on everything. Without this friction it’s like these balls are moving in space. Even when they bounce on the walls they don’t loose any velocity, [...]

Posted in interactive javascript canvas, tutorial | Also tagged , , , , , , , , , , , , , , , , , , | Leave a comment

Interactive Physics Animations Javascript Canvas 12

canvas12

Adding gravity! Here we’ve adjusting the y velocity in every frame with the force of gravity. It’s fun to play with options and see how they are affecting the animation and the physics, so I’ve also got a checkbox that will toggle gravity to either a vlaue of 2 or 0. interactive physics animations via [...]

Posted in interactive javascript canvas, tutorial | Also tagged , , , , , , , , , , , , , , , , , , | Leave a comment

Interactive Physics Animations Javascript Canvas 11

canvas11

Well, the last iteration was fun, but the animation went so quick. Now we’re going to do something to contain these dots in our canvas. Let’s have them bounce off the edges of the canvas. We’ll multiply the velocity by a bounce variable. This will reverse the direction the dot is going. We’ll have a [...]

Posted in interactive javascript canvas, tutorial | Also tagged , , , , , , , , , , , , , , , , , , | Leave a comment

Interactive Physics Animations Javascript Canvas 10

canvas10

Now that we have our framework for animation we can make things a bit more fluid. Let’s use a velocity to update the positions or coordinates of each dot rather than just throwing random numbers at them. We can then adjust the velocity or rate of movement and it will be a much more natural [...]

Posted in interactive javascript canvas, tutorial | Also tagged , , , , , , , , , , , , , , , , , , | Leave a comment

Interactive Physics Animations Javascript Canvas 09

canvas09

Here’s a quick and easy update. I tend to think of frames in animation and rarely do I think of milliseconds. I’m going to make a var called fps and it will be used to calculate our animation rate. interactive physics animations via javascript & canvas | 09. $(function () {     var canvas, [...]

Posted in interactive javascript canvas, tutorial | Also tagged , , , , , , , , , , , , , , , , , , | Leave a comment

Interactive Physics Animations Javascript Canvas 08

canvas08

Thus far, we’ve been doing lot of setup and it hasn’t been very visually exciting. Now we start the fun stuff! Adding motion! Before we just has a draw function, but now we’ll add a function that will control the animations and we’ll also need a way to execute code repeatedly over a period of [...]

Posted in interactive javascript canvas, tutorial | Also tagged , , , , , , , , , , , , , , , , , , | Leave a comment
  • Recent Posts

    pears-circlecube-com-welcome

    LESS and syntax highlighting for Pea.rs

    Pears is an open source WordPress theme by Dan Cederholm (simplebits), enabling people like us to get your own pattern library up and running quickly. Collect, test, and experiment with interface pattern pairings of CSS & HTML. I’ve customized pears. I’ve forked it, adding support for coding in LESS as well as code highlighting! The [...]

    2012-02-10-19-27_IMAG0181

    An Event Apart Atlanta 2012 Notes

    Here is my collection of notes from attending An Event Apart Atlanta 2012. As I took notes, I had the thought that I’d be sharing them with co-workers and that it’d be easiest to just publish them here. I hope they are useful to someone else out there who didn’t take notes on something or [...]

    Developing for old browsers is (almost) a thing of the past – (37signals)

    Basecamp announces that it’s new version will not support old browsers! They will of course continue to support them in their “classic” version. But this is good news and as more implement this type of policy the internet will be happy. It used to be one of the biggest pains of web development. Juggling different [...]

    Screen shot 2012-02-10 at 12.59.33 PM

    Vendor Prefixes – about to go south

    What are “standards” coming to? Who’s guilty? Apple and Chrome: They’re supporting vendor prefixed properties like they’re a standard part of development. Firefox, Opera and Internet Explorer: They should have been on the ball more. Need to push their evangelism further. Teach developers that it’s not exclusively -webkit to style elements. All the browsers: experimental [...]

    bio

    An Event Apart Notes: Ethan Marcotte, Responsive Web Design

    Ethan Marcotte has become the father of Responsive Web Design and spent this whole day focused on principles, techniques, gotchas, examples, … all about building and how to build responsive sites. With a sprinkle of mobile first. For Ethan, it all started with this article: http://www.alistapart.com/articles/dao/ Think of architecture, the whole design phase is established [...]

    Webcomm_Montreal

    An Event Apart Notes: Jared Spool, The Curious Properties of Intuitive Web Pages

    Senseless waste of asterisks… Avis used an asterisk to denote optional fields. This means that there is a lot of baggage that comes with an asterixk. Somewhere this symbol got meaning, it’s not in the bible! We can control when something goes from unintuitive to intuitive. A design is intuitive (although technically and grammatically speaking [...]

    untitled-158-2

    An Event Apart Notes: Marco Arment, Bridging the App Gap

    The iPhone changed our industry in 2007: first mobile to have a desktop class web browser and it made people start using their mobile phones as computers! All apps other than apple provided ones were web browser apps. Most of the first apps were branded web browsers. No real difference between using mobile site or [...]

    lukew_space

    An Event Apart Notes: Luke Wroblewski, Mobile to the Future

    MASS MEDIA (in waves) Print, Recordings, Cinema, Radio, Television, Internet, Mobile Mobile is the new Mass Media It certainly is mass and massive. More mobile devices (by far) every day than babies born on the planet. Mobile devices are eating into our personal computing shares. New waves of mobile media eat all previous media waves. [...]

    IMG_4500

    An Event Apart Notes: Josh Clark, Buttons are a Hack

    Mobile and touch should be revolutionizing design and user experience. We don’t want to touch a tiny link or button. Back button is just stupid. Fitz’s Law, make things fat proximal targets for easy touching. People are lazy, let’s as designers LET people be lazy! Maybe even use the whole screen as your control. Eliminate [...]

    nicole_pink_bkg_2012

    An Event Apart Notes: Nicole Sullivan, Our Best Practices are Killing Us

    Grep to for analyze css. CSS duplication is a web-wide problem. Started helping facebook optimize thier site and they had 1.9MB of css loading. The same color showing up hundreds of times. Many many color statements and declarations. !important declarations get dangerous. Sites found to have over 500 !important declarations! float is a serious problem [...]

  • Recent Comments

    Evan Mullins

    Evan Mullins

    @Mikael – I believe this would do it. It just fired the toggle event on the...
    Mikael

    Mikael

    Hey great post!! can i by any chance make the toggle function start as hidden? So when i reload...
    Ori

    Ori

    you saved me man :) !!!! thank you
    me-gamer

    me-gamer

    this is really nice. this made many of my task simple.
    Lori Newman

    Lori Newman

    Just wanted to thank you for your presentation. It was extremely informative and just what I...
    Karl

    Karl

    I have been using for some time this nice Banner, from developer FX. They have a really nice Live...