Jump to content
Sign in to follow this  
absorr

Move And Bounce

Recommended Posts

JavaScript and the HTML canvas would work for that. Google has lots of tutorials on working with the canvas.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Javascript shouldn't cost you money.

Share this post


Link to post
Share on other sites
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( ... )	}}

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...