DZone
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
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
The Latest "Software Integration: The Intersection of APIs, Microservices, and Cloud-Based Systems" Trend Report
Get the report
  1. DZone
  2. Data Engineering
  3. Data
  4. 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 · Interview
Like (0)
Save
Tweet
Share
4.55K 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

  • DZone's Article Submission Guidelines
  • The Path From APIs to Containers
  • How to Submit a Post to DZone
  • HTTP vs Messaging for Microservices Communications

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • 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: