DZone
Web Dev Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Web Dev Zone > Flying Through Paths: MissileGame in SVG..But No curveto Explosions Yet?

Flying Through Paths: MissileGame in SVG..But No curveto Explosions Yet?

John Esposito user avatar by
John Esposito
·
Feb. 22, 12 · Web Dev Zone · Interview
Like (0)
Save
Tweet
4.40K Views

Join the DZone community and get the full member experience.

Join For Free

Way back in 2004, Damien Clarke wrote the missile game 3d in Flash -- a follow-up to two other Flash games (written by his cousin) and a fun time-sink, with simple mouse control, that roughly simulates Lando's spectacular run in the second Death Star.

It's basically a geometry-heavy collision-detection game, and just as enjoyable as it sounds.

Now Ben Mather has shown his post-Flash mettle and recreated the game in SVG, taking full advantage of Kevin Lindsey's popular 2D geometry JavaScript library for SVG:

 

KevLinDev's library worries about intersections, projection and reflection, polygon definition, 2d point and vector routines, color picking, bezier morphing, mouse tracking, and loads of other game-geometry and game-GUI problems. And it's a great library for any SVG game development.

But Ben's MissileGame port really shows off the game library's power, and boasts some really nice, complex SVG of its own.

..including some code tantalizingly marked 'EXPLOSION!!!!' but is completely commented out..!:

<!--== EXPLOSION!!!! ========================================================-->
<!--    <path id="explosion"-->
<!--       transform="scale(2,2)"-->
<!--       fill="#f5bd3c"-->
<!--       stroke="#ff2626"       -->
<!--       stroke-width="0.5"-->
<!--       d="m -0.63488,-4.3752-->
<!--          c  0.24879,1.233, 1.1883,2.6366, 1.768,0.69037-->
<!--             0.74264,0.71431, 1.2069,0.6277, 1.6362,-0.5115-->
<!--            -0.034821,1.0871, 0.096633,1.6827, 0.74401,1.7541-->
<!--            -0.091757,1.4249, 0.70746,2.0783, 1.2188,1.8749-->

..plus lots more path curveto commands. (Is there an SVG explosion path generator, btw? I assume he didn't hand-tune all those x-and-y's...)

So try the game itself, first, and then look at the svg source, which points you to all the game-logic JavaScript.

And maybe see what happens if you de-comment the explosions transformation..!

JavaScript library SVG Collision detection IT Advantage (cryptography) Data structure Command (computing)

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Building a QR Code Generator with Azure Functions
  • 5 Ways to Optimize Your CQL Queries for Performance
  • Pub/Sub Design Pattern in .NET Distributed Cache
  • How Does the Internet Speed Test Work?

Comments

Web Dev Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo