+ 10
can someone please explain to me how moving objects are produced ? (example in games). must I use graphics.h?. how do I transform it from simply a compiled piece of code in code block to a real software?. I've been googling this for days now and I'm still confused. Please an extensive explanation would be appreciated🙏. Thanks. p. s you can also recommend websites where I can learn more and see good sample codes.
5 Réponses
+ 9
You need to use libraries to do that. For example if you want to make an Android game you must use the graphic libraries provided by the manufacturer/platform (find suitable on Google)
+ 3
Think, for a start how would you position an object in the window. By using coordinates. Now to move the object you need an instruction to change its coordinates like you desire. This is only the basic stuff.
Visit Scratch by MIT. You can make simple projects of moving objects
+ 3
codeacdemy/example_codes or just google example codes
+ 2
Normally, when you render some graphics (regardless of API) you can determine the coordinates of where that sprite is rendered in a window. To move sprites around you'd generally change these coordinate variables. Nowadays most programs make use of a third party library for graphics (graphics using platform libraries is not fun and is platform dependant). For C I would recommend using SDL. For C++ use SFML. Both are excellent, mature code bases that can be used for professional-grade 2D games.
+ 1
Bro u can use this :-
https://www.youtube.com/playlist?list=PLMclp-q8OPhnBqdI6DAIhsHX6RvVD5nha