#Simplifying functions

8 messages · Page 1 of 1 (latest)

solemn lion
clever joltBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

shrewd berry
#

you could use classes/objects. If you have a player class, you could store the player's parameters (like current position and speed) as members of the class. You could also give it a reference to the world map, only once, and it will keep it as a class member. The movement function would then be a class method, and you don't have to send any parameters other than the direction (event).
Look up the basics of object oriented programming (not the complicated stuff, just the basics, how classes and members work)

solemn lion
shrewd berry
#

i don't know any specific sites, but any c++ tutorial should cover them

clever joltBOT
#
How to Learn C++ Programming

We generally recommend a good book to learn the necessary fundamentals:

To actually write and run C++ code, you will need a compiler, editor, and debugger. We strongly recommend to start out using an IDE, which will provide all these tools for you:

<:microsoft:1165512917047853127> Windows
  • [Visual Studio](#1165492293810257920 message)
  • CLion
<:tux:1165505626894520361> Linux
<:apple:1165508607798943754> Mac
Words of Advice

The wise programmer is told about the debugger and uses it.
The average programmer is told about the debugger and avoids it.
The foolish programmer is told about the debugger and laughs at it.

solemn lion
#

ty ig

#

!solved