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. | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 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.

20th Dec 2016, 2:31 PM
Cody Arthur
Cody Arthur - avatar
5 Antworten
+ 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)
20th Dec 2016, 2:38 PM
Valen.H. ~
Valen.H. ~ - avatar
+ 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
20th Dec 2016, 3:09 PM
Rishi Anand
Rishi Anand - avatar
+ 3
codeacdemy/example_codes or just google example codes
21st Dec 2016, 12:44 AM
smartguy100
smartguy100 - avatar
+ 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.
21st Dec 2016, 9:25 AM
Thomas Stone
Thomas Stone - avatar
18th Apr 2020, 1:38 PM
Harshit Sharma
Harshit Sharma - avatar