Answer the question
In order to leave comments, you need to log in
c++.sfml functions do not see an array of another class. Where to look for a problem?
I created a project based on SFML lessons, at some point I deviated from the lessons, everything was written there in one file, but I split it into headers and cpp and then the problems started. There is a map class that has a string array, so I can’t access this array in the relationship function with the map in the player class.
map.h
#pragma once
#include <SFML\Graphics.hpp>
#include <iostream> // подключаем, чтобы посмотреть на время в консоли
#include <string>
using namespace sf;
//#include "pers.h"
class mapR
{
public:
Image map_image;//объект изображения для карты
Sprite s_map;//создаём спрайт для карты
Texture map;//текстура карты
static const int HEIGHT_MAP = 25; //размер карты высота
static const int WIDTH_MAP = 32; //размер карты ширина
std:: string TileMaps[HEIGHT_MAP] = {
"00000000000000000000000000000000",//1
"0 0",//2
"0 s f 0",//3
"0 f 0",//4
"0 0",//5
"0 h 0",//6
"0 0",//7
"0 0",//8
"0 h 0",//9
"0 f 0",//10
"0 0",//11
"0 f 0",//12
"0 0",//13
"0 s 0",//14
"0 0",//15
"0 h 0",//16
"0 0",//17
"0 f 0",//18
"0 s 0",//19
"0 0",//20
"0 0",//21
"0 f 0",//22
"0 0",//23
"0 0",//24
"00000000000000000000000000000000",//25
// 12345678901234567890123456789012
};//*/
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question