Peter Web
Peter Web

Reputation: 359

Simple game development

I'm new to js and game development but i want to learn... For learning i'm creating some multyplayer game - make the bigger word.

so I have a letters that users stop on stop div and then trying to create a bigger letter than other.

Here is the whole code: http://jsfiddle.net/9rtFa/4/

What I need is when letters stop , when user stop it and when user click on some div with letters that letter to write into div "F" . and when click on button "x" to clear the last letter into div "f" ...How I can do that?

Upvotes: 0

Views: 225

Answers (1)

Ram
Ram

Reputation: 144659

try this:

$(".letter").click(function(){
   $("#F").text($("#F").text() + $(this).text())
   if( $("#F").text().length > 0) $(".letter").unbind("click");    
})

$('#b').click(function(){
   $("#F").text($("#F").text().slice(0, -1))
}) 

http://jsfiddle.net/9rtFa/11/

Upvotes: 1

Related Questions