Click here to Skip to main content
15,879,474 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I am doing a game, the idea is to collect numbers if you collect 3 you get points if you collect 4 you lose points. The numbers are falling down so I need to collect them by using a character at the button, I know about collision detection but that is not enough as it cannot recognize numbers just the overlapping. Is there a way (function) to recognize numbers on a canvas?

All the best,

Marco
Posted

1 solution

From your question, I cannot see any need in "recognition" of anything. If you "drop" numbers in your code, you know what are they. So, from this point of view, the problem looks quite trivial: you define a set of number objects each holding the number, current location and other geometric parameters you need to have. Everything else is the matter of the design of your code. Your design. :-)

—SA
 
Share this answer
 
Comments
Maciej Los 22-Dec-14 13:54pm    
+5
Sergey Alexandrovich Kryukov 22-Dec-14 14:05pm    
Thank you, Maciej.
—SA
Marco Pierre Fernández Burgos 22-Dec-14 14:58pm    
Sorry, I am a beginner, I have just read a book about HTML5 and javascript, my question was not explain fine. Now I got it.
Sergey Alexandrovich Kryukov 22-Dec-14 15:02pm    
Great. You are very welcome.
Good luck, call again.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900