absorr Posted November 10, 2011 Share Posted November 10, 2011 I want to replicate this game I made in Scratch onto my site. http://scratch.mit.edu/projects/absorr/1489987Would javascript work? Is there a better option that won't cost me money? If javascript would work, how do i make it so that the object can move and bounce off walls? Link to comment Share on other sites More sharing options...
ShadowMage Posted November 10, 2011 Share Posted November 10, 2011 JavaScript and the HTML canvas would work for that. Google has lots of tutorials on working with the canvas. Link to comment Share on other sites More sharing options...
Ingolme Posted November 10, 2011 Share Posted November 10, 2011 If you were able to make an object bounce in another language, Javascript shouldn't be any different, the concept is the same. Javascript is capable of making games, but if you want efficiency, you should try another language. Java and Flash are more efficient than Javascript. A lot of Java IDEs are free, I use NetBeans. You have to pay for a Flash editor. Link to comment Share on other sites More sharing options...
Synook Posted November 11, 2011 Share Posted November 11, 2011 Javascript shouldn't cost you money. Link to comment Share on other sites More sharing options...
JamesB Posted November 12, 2011 Share Posted November 12, 2011 how do i make it so that the object can move and bounce off walls? something like this should work: canvasWidth = 500canvasHeight = 500 function target() { this.x = 0 this.y = 0 this.moveX = 1 this.moveY = 1 this.checkEdgeHit = function() { if (this.x <= 1) // left this.moveX = 1 else if (this.x >= canvasWidth) // right this.moveX = -1 if (this.y <= 1) // top this.moveY = 1 else if (this.y >= canvasHeight) // bottom this.moveY = -1 } this.move = function() { this.checkEdgeHit() this.x += this.moveX this.y += this.moveY this.render() } this.render = function() { //context.arc( ... ) }} Link to comment Share on other sites More sharing options...
absorr Posted January 19, 2012 Author Share Posted January 19, 2012 Discovered a free AND EASY flash editor. StencylWorks Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.