2022-11-02 07:41:58 +01:00
|
|
|
|
using System;
|
2022-11-01 18:07:06 +01:00
|
|
|
|
using System.Collections;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using UnityEngine;
|
2022-11-02 11:15:11 +01:00
|
|
|
|
using Unity.Mathematics;
|
2022-11-12 12:18:08 +01:00
|
|
|
|
using TMPro;
|
2022-11-01 18:07:06 +01:00
|
|
|
|
|
2022-11-02 17:24:55 +01:00
|
|
|
|
|
2022-11-12 12:18:08 +01:00
|
|
|
|
public class movement : MonoBehaviour {
|
2022-11-01 18:07:06 +01:00
|
|
|
|
public Camera THE_Camera;
|
2022-11-12 12:18:08 +01:00
|
|
|
|
public GameObject player;
|
2022-11-01 18:07:06 +01:00
|
|
|
|
|
|
|
|
|
|
public GameObject oneone;
|
2022-11-02 07:41:58 +01:00
|
|
|
|
public Collider2D oneone_Collider;
|
2022-11-11 13:42:40 +01:00
|
|
|
|
public GameObject eromulepes1;
|
|
|
|
|
|
public GameObject eromulepes2;
|
2022-11-02 07:41:58 +01:00
|
|
|
|
|
2022-11-01 18:07:06 +01:00
|
|
|
|
public GameObject twoone;
|
2022-11-02 07:41:58 +01:00
|
|
|
|
public Collider2D twoone_Collider;
|
2022-11-11 13:42:40 +01:00
|
|
|
|
public GameObject feketepiaclepes1;
|
|
|
|
|
|
public GameObject feketepiaclepes2;
|
2022-11-02 07:41:58 +01:00
|
|
|
|
|
2022-11-01 18:07:06 +01:00
|
|
|
|
public GameObject threeone;
|
2022-11-02 07:41:58 +01:00
|
|
|
|
public Collider2D threeone_Collider;
|
2022-11-11 13:42:40 +01:00
|
|
|
|
public GameObject metrolepes1;
|
|
|
|
|
|
public GameObject metrolepes2;
|
2022-11-02 07:41:58 +01:00
|
|
|
|
|
2022-11-01 18:07:06 +01:00
|
|
|
|
public GameObject onetwo;
|
2022-11-02 07:41:58 +01:00
|
|
|
|
public Collider2D onetwo_Collider;
|
2022-11-11 13:42:40 +01:00
|
|
|
|
public GameObject szervereklepes1;
|
|
|
|
|
|
public GameObject szervereklepes2;
|
2022-11-02 07:41:58 +01:00
|
|
|
|
|
2022-11-01 18:07:06 +01:00
|
|
|
|
public GameObject twotwo;
|
2022-11-02 07:41:58 +01:00
|
|
|
|
public Collider2D twotwo_Collider;
|
2022-11-11 13:42:40 +01:00
|
|
|
|
public GameObject kingcasinolepes1;
|
|
|
|
|
|
public GameObject kingcasinolepes2;
|
2022-11-02 07:41:58 +01:00
|
|
|
|
|
2022-11-01 18:07:06 +01:00
|
|
|
|
public GameObject threetwo;
|
2022-11-02 07:41:58 +01:00
|
|
|
|
public Collider2D threetwo_Collider;
|
2022-11-11 13:42:40 +01:00
|
|
|
|
public GameObject feltoltolepes1;
|
|
|
|
|
|
public GameObject feltoltolepes2;
|
2022-11-02 07:41:58 +01:00
|
|
|
|
|
2022-11-01 18:07:06 +01:00
|
|
|
|
public GameObject onethree;
|
2022-11-02 07:41:58 +01:00
|
|
|
|
public Collider2D onethree_Collider;
|
2022-11-11 13:42:40 +01:00
|
|
|
|
public GameObject kutatolaborlepes1;
|
|
|
|
|
|
public GameObject kutatolaborlepes2;
|
2022-11-02 07:41:58 +01:00
|
|
|
|
|
2022-11-01 18:07:06 +01:00
|
|
|
|
public GameObject twothree;
|
2022-11-02 07:41:58 +01:00
|
|
|
|
public Collider2D twothree_Collider;
|
2022-11-11 13:42:40 +01:00
|
|
|
|
public GameObject kriptoklublepes1;
|
|
|
|
|
|
public GameObject kriptoklublepes2;
|
2022-11-02 07:41:58 +01:00
|
|
|
|
|
2022-11-01 18:07:06 +01:00
|
|
|
|
public GameObject threethree;
|
2022-11-02 07:41:58 +01:00
|
|
|
|
public Collider2D threethree_Collider;
|
2022-11-11 13:42:40 +01:00
|
|
|
|
public GameObject cyberplazalepes1;
|
|
|
|
|
|
public GameObject cyberplazalepes2;
|
2022-11-02 07:41:58 +01:00
|
|
|
|
|
2022-11-01 18:07:06 +01:00
|
|
|
|
public GameObject onefour;
|
2022-11-02 07:41:58 +01:00
|
|
|
|
public Collider2D onefour_Collider;
|
2022-11-11 13:42:40 +01:00
|
|
|
|
public GameObject hadiuzemlepes1;
|
|
|
|
|
|
public GameObject hadiuzemlepes2;
|
2022-11-02 07:41:58 +01:00
|
|
|
|
|
2022-11-01 18:07:06 +01:00
|
|
|
|
public GameObject twofour;
|
2022-11-02 07:41:58 +01:00
|
|
|
|
public Collider2D twofour_Collider;
|
2022-11-11 13:42:40 +01:00
|
|
|
|
public GameObject konyvtarlepes1;
|
|
|
|
|
|
public GameObject konyvtarlepes2;
|
2022-11-02 07:41:58 +01:00
|
|
|
|
|
2022-11-01 18:07:06 +01:00
|
|
|
|
public GameObject threefour;
|
2022-11-02 07:41:58 +01:00
|
|
|
|
public Collider2D threefour_Collider;
|
2022-11-11 13:42:40 +01:00
|
|
|
|
public GameObject korhazlepes1;
|
2022-11-22 14:45:32 +01:00
|
|
|
|
public GameObject korhazlepes2;
|
2022-11-12 12:18:08 +01:00
|
|
|
|
|
|
|
|
|
|
private Akciopont ap;
|
|
|
|
|
|
|
|
|
|
|
|
private int oneonecount = 0;
|
|
|
|
|
|
private int twoonecount = 0;
|
|
|
|
|
|
private int threeonecount = 0;
|
|
|
|
|
|
private int onetwocount = 0;
|
|
|
|
|
|
private int twotwocount = 0;
|
|
|
|
|
|
private int threetwocount = 0;
|
|
|
|
|
|
private int onethreecount = 0;
|
|
|
|
|
|
private int twothreecount = 0;
|
|
|
|
|
|
private int threethreecount = 0;
|
|
|
|
|
|
private int onefourcount = 0;
|
|
|
|
|
|
private int twofourcount = 0;
|
|
|
|
|
|
private int threefourcount = 0;
|
2022-11-12 17:48:50 +01:00
|
|
|
|
|
2022-11-12 12:18:08 +01:00
|
|
|
|
private int w = 3; //ennyi oszlop van a mapon
|
|
|
|
|
|
private int h = 4; //ennyi sor van a mapon
|
2022-11-12 17:48:50 +01:00
|
|
|
|
|
2022-11-16 11:23:25 +01:00
|
|
|
|
public int jelenlegi_x = 1;
|
|
|
|
|
|
public int jelenlegi_y = 1;
|
2022-11-12 12:18:08 +01:00
|
|
|
|
private int tavolsag = 0;
|
|
|
|
|
|
private int moveCounter = 1;
|
|
|
|
|
|
|
|
|
|
|
|
private string[,] helyek =
|
2022-11-01 18:07:06 +01:00
|
|
|
|
{
|
2022-11-02 17:24:55 +01:00
|
|
|
|
{"oneone", "twoone", "threeone", "" },
|
|
|
|
|
|
{"onetwo", "twotwo", "threetwo", "" },
|
|
|
|
|
|
{"onethree", "twothree", "threethree", "" },
|
|
|
|
|
|
{"onefour", "twofour", "threefour", "" },
|
|
|
|
|
|
{"", "", "", "" }
|
2022-11-22 14:45:32 +01:00
|
|
|
|
};
|
2022-11-02 11:15:11 +01:00
|
|
|
|
|
2022-11-02 17:24:55 +01:00
|
|
|
|
void Start() {
|
2022-11-22 14:45:32 +01:00
|
|
|
|
ap = FindObjectOfType<Akciopont>();
|
2022-11-11 13:42:40 +01:00
|
|
|
|
|
|
|
|
|
|
eromulepes1.SetActive(false);
|
|
|
|
|
|
eromulepes2.SetActive(false);
|
|
|
|
|
|
|
|
|
|
|
|
feketepiaclepes1.SetActive(false);
|
|
|
|
|
|
feketepiaclepes2.SetActive(false);
|
|
|
|
|
|
|
|
|
|
|
|
metrolepes1.SetActive(false);
|
|
|
|
|
|
metrolepes2.SetActive(false);
|
|
|
|
|
|
|
|
|
|
|
|
szervereklepes1.SetActive(false);
|
|
|
|
|
|
szervereklepes2.SetActive(false);
|
|
|
|
|
|
|
|
|
|
|
|
kingcasinolepes1.SetActive(false);
|
|
|
|
|
|
kingcasinolepes2.SetActive(false);
|
|
|
|
|
|
|
|
|
|
|
|
feltoltolepes1.SetActive(false);
|
|
|
|
|
|
feltoltolepes2.SetActive(false);
|
|
|
|
|
|
|
|
|
|
|
|
kutatolaborlepes1.SetActive(false);
|
|
|
|
|
|
kutatolaborlepes2.SetActive(false);
|
|
|
|
|
|
|
|
|
|
|
|
kriptoklublepes1.SetActive(false);
|
|
|
|
|
|
kriptoklublepes2.SetActive(false);
|
|
|
|
|
|
|
|
|
|
|
|
cyberplazalepes1.SetActive(false);
|
|
|
|
|
|
cyberplazalepes2.SetActive(false);
|
|
|
|
|
|
|
|
|
|
|
|
hadiuzemlepes1.SetActive(false);
|
|
|
|
|
|
hadiuzemlepes2.SetActive(false);
|
|
|
|
|
|
|
|
|
|
|
|
konyvtarlepes1.SetActive(false);
|
|
|
|
|
|
konyvtarlepes2.SetActive(false);
|
|
|
|
|
|
|
|
|
|
|
|
korhazlepes1.SetActive(false);
|
|
|
|
|
|
korhazlepes2.SetActive(false);
|
2022-11-12 12:18:08 +01:00
|
|
|
|
|
|
|
|
|
|
kezdoHelyMeghatarzoas();
|
2022-11-01 18:07:06 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-11-04 13:05:20 +01:00
|
|
|
|
private void kezdoHelyMeghatarzoas() {
|
2022-11-22 14:45:32 +01:00
|
|
|
|
int random = UnityEngine.Random.Range(1, 12);
|
2022-11-12 12:18:08 +01:00
|
|
|
|
Debug.Log("Random a kezdohelyszinhez: " + random);
|
|
|
|
|
|
|
2022-11-22 14:45:32 +01:00
|
|
|
|
if (random == 1) {
|
2022-11-12 12:18:08 +01:00
|
|
|
|
player.transform.position = oneone.transform.position;
|
|
|
|
|
|
eromulepes1.SetActive(true);
|
|
|
|
|
|
eromulepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-13 14:44:21 +01:00
|
|
|
|
jelenlegi_x = 1;
|
|
|
|
|
|
jelenlegi_y = 1;
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else if (random == 2) {
|
2022-11-12 12:18:08 +01:00
|
|
|
|
player.transform.position = twoone.transform.position;
|
|
|
|
|
|
feketepiaclepes1.SetActive(true);
|
|
|
|
|
|
feketepiaclepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-13 14:44:21 +01:00
|
|
|
|
jelenlegi_x = 2;
|
|
|
|
|
|
jelenlegi_y = 1;
|
2022-11-12 12:18:08 +01:00
|
|
|
|
} else if (random == 3) {
|
|
|
|
|
|
player.transform.position = threeone.transform.position;
|
|
|
|
|
|
metrolepes1.SetActive(true);
|
|
|
|
|
|
metrolepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-13 14:44:21 +01:00
|
|
|
|
jelenlegi_x = 3;
|
|
|
|
|
|
jelenlegi_y = 1;
|
2022-11-12 12:18:08 +01:00
|
|
|
|
} else if (random == 4) {
|
|
|
|
|
|
player.transform.position = onetwo.transform.position;
|
|
|
|
|
|
szervereklepes1.SetActive(true);
|
|
|
|
|
|
szervereklepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-13 14:44:21 +01:00
|
|
|
|
jelenlegi_x = 1;
|
|
|
|
|
|
jelenlegi_y = 2;
|
2022-11-12 12:18:08 +01:00
|
|
|
|
} else if (random == 5) {
|
|
|
|
|
|
player.transform.position = twotwo.transform.position;
|
|
|
|
|
|
kingcasinolepes1.SetActive(true);
|
|
|
|
|
|
kingcasinolepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-13 14:44:21 +01:00
|
|
|
|
jelenlegi_x = 2;
|
|
|
|
|
|
jelenlegi_y = 2;
|
2022-11-12 12:18:08 +01:00
|
|
|
|
} else if (random == 6) {
|
|
|
|
|
|
player.transform.position = threetwo.transform.position;
|
|
|
|
|
|
feltoltolepes1.SetActive(true);
|
|
|
|
|
|
feltoltolepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-13 14:44:21 +01:00
|
|
|
|
jelenlegi_x = 3;
|
|
|
|
|
|
jelenlegi_y = 2;
|
2022-11-12 12:18:08 +01:00
|
|
|
|
} else if (random == 7) {
|
|
|
|
|
|
player.transform.position = onethree.transform.position;
|
|
|
|
|
|
kutatolaborlepes1.SetActive(true);
|
|
|
|
|
|
kutatolaborlepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-13 14:44:21 +01:00
|
|
|
|
jelenlegi_x = 1;
|
|
|
|
|
|
jelenlegi_y = 3;
|
2022-11-12 12:18:08 +01:00
|
|
|
|
} else if (random == 8) {
|
|
|
|
|
|
player.transform.position = twothree.transform.position;
|
|
|
|
|
|
kriptoklublepes1.SetActive(true);
|
|
|
|
|
|
kriptoklublepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-13 14:44:21 +01:00
|
|
|
|
jelenlegi_x = 2;
|
|
|
|
|
|
jelenlegi_y = 3;
|
2022-11-12 12:18:08 +01:00
|
|
|
|
} else if (random == 9) {
|
|
|
|
|
|
player.transform.position = threethree.transform.position;
|
|
|
|
|
|
cyberplazalepes1.SetActive(true);
|
|
|
|
|
|
cyberplazalepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-13 14:44:21 +01:00
|
|
|
|
jelenlegi_x = 3;
|
|
|
|
|
|
jelenlegi_y = 3;
|
2022-11-12 12:18:08 +01:00
|
|
|
|
} else if (random == 10) {
|
|
|
|
|
|
player.transform.position = onefour.transform.position;
|
|
|
|
|
|
hadiuzemlepes1.SetActive(true);
|
|
|
|
|
|
hadiuzemlepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-13 14:44:21 +01:00
|
|
|
|
jelenlegi_x = 1;
|
|
|
|
|
|
jelenlegi_y = 4;
|
2022-11-12 12:18:08 +01:00
|
|
|
|
} else if (random == 11) {
|
|
|
|
|
|
player.transform.position = twofour.transform.position;
|
|
|
|
|
|
konyvtarlepes1.SetActive(true);
|
|
|
|
|
|
konyvtarlepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-13 14:44:21 +01:00
|
|
|
|
jelenlegi_x = 2;
|
|
|
|
|
|
jelenlegi_y = 4;
|
2022-11-12 12:18:08 +01:00
|
|
|
|
} else if (random == 12) {
|
|
|
|
|
|
player.transform.position = threefour.transform.position;
|
|
|
|
|
|
korhazlepes1.SetActive(true);
|
|
|
|
|
|
korhazlepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-13 14:44:21 +01:00
|
|
|
|
jelenlegi_x = 3;
|
|
|
|
|
|
jelenlegi_y = 4;
|
2022-11-12 12:18:08 +01:00
|
|
|
|
}
|
2022-11-04 13:05:20 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-11-15 19:57:06 +01:00
|
|
|
|
public void mozgasHelyre(int x, int y) {
|
2022-11-22 14:45:32 +01:00
|
|
|
|
if (x == 1 && y == 1) {
|
2022-11-15 19:57:06 +01:00
|
|
|
|
jelenlegi_x = x;
|
|
|
|
|
|
jelenlegi_y = y;
|
|
|
|
|
|
player.transform.position = oneone.transform.position;
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else if (x == 1 && y == 2) {
|
2022-11-15 19:57:06 +01:00
|
|
|
|
jelenlegi_x = x;
|
|
|
|
|
|
jelenlegi_y = y;
|
|
|
|
|
|
player.transform.position = onetwo.transform.position;
|
|
|
|
|
|
} else if (x == 1 && y == 3) {
|
|
|
|
|
|
jelenlegi_x = x;
|
|
|
|
|
|
jelenlegi_y = y;
|
|
|
|
|
|
player.transform.position = onethree.transform.position;
|
|
|
|
|
|
} else if (x == 1 && y == 4) {
|
|
|
|
|
|
jelenlegi_x = x;
|
|
|
|
|
|
jelenlegi_y = y;
|
|
|
|
|
|
player.transform.position = onefour.transform.position;
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else if (x == 2 && y == 1) {
|
2022-11-15 19:57:06 +01:00
|
|
|
|
jelenlegi_x = x;
|
|
|
|
|
|
jelenlegi_y = y;
|
|
|
|
|
|
player.transform.position = twoone.transform.position;
|
|
|
|
|
|
} else if (x == 2 && y == 2) {
|
|
|
|
|
|
jelenlegi_x = x;
|
|
|
|
|
|
jelenlegi_y = y;
|
|
|
|
|
|
player.transform.position = twotwo.transform.position;
|
|
|
|
|
|
} else if (x == 2 && y == 3) {
|
|
|
|
|
|
jelenlegi_x = x;
|
|
|
|
|
|
jelenlegi_y = y;
|
|
|
|
|
|
player.transform.position = twothree.transform.position;
|
|
|
|
|
|
} else if (x == 2 && y == 4) {
|
|
|
|
|
|
jelenlegi_x = x;
|
|
|
|
|
|
jelenlegi_y = y;
|
|
|
|
|
|
player.transform.position = twofour.transform.position;
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else if (x == 3 && y == 1) {
|
2022-11-15 19:57:06 +01:00
|
|
|
|
jelenlegi_x = x;
|
|
|
|
|
|
jelenlegi_y = y;
|
|
|
|
|
|
player.transform.position = threeone.transform.position;
|
|
|
|
|
|
} else if (x == 3 && y == 2) {
|
|
|
|
|
|
jelenlegi_x = x;
|
|
|
|
|
|
jelenlegi_y = y;
|
|
|
|
|
|
player.transform.position = threetwo.transform.position;
|
|
|
|
|
|
} else if (x == 3 && y == 3) {
|
|
|
|
|
|
jelenlegi_x = x;
|
|
|
|
|
|
jelenlegi_y = y;
|
|
|
|
|
|
player.transform.position = threethree.transform.position;
|
|
|
|
|
|
} else if (x == 3 && y == 4) {
|
|
|
|
|
|
jelenlegi_x = x;
|
|
|
|
|
|
jelenlegi_y = y;
|
|
|
|
|
|
player.transform.position = threefour.transform.position;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-11-22 14:45:32 +01:00
|
|
|
|
public void helyreTeleport() {
|
|
|
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && oneone_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) {
|
|
|
|
|
|
|
|
|
|
|
|
Debug.Log("Player clicked on the collider: " + oneone_Collider.gameObject.name);
|
|
|
|
|
|
if (eromulepes1.activeSelf == true & eromulepes2.activeSelf == true) {
|
|
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
|
|
player.transform.position = oneone.transform.position;
|
|
|
|
|
|
jelenlegi_x = 1;
|
|
|
|
|
|
jelenlegi_y = 1;
|
|
|
|
|
|
oneonecount = oneonecount + 1;
|
|
|
|
|
|
if (eromulepes1.activeSelf == true) {
|
|
|
|
|
|
eromulepes2.SetActive(true);
|
|
|
|
|
|
moveCounter++;
|
|
|
|
|
|
eromulepes2.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
eromulepes1.SetActive(true);
|
|
|
|
|
|
moveCounter++;
|
|
|
|
|
|
eromulepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && twoone_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) {
|
|
|
|
|
|
|
|
|
|
|
|
Debug.Log("Player clicked on the collider: " + twoone_Collider.gameObject.name);
|
|
|
|
|
|
if (feketepiaclepes1.activeSelf == true & feketepiaclepes2.activeSelf == true) {
|
|
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
|
|
if (twoonecount < 2) {
|
|
|
|
|
|
player.transform.position = twoone.transform.position;
|
|
|
|
|
|
jelenlegi_x = 2;
|
|
|
|
|
|
jelenlegi_y = 1;
|
|
|
|
|
|
twoonecount = twoonecount + 1;
|
|
|
|
|
|
if (feketepiaclepes1.activeSelf == true) {
|
|
|
|
|
|
feketepiaclepes2.SetActive(true);
|
|
|
|
|
|
moveCounter++;
|
|
|
|
|
|
feketepiaclepes2.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
feketepiaclepes1.SetActive(true);
|
|
|
|
|
|
moveCounter++;
|
|
|
|
|
|
feketepiaclepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez?re");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && threeone_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) {
|
|
|
|
|
|
|
|
|
|
|
|
Debug.Log("Player clicked on the collider: " + threeone_Collider.gameObject.name);
|
|
|
|
|
|
if (metrolepes1.activeSelf == true & metrolepes2.activeSelf == true) {
|
|
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
|
|
|
|
|
} else {
|
|
|
|
|
|
if (threeonecount < 2) {
|
|
|
|
|
|
player.transform.position = threeone.transform.position;
|
|
|
|
|
|
jelenlegi_x = 3;
|
|
|
|
|
|
jelenlegi_y = 1;
|
|
|
|
|
|
threeonecount++;
|
|
|
|
|
|
if (metrolepes1.activeSelf == true) {
|
|
|
|
|
|
metrolepes2.SetActive(true);
|
|
|
|
|
|
moveCounter++;
|
|
|
|
|
|
metrolepes2.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
metrolepes1.SetActive(true);
|
|
|
|
|
|
moveCounter++;
|
|
|
|
|
|
metrolepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && onetwo_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) {
|
|
|
|
|
|
|
|
|
|
|
|
Debug.Log("Player clicked on the collider: " + onetwo_Collider.gameObject.name);
|
|
|
|
|
|
if (szervereklepes1.activeSelf == true & szervereklepes2.activeSelf == true) {
|
|
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
|
|
if (onetwocount < 2) {
|
|
|
|
|
|
player.transform.position = onetwo.transform.position;
|
|
|
|
|
|
jelenlegi_x = 1;
|
|
|
|
|
|
jelenlegi_y = 2;
|
|
|
|
|
|
onetwocount++;
|
|
|
|
|
|
Debug.Log(ap.akciopont);
|
|
|
|
|
|
if (szervereklepes1.activeSelf == true) {
|
|
|
|
|
|
szervereklepes2.SetActive(true);
|
|
|
|
|
|
moveCounter++;
|
|
|
|
|
|
szervereklepes2.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
szervereklepes1.SetActive(true);
|
|
|
|
|
|
moveCounter++;
|
|
|
|
|
|
szervereklepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
Debug.Log("Nincs el<65>g akci<63>pontod vagy nem 1 mez<65>n bel<65>l akarsz l<>pni");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && twotwo_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) {
|
|
|
|
|
|
Debug.Log("Player clicked on the collider: " + twotwo_Collider.gameObject.name);
|
|
|
|
|
|
if (kingcasinolepes1.activeSelf == true & kingcasinolepes2.activeSelf == true) {
|
|
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
|
|
if (twotwocount < 2) {
|
|
|
|
|
|
player.transform.position = twotwo.transform.position;
|
|
|
|
|
|
jelenlegi_x = 2;
|
|
|
|
|
|
jelenlegi_y = 2;
|
|
|
|
|
|
twotwocount++;
|
|
|
|
|
|
if (kingcasinolepes1.activeSelf == true) {
|
|
|
|
|
|
kingcasinolepes2.SetActive(true);
|
|
|
|
|
|
moveCounter++;
|
|
|
|
|
|
kingcasinolepes2.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
kingcasinolepes1.SetActive(true);
|
|
|
|
|
|
moveCounter++;
|
|
|
|
|
|
kingcasinolepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && threetwo_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) {
|
|
|
|
|
|
|
|
|
|
|
|
Debug.Log("Player clicked on the collider: " + threetwo_Collider.gameObject.name);
|
|
|
|
|
|
if (feltoltolepes1.activeSelf == true & feltoltolepes2.activeSelf == true) {
|
|
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
|
|
if (threetwocount < 2) {
|
|
|
|
|
|
player.transform.position = threetwo.transform.position;
|
|
|
|
|
|
jelenlegi_x = 3;
|
|
|
|
|
|
jelenlegi_y = 2;
|
|
|
|
|
|
threetwocount++;
|
|
|
|
|
|
if (feltoltolepes1.activeSelf == true) {
|
|
|
|
|
|
feltoltolepes2.SetActive(true);
|
|
|
|
|
|
moveCounter++;
|
|
|
|
|
|
feltoltolepes2.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
feltoltolepes1.SetActive(true);
|
|
|
|
|
|
moveCounter++;
|
|
|
|
|
|
feltoltolepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez?re");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && onethree_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) {
|
|
|
|
|
|
|
|
|
|
|
|
Debug.Log("Player clicked on the collider: " + onethree_Collider.gameObject.name);
|
|
|
|
|
|
|
|
|
|
|
|
if (kutatolaborlepes1.activeSelf == true & kutatolaborlepes2.activeSelf == true) {
|
|
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
|
|
if (onethreecount < 2) {
|
|
|
|
|
|
player.transform.position = onethree.transform.position;
|
|
|
|
|
|
jelenlegi_x = 1;
|
|
|
|
|
|
jelenlegi_y = 3;
|
|
|
|
|
|
onethreecount++;
|
|
|
|
|
|
if (kutatolaborlepes1.activeSelf == true) {
|
|
|
|
|
|
kutatolaborlepes2.SetActive(true);
|
|
|
|
|
|
moveCounter++;
|
|
|
|
|
|
kutatolaborlepes2.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
kutatolaborlepes1.SetActive(true);
|
|
|
|
|
|
moveCounter++;
|
|
|
|
|
|
kutatolaborlepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez?re");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && twothree_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) {
|
|
|
|
|
|
|
|
|
|
|
|
Debug.Log("Player clicked on the collider: " + twothree_Collider.gameObject.name);
|
|
|
|
|
|
|
|
|
|
|
|
if (kriptoklublepes1.activeSelf == true & kriptoklublepes2.activeSelf == true) {
|
|
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
|
|
if (twothreecount < 2) {
|
|
|
|
|
|
player.transform.position = twothree.transform.position;
|
|
|
|
|
|
jelenlegi_x = 2;
|
|
|
|
|
|
jelenlegi_y = 3;
|
|
|
|
|
|
twothreecount++;
|
|
|
|
|
|
if (kriptoklublepes1.activeSelf == true) {
|
|
|
|
|
|
kriptoklublepes2.SetActive(true);
|
|
|
|
|
|
moveCounter++;
|
|
|
|
|
|
kriptoklublepes2.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
kriptoklublepes1.SetActive(true);
|
|
|
|
|
|
moveCounter++;
|
|
|
|
|
|
kriptoklublepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez?re");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && threethree_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) {
|
|
|
|
|
|
|
|
|
|
|
|
Debug.Log("Player clicked on the collider: " + threethree_Collider.gameObject.name);
|
|
|
|
|
|
|
|
|
|
|
|
if (cyberplazalepes1.activeSelf == true & cyberplazalepes2.activeSelf == true) {
|
|
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
|
|
if (threethreecount < 2) {
|
|
|
|
|
|
player.transform.position = threethree.transform.position;
|
|
|
|
|
|
jelenlegi_x = 3;
|
|
|
|
|
|
jelenlegi_y = 3;
|
|
|
|
|
|
threethreecount++;
|
|
|
|
|
|
if (cyberplazalepes1.activeSelf == true) {
|
|
|
|
|
|
cyberplazalepes2.SetActive(true);
|
|
|
|
|
|
moveCounter++;
|
|
|
|
|
|
cyberplazalepes2.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
cyberplazalepes1.SetActive(true);
|
|
|
|
|
|
moveCounter++;
|
|
|
|
|
|
cyberplazalepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && onefour_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) {
|
|
|
|
|
|
|
|
|
|
|
|
Debug.Log("Player clicked on the collider: " + onefour_Collider.gameObject.name);
|
|
|
|
|
|
|
|
|
|
|
|
if (hadiuzemlepes1.activeSelf == true & hadiuzemlepes2.activeSelf == true) {
|
|
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
|
|
if (onefourcount < 2) {
|
|
|
|
|
|
player.transform.position = onefour.transform.position;
|
|
|
|
|
|
jelenlegi_x = 1;
|
|
|
|
|
|
jelenlegi_y = 4;
|
|
|
|
|
|
onefourcount++;
|
|
|
|
|
|
if (hadiuzemlepes1.activeSelf == true) {
|
|
|
|
|
|
hadiuzemlepes2.SetActive(true);
|
|
|
|
|
|
moveCounter++;
|
|
|
|
|
|
hadiuzemlepes2.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
hadiuzemlepes1.SetActive(true);
|
|
|
|
|
|
moveCounter++;
|
|
|
|
|
|
hadiuzemlepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez?re");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && twofour_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) {
|
|
|
|
|
|
|
|
|
|
|
|
Debug.Log("Player clicked on the collider: " + twofour_Collider.gameObject.name);
|
|
|
|
|
|
|
|
|
|
|
|
if (konyvtarlepes1.activeSelf == true & konyvtarlepes2.activeSelf == true) {
|
|
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
|
|
if (twofourcount < 2) {
|
|
|
|
|
|
player.transform.position = twofour.transform.position;
|
|
|
|
|
|
jelenlegi_x = 2;
|
|
|
|
|
|
jelenlegi_y = 4;
|
|
|
|
|
|
twofourcount++;
|
|
|
|
|
|
if (konyvtarlepes1.activeSelf == true) {
|
|
|
|
|
|
konyvtarlepes2.SetActive(true);
|
|
|
|
|
|
moveCounter++;
|
|
|
|
|
|
konyvtarlepes2.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
konyvtarlepes1.SetActive(true);
|
|
|
|
|
|
moveCounter++;
|
|
|
|
|
|
konyvtarlepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez?re");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && threefour_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) {
|
|
|
|
|
|
|
|
|
|
|
|
Debug.Log("Player clicked on the collider: " + threefour_Collider.gameObject.name);
|
|
|
|
|
|
|
|
|
|
|
|
if (korhazlepes1.activeSelf == true & korhazlepes2.activeSelf == true) {
|
|
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
|
|
if (threefourcount < 2) {
|
|
|
|
|
|
player.transform.position = threefour.transform.position;
|
|
|
|
|
|
jelenlegi_x = 3;
|
|
|
|
|
|
jelenlegi_y = 4;
|
|
|
|
|
|
threefourcount++;
|
|
|
|
|
|
if (korhazlepes1.activeSelf == true) {
|
|
|
|
|
|
korhazlepes2.SetActive(true);
|
|
|
|
|
|
moveCounter++;
|
|
|
|
|
|
korhazlepes2.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
korhazlepes1.SetActive(true);
|
|
|
|
|
|
moveCounter++;
|
|
|
|
|
|
korhazlepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez?re");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-11-02 11:15:11 +01:00
|
|
|
|
// Update is called once per frame
|
2022-11-02 17:24:55 +01:00
|
|
|
|
public void Update() {
|
2022-11-02 11:15:11 +01:00
|
|
|
|
tavolsag = math.abs(tavolsag);
|
|
|
|
|
|
|
|
|
|
|
|
// player mozgat<61>sa <20>s konzolra irat<61>s
|
2022-11-02 17:24:55 +01:00
|
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && oneone_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) {
|
|
|
|
|
|
for (int x = 0; x < w; x++) {
|
|
|
|
|
|
for (int y = 0; y < h; y++) {
|
|
|
|
|
|
if (helyek[y, x].Equals("oneone")) {
|
2022-11-02 07:41:58 +01:00
|
|
|
|
Debug.Log("Player clicked on the collider: " + oneone_Collider.gameObject.name);
|
2022-11-02 11:15:11 +01:00
|
|
|
|
tavolsag = math.abs((jelenlegi_x + jelenlegi_y) - ((x + 1) + (y + 1)));
|
2022-11-11 13:42:40 +01:00
|
|
|
|
if (eromulepes1.activeSelf == true & eromulepes2.activeSelf == true) {
|
|
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-12-06 11:36:20 +01:00
|
|
|
|
if (tavolsag <= ap.akciopont && ap.akciopont > 0) {
|
2022-11-22 14:45:32 +01:00
|
|
|
|
player.transform.position = oneone.transform.position;
|
|
|
|
|
|
jelenlegi_x = 1;
|
|
|
|
|
|
jelenlegi_y = 1;
|
2022-12-06 11:36:20 +01:00
|
|
|
|
ap.akciopont = ap.akciopont - tavolsag;
|
2022-11-22 14:45:32 +01:00
|
|
|
|
oneonecount = oneonecount + 1;
|
|
|
|
|
|
Debug.Log(ap.akciopont);
|
|
|
|
|
|
if (eromulepes1.activeSelf == true) {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
eromulepes2.SetActive(true);
|
2022-11-12 12:18:08 +01:00
|
|
|
|
moveCounter++;
|
|
|
|
|
|
eromulepes2.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
eromulepes1.SetActive(true);
|
2022-11-12 12:18:08 +01:00
|
|
|
|
moveCounter++;
|
|
|
|
|
|
eromulepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-11 13:42:40 +01:00
|
|
|
|
}
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
Debug.Log("Nincs el<65>g akci<63>pontod vagy nem 1 mez?n bel<65>l akarsz l<>pni");
|
2022-11-02 07:41:58 +01:00
|
|
|
|
}
|
2022-11-02 17:24:55 +01:00
|
|
|
|
}
|
2022-11-02 11:15:11 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-11-02 17:24:55 +01:00
|
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && twoone_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) {
|
|
|
|
|
|
for (int x = 0; x < w; x++) {
|
|
|
|
|
|
for (int y = 0; y < h; y++) {
|
|
|
|
|
|
if (helyek[y, x].Equals("twoone")) {
|
2022-11-02 11:15:11 +01:00
|
|
|
|
Debug.Log("Player clicked on the collider: " + twoone_Collider.gameObject.name);
|
|
|
|
|
|
tavolsag = math.abs((jelenlegi_x + jelenlegi_y) - ((x + 1) + (y + 1)));
|
2022-11-22 14:45:32 +01:00
|
|
|
|
if (feketepiaclepes1.activeSelf == true & feketepiaclepes2.activeSelf == true) {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-12-06 11:36:20 +01:00
|
|
|
|
if (tavolsag <= ap.akciopont && ap.akciopont > 0) {
|
|
|
|
|
|
if (jelenlegi_x == 1 && jelenlegi_y == 2)
|
|
|
|
|
|
{
|
|
|
|
|
|
tavolsag = 2;
|
|
|
|
|
|
}
|
2022-11-22 14:45:32 +01:00
|
|
|
|
if (twoonecount < 2) {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
player.transform.position = twoone.transform.position;
|
|
|
|
|
|
jelenlegi_x = 2;
|
|
|
|
|
|
jelenlegi_y = 1;
|
2022-12-06 11:36:20 +01:00
|
|
|
|
ap.akciopont = ap.akciopont - tavolsag;
|
2022-11-11 13:42:40 +01:00
|
|
|
|
twoonecount = twoonecount + 1;
|
2022-11-12 12:18:08 +01:00
|
|
|
|
Debug.Log(ap.akciopont);
|
2022-11-22 14:45:32 +01:00
|
|
|
|
if (feketepiaclepes1.activeSelf == true) {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
feketepiaclepes2.SetActive(true);
|
2022-11-12 12:18:08 +01:00
|
|
|
|
moveCounter++;
|
|
|
|
|
|
feketepiaclepes2.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
feketepiaclepes1.SetActive(true);
|
2022-11-12 12:18:08 +01:00
|
|
|
|
moveCounter++;
|
|
|
|
|
|
feketepiaclepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-11 13:42:40 +01:00
|
|
|
|
}
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez?re");
|
|
|
|
|
|
}
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
Debug.Log("Nincs el<65>g akci<63>pontod vagy nem 1 mez?n bel<65>l akarsz l<>pni");
|
2022-11-02 17:24:55 +01:00
|
|
|
|
}
|
2022-11-02 07:41:58 +01:00
|
|
|
|
}
|
2022-11-22 14:45:32 +01:00
|
|
|
|
|
2022-11-02 07:41:58 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2022-11-01 18:07:06 +01:00
|
|
|
|
}
|
2022-11-02 11:15:11 +01:00
|
|
|
|
|
2022-11-02 17:24:55 +01:00
|
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && threeone_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) {
|
|
|
|
|
|
for (int x = 0; x < w; x++) {
|
|
|
|
|
|
for (int y = 0; y < h; y++) {
|
|
|
|
|
|
if (helyek[y, x].Equals("threeone")) {
|
2022-11-02 11:15:11 +01:00
|
|
|
|
Debug.Log("Player clicked on the collider: " + threeone_Collider.gameObject.name);
|
|
|
|
|
|
tavolsag = math.abs((jelenlegi_x + jelenlegi_y) - ((x + 1) + (y + 1)));
|
2022-11-22 14:45:32 +01:00
|
|
|
|
if (metrolepes1.activeSelf == true & metrolepes2.activeSelf == true) {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-12-06 11:36:20 +01:00
|
|
|
|
if (tavolsag <= ap.akciopont && ap.akciopont > 0) {
|
2022-11-22 14:45:32 +01:00
|
|
|
|
if (threeonecount < 2) {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
player.transform.position = threeone.transform.position;
|
|
|
|
|
|
jelenlegi_x = 3;
|
|
|
|
|
|
jelenlegi_y = 1;
|
2022-12-06 11:36:20 +01:00
|
|
|
|
ap.akciopont = ap.akciopont - tavolsag;
|
2022-11-11 13:42:40 +01:00
|
|
|
|
threeonecount++;
|
2022-11-12 12:18:08 +01:00
|
|
|
|
Debug.Log(ap.akciopont);
|
2022-11-22 14:45:32 +01:00
|
|
|
|
if (metrolepes1.activeSelf == true) {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
metrolepes2.SetActive(true);
|
2022-11-12 12:18:08 +01:00
|
|
|
|
moveCounter++;
|
|
|
|
|
|
metrolepes2.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
metrolepes1.SetActive(true);
|
2022-11-12 12:18:08 +01:00
|
|
|
|
moveCounter++;
|
|
|
|
|
|
metrolepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-11 13:42:40 +01:00
|
|
|
|
}
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
|
|
|
|
|
}
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
Debug.Log("Nincs el<65>g akci<63>pontod vagy nem 1 mez?n bel<65>l akarsz l<>pni");
|
2022-11-02 17:24:55 +01:00
|
|
|
|
}
|
2022-11-02 11:15:11 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-11-02 17:24:55 +01:00
|
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && onetwo_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) {
|
|
|
|
|
|
for (int x = 0; x < w; x++) {
|
|
|
|
|
|
for (int y = 0; y < h; y++) {
|
|
|
|
|
|
if (helyek[y, x].Equals("onetwo")) {
|
2022-11-02 11:15:11 +01:00
|
|
|
|
Debug.Log("Player clicked on the collider: " + onetwo_Collider.gameObject.name);
|
|
|
|
|
|
tavolsag = math.abs((jelenlegi_x + jelenlegi_y) - ((x + 1) + (y + 1)));
|
|
|
|
|
|
|
2022-11-22 14:45:32 +01:00
|
|
|
|
if (szervereklepes1.activeSelf == true & szervereklepes2.activeSelf == true) {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-12-06 11:36:20 +01:00
|
|
|
|
if (tavolsag <= ap.akciopont && ap.akciopont > 0) {
|
|
|
|
|
|
if (jelenlegi_x == 2 && jelenlegi_y == 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
tavolsag = 2;
|
|
|
|
|
|
}
|
2022-11-22 14:45:32 +01:00
|
|
|
|
if (onetwocount < 2) {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
player.transform.position = onetwo.transform.position;
|
|
|
|
|
|
jelenlegi_x = 1;
|
|
|
|
|
|
jelenlegi_y = 2;
|
2022-12-06 11:36:20 +01:00
|
|
|
|
ap.akciopont = ap.akciopont - tavolsag;
|
2022-11-11 13:42:40 +01:00
|
|
|
|
onetwocount++;
|
2022-11-12 12:18:08 +01:00
|
|
|
|
Debug.Log(ap.akciopont);
|
2022-11-22 14:45:32 +01:00
|
|
|
|
if (szervereklepes1.activeSelf == true) {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
szervereklepes2.SetActive(true);
|
2022-11-12 12:18:08 +01:00
|
|
|
|
moveCounter++;
|
|
|
|
|
|
szervereklepes2.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
szervereklepes1.SetActive(true);
|
2022-11-12 12:18:08 +01:00
|
|
|
|
moveCounter++;
|
|
|
|
|
|
szervereklepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-11 13:42:40 +01:00
|
|
|
|
}
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
|
|
|
|
|
}
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
Debug.Log("Nincs el<65>g akci<63>pontod vagy nem 1 mez<65>n bel<65>l akarsz l<>pni");
|
2022-11-02 17:24:55 +01:00
|
|
|
|
}
|
2022-11-02 11:15:11 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-11-02 17:24:55 +01:00
|
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && twotwo_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) {
|
|
|
|
|
|
for (int x = 0; x < w; x++) {
|
|
|
|
|
|
for (int y = 0; y < h; y++) {
|
|
|
|
|
|
if (helyek[y, x].Equals("twotwo")) {
|
2022-11-02 11:15:11 +01:00
|
|
|
|
Debug.Log("Player clicked on the collider: " + twotwo_Collider.gameObject.name);
|
|
|
|
|
|
tavolsag = math.abs((jelenlegi_x + jelenlegi_y) - ((x + 1) + (y + 1)));
|
|
|
|
|
|
|
2022-11-22 14:45:32 +01:00
|
|
|
|
if (kingcasinolepes1.activeSelf == true & kingcasinolepes2.activeSelf == true) {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-12-06 11:36:20 +01:00
|
|
|
|
if (tavolsag <= ap.akciopont && ap.akciopont > 0) {
|
2022-11-22 14:45:32 +01:00
|
|
|
|
if (twotwocount < 2) {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
player.transform.position = twotwo.transform.position;
|
|
|
|
|
|
jelenlegi_x = 2;
|
|
|
|
|
|
jelenlegi_y = 2;
|
2022-12-06 11:36:20 +01:00
|
|
|
|
ap.akciopont = ap.akciopont - tavolsag;
|
2022-11-12 12:18:08 +01:00
|
|
|
|
Debug.Log(ap.akciopont);
|
2022-11-11 13:42:40 +01:00
|
|
|
|
twotwocount++;
|
2022-11-22 14:45:32 +01:00
|
|
|
|
if (kingcasinolepes1.activeSelf == true) {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
kingcasinolepes2.SetActive(true);
|
2022-11-12 12:18:08 +01:00
|
|
|
|
moveCounter++;
|
|
|
|
|
|
kingcasinolepes2.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
kingcasinolepes1.SetActive(true);
|
2022-11-12 12:18:08 +01:00
|
|
|
|
moveCounter++;
|
|
|
|
|
|
kingcasinolepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-11 13:42:40 +01:00
|
|
|
|
}
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
|
|
|
|
|
}
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
Debug.Log("Nincs el<65>g akci<63>pontod vagy nem 1 mez<65>n bel<65>l akarsz l<>pni");
|
2022-11-02 17:24:55 +01:00
|
|
|
|
}
|
2022-11-02 07:41:58 +01:00
|
|
|
|
}
|
2022-11-22 14:45:32 +01:00
|
|
|
|
|
2022-11-02 07:41:58 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2022-11-02 11:15:11 +01:00
|
|
|
|
}
|
2022-11-02 07:41:58 +01:00
|
|
|
|
}
|
2022-11-01 18:07:06 +01:00
|
|
|
|
|
2022-11-02 17:24:55 +01:00
|
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && threetwo_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) {
|
|
|
|
|
|
for (int x = 0; x < w; x++) {
|
|
|
|
|
|
for (int y = 0; y < h; y++) {
|
|
|
|
|
|
if (helyek[y, x].Equals("threetwo")) {
|
2022-11-02 11:15:11 +01:00
|
|
|
|
Debug.Log("Player clicked on the collider: " + threetwo_Collider.gameObject.name);
|
|
|
|
|
|
tavolsag = math.abs((jelenlegi_x + jelenlegi_y) - ((x + 1) + (y + 1)));
|
|
|
|
|
|
|
2022-11-22 14:45:32 +01:00
|
|
|
|
if (feltoltolepes1.activeSelf == true & feltoltolepes2.activeSelf == true) {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-12-06 11:36:20 +01:00
|
|
|
|
if (tavolsag <= ap.akciopont && ap.akciopont > 0) {
|
|
|
|
|
|
if (jelenlegi_x == 2 && jelenlegi_y == 3)
|
|
|
|
|
|
{
|
|
|
|
|
|
tavolsag = 2;
|
|
|
|
|
|
}
|
2022-11-22 14:45:32 +01:00
|
|
|
|
if (threetwocount < 2) {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
player.transform.position = threetwo.transform.position;
|
|
|
|
|
|
jelenlegi_x = 3;
|
|
|
|
|
|
jelenlegi_y = 2;
|
2022-12-06 11:36:20 +01:00
|
|
|
|
ap.akciopont = ap.akciopont - tavolsag;
|
2022-11-12 12:18:08 +01:00
|
|
|
|
Debug.Log(ap.akciopont);
|
2022-11-11 13:42:40 +01:00
|
|
|
|
threetwocount++;
|
2022-11-22 14:45:32 +01:00
|
|
|
|
if (feltoltolepes1.activeSelf == true) {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
feltoltolepes2.SetActive(true);
|
2022-11-12 12:18:08 +01:00
|
|
|
|
moveCounter++;
|
|
|
|
|
|
feltoltolepes2.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
feltoltolepes1.SetActive(true);
|
2022-11-12 12:18:08 +01:00
|
|
|
|
moveCounter++;
|
|
|
|
|
|
feltoltolepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-11 13:42:40 +01:00
|
|
|
|
}
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez?re");
|
|
|
|
|
|
}
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
Debug.Log("Nincs el<65>g akci<63>pontod vagy nem 1 mez?n bel<65>l akarsz l<>pni");
|
2022-11-02 17:24:55 +01:00
|
|
|
|
}
|
2022-11-02 11:15:11 +01:00
|
|
|
|
}
|
2022-11-11 13:42:40 +01:00
|
|
|
|
|
2022-11-02 11:15:11 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-11-02 17:24:55 +01:00
|
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && onethree_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) {
|
|
|
|
|
|
for (int x = 0; x < w; x++) {
|
|
|
|
|
|
for (int y = 0; y < h; y++) {
|
|
|
|
|
|
if (helyek[y, x].Equals("onethree")) {
|
2022-11-02 11:15:11 +01:00
|
|
|
|
Debug.Log("Player clicked on the collider: " + onethree_Collider.gameObject.name);
|
|
|
|
|
|
tavolsag = math.abs((jelenlegi_x + jelenlegi_y) - ((x + 1) + (y + 1)));
|
|
|
|
|
|
|
2022-11-22 14:45:32 +01:00
|
|
|
|
if (kutatolaborlepes1.activeSelf == true & kutatolaborlepes2.activeSelf == true) {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-12-06 11:36:20 +01:00
|
|
|
|
if (tavolsag <= ap.akciopont && ap.akciopont > 0) {
|
2022-11-22 14:45:32 +01:00
|
|
|
|
if (onethreecount < 2) {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
player.transform.position = onethree.transform.position;
|
|
|
|
|
|
jelenlegi_x = 1;
|
|
|
|
|
|
jelenlegi_y = 3;
|
2022-12-06 11:36:20 +01:00
|
|
|
|
ap.akciopont = ap.akciopont - tavolsag;
|
2022-11-12 12:18:08 +01:00
|
|
|
|
Debug.Log(ap.akciopont);
|
2022-11-11 13:42:40 +01:00
|
|
|
|
onethreecount++;
|
2022-11-22 14:45:32 +01:00
|
|
|
|
if (kutatolaborlepes1.activeSelf == true) {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
kutatolaborlepes2.SetActive(true);
|
2022-11-12 12:18:08 +01:00
|
|
|
|
moveCounter++;
|
|
|
|
|
|
kutatolaborlepes2.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
kutatolaborlepes1.SetActive(true);
|
2022-11-12 12:18:08 +01:00
|
|
|
|
moveCounter++;
|
|
|
|
|
|
kutatolaborlepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-11 13:42:40 +01:00
|
|
|
|
}
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez?re");
|
|
|
|
|
|
}
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
Debug.Log("Nincs el<65>g akci<63>pontod vagy nem 1 mez?n bel<65>l akarsz l<>pni");
|
2022-11-02 17:24:55 +01:00
|
|
|
|
}
|
2022-11-02 11:15:11 +01:00
|
|
|
|
}
|
2022-11-11 13:42:40 +01:00
|
|
|
|
|
2022-11-02 11:15:11 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-11-02 17:24:55 +01:00
|
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && twothree_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) {
|
|
|
|
|
|
for (int x = 0; x < w; x++) {
|
|
|
|
|
|
for (int y = 0; y < h; y++) {
|
|
|
|
|
|
if (helyek[y, x].Equals("twothree")) {
|
2022-11-02 11:15:11 +01:00
|
|
|
|
Debug.Log("Player clicked on the collider: " + twothree_Collider.gameObject.name);
|
|
|
|
|
|
tavolsag = math.abs((jelenlegi_x + jelenlegi_y) - ((x + 1) + (y + 1)));
|
|
|
|
|
|
|
2022-11-22 14:45:32 +01:00
|
|
|
|
if (kriptoklublepes1.activeSelf == true & kriptoklublepes2.activeSelf == true) {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-12-06 11:36:20 +01:00
|
|
|
|
if (tavolsag <= ap.akciopont && ap.akciopont > 0) {
|
|
|
|
|
|
if (jelenlegi_x == 3 && jelenlegi_y == 2)
|
|
|
|
|
|
{
|
|
|
|
|
|
tavolsag = 2;
|
|
|
|
|
|
}
|
2022-11-22 14:45:32 +01:00
|
|
|
|
if (twothreecount < 2) {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
player.transform.position = twothree.transform.position;
|
|
|
|
|
|
jelenlegi_x = 2;
|
|
|
|
|
|
jelenlegi_y = 3;
|
2022-12-06 11:36:20 +01:00
|
|
|
|
ap.akciopont = ap.akciopont - tavolsag;
|
2022-11-12 12:18:08 +01:00
|
|
|
|
Debug.Log(ap.akciopont);
|
2022-11-11 13:42:40 +01:00
|
|
|
|
twothreecount++;
|
2022-11-22 14:45:32 +01:00
|
|
|
|
if (kriptoklublepes1.activeSelf == true) {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
kriptoklublepes2.SetActive(true);
|
2022-11-12 12:18:08 +01:00
|
|
|
|
moveCounter++;
|
|
|
|
|
|
kriptoklublepes2.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
kriptoklublepes1.SetActive(true);
|
2022-11-12 12:18:08 +01:00
|
|
|
|
moveCounter++;
|
|
|
|
|
|
kriptoklublepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-11 13:42:40 +01:00
|
|
|
|
}
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez?re");
|
|
|
|
|
|
}
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
Debug.Log("Nincs el<65>g akci<63>pontod vagy nem 1 mez?n bel<65>l akarsz l<>pni");
|
2022-11-02 17:24:55 +01:00
|
|
|
|
}
|
2022-11-02 11:15:11 +01:00
|
|
|
|
}
|
2022-11-11 13:42:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
2022-11-02 11:15:11 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-11-02 17:24:55 +01:00
|
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && threethree_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) {
|
|
|
|
|
|
for (int x = 0; x < w; x++) {
|
|
|
|
|
|
for (int y = 0; y < h; y++) {
|
|
|
|
|
|
if (helyek[x, y].Equals("threethree")) {
|
2022-11-02 11:15:11 +01:00
|
|
|
|
Debug.Log("Player clicked on the collider: " + threethree_Collider.gameObject.name);
|
|
|
|
|
|
tavolsag = math.abs((jelenlegi_x + jelenlegi_y) - ((x + 1) + (y + 1)));
|
|
|
|
|
|
|
2022-11-22 14:45:32 +01:00
|
|
|
|
if (cyberplazalepes1.activeSelf == true & cyberplazalepes2.activeSelf == true) {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-12-06 11:36:20 +01:00
|
|
|
|
if (tavolsag <= ap.akciopont && ap.akciopont > 0) {
|
2022-11-22 14:45:32 +01:00
|
|
|
|
if (threethreecount < 2) {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
player.transform.position = threethree.transform.position;
|
|
|
|
|
|
jelenlegi_x = 3;
|
|
|
|
|
|
jelenlegi_y = 3;
|
2022-12-06 11:36:20 +01:00
|
|
|
|
ap.akciopont = ap.akciopont - tavolsag;
|
2022-11-12 12:18:08 +01:00
|
|
|
|
Debug.Log(ap.akciopont);
|
2022-11-11 13:42:40 +01:00
|
|
|
|
threethreecount++;
|
2022-11-22 14:45:32 +01:00
|
|
|
|
if (cyberplazalepes1.activeSelf == true) {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
cyberplazalepes2.SetActive(true);
|
2022-11-12 12:18:08 +01:00
|
|
|
|
moveCounter++;
|
|
|
|
|
|
cyberplazalepes2.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
cyberplazalepes1.SetActive(true);
|
2022-11-12 12:18:08 +01:00
|
|
|
|
moveCounter++;
|
|
|
|
|
|
cyberplazalepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-11 13:42:40 +01:00
|
|
|
|
}
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
|
|
|
|
|
}
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
Debug.Log("Nincs el<65>g akci<63>pontod vagy nem 1 mez?n bel<65>l akarsz l<>pni");
|
2022-11-02 17:24:55 +01:00
|
|
|
|
}
|
2022-11-02 11:15:11 +01:00
|
|
|
|
}
|
2022-11-11 13:42:40 +01:00
|
|
|
|
|
2022-11-02 11:15:11 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-11-02 17:24:55 +01:00
|
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && onefour_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) {
|
|
|
|
|
|
for (int x = 0; x < w; x++) {
|
|
|
|
|
|
for (int y = 0; y < h; y++) {
|
|
|
|
|
|
if (helyek[y, x].Equals("onefour")) {
|
2022-11-02 11:15:11 +01:00
|
|
|
|
Debug.Log("Player clicked on the collider: " + onefour_Collider.gameObject.name);
|
|
|
|
|
|
tavolsag = math.abs((jelenlegi_x + jelenlegi_y) - ((x + 1) + (y + 1)));
|
|
|
|
|
|
|
2022-11-22 14:45:32 +01:00
|
|
|
|
if (hadiuzemlepes1.activeSelf == true & hadiuzemlepes2.activeSelf == true) {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-12-06 11:36:20 +01:00
|
|
|
|
if (tavolsag <= ap.akciopont && ap.akciopont > 0) {
|
2022-11-22 14:45:32 +01:00
|
|
|
|
if (onefourcount < 2) {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
player.transform.position = onefour.transform.position;
|
|
|
|
|
|
jelenlegi_x = 1;
|
|
|
|
|
|
jelenlegi_y = 4;
|
2022-12-06 11:36:20 +01:00
|
|
|
|
ap.akciopont = ap.akciopont - tavolsag;
|
2022-11-12 12:18:08 +01:00
|
|
|
|
Debug.Log(ap.akciopont);
|
2022-11-11 13:42:40 +01:00
|
|
|
|
onefourcount++;
|
2022-11-22 14:45:32 +01:00
|
|
|
|
if (hadiuzemlepes1.activeSelf == true) {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
hadiuzemlepes2.SetActive(true);
|
2022-11-12 12:18:08 +01:00
|
|
|
|
moveCounter++;
|
|
|
|
|
|
hadiuzemlepes2.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
hadiuzemlepes1.SetActive(true);
|
2022-11-12 12:18:08 +01:00
|
|
|
|
moveCounter++;
|
|
|
|
|
|
hadiuzemlepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-11 13:42:40 +01:00
|
|
|
|
}
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez?re");
|
|
|
|
|
|
}
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
Debug.Log("Nincs el<65>g akci<63>pontod vagy nem 1 mez?n bel<65>l akarsz l<>pni");
|
2022-11-02 17:24:55 +01:00
|
|
|
|
}
|
2022-11-02 11:15:11 +01:00
|
|
|
|
}
|
2022-11-11 13:42:40 +01:00
|
|
|
|
|
2022-11-02 11:15:11 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-11-02 17:24:55 +01:00
|
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && twofour_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) {
|
|
|
|
|
|
for (int x = 0; x < w; x++) {
|
|
|
|
|
|
for (int y = 0; y < h; y++) {
|
|
|
|
|
|
if (helyek[y, x].Equals("twofour")) {
|
2022-11-02 11:15:11 +01:00
|
|
|
|
Debug.Log("Player clicked on the collider: " + twofour_Collider.gameObject.name);
|
|
|
|
|
|
tavolsag = math.abs((jelenlegi_x + jelenlegi_y) - ((x + 1) + (y + 1)));
|
|
|
|
|
|
|
2022-11-22 14:45:32 +01:00
|
|
|
|
if (konyvtarlepes1.activeSelf == true & konyvtarlepes2.activeSelf == true) {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-12-06 11:36:20 +01:00
|
|
|
|
if (tavolsag <= ap.akciopont && ap.akciopont > 0) {
|
2022-11-22 14:45:32 +01:00
|
|
|
|
if (twofourcount < 2) {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
player.transform.position = twofour.transform.position;
|
|
|
|
|
|
jelenlegi_x = 2;
|
|
|
|
|
|
jelenlegi_y = 4;
|
2022-12-06 11:36:20 +01:00
|
|
|
|
ap.akciopont = ap.akciopont - tavolsag;
|
2022-11-12 12:18:08 +01:00
|
|
|
|
Debug.Log(ap.akciopont);
|
2022-11-11 13:42:40 +01:00
|
|
|
|
twofourcount++;
|
2022-11-22 14:45:32 +01:00
|
|
|
|
if (konyvtarlepes1.activeSelf == true) {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
konyvtarlepes2.SetActive(true);
|
2022-11-12 12:18:08 +01:00
|
|
|
|
moveCounter++;
|
|
|
|
|
|
konyvtarlepes2.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
konyvtarlepes1.SetActive(true);
|
2022-11-12 12:18:08 +01:00
|
|
|
|
moveCounter++;
|
|
|
|
|
|
konyvtarlepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-11 13:42:40 +01:00
|
|
|
|
}
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez?re");
|
|
|
|
|
|
}
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
Debug.Log("Nincs el<65>g akci<63>pontod vagy nem 1 mez?n bel<65>l akarsz l<>pni");
|
2022-11-02 17:24:55 +01:00
|
|
|
|
}
|
2022-11-02 11:15:11 +01:00
|
|
|
|
}
|
2022-11-11 13:42:40 +01:00
|
|
|
|
|
2022-11-02 11:15:11 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-11-02 17:24:55 +01:00
|
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && threefour_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) {
|
|
|
|
|
|
for (int x = 0; x < w; x++) {
|
|
|
|
|
|
for (int y = 0; y < h; y++) {
|
|
|
|
|
|
if (helyek[y, x].Equals("threefour")) {
|
2022-11-02 11:15:11 +01:00
|
|
|
|
Debug.Log("Player clicked on the collider: " + threefour_Collider.gameObject.name);
|
|
|
|
|
|
tavolsag = math.abs((jelenlegi_x + jelenlegi_y) - ((x + 1) + (y + 1)));
|
|
|
|
|
|
|
2022-11-22 14:45:32 +01:00
|
|
|
|
if (korhazlepes1.activeSelf == true & korhazlepes2.activeSelf == true) {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-12-06 11:36:20 +01:00
|
|
|
|
if (tavolsag <= ap.akciopont && ap.akciopont > 0) {
|
2022-11-22 14:45:32 +01:00
|
|
|
|
if (threefourcount < 2) {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
player.transform.position = threefour.transform.position;
|
|
|
|
|
|
jelenlegi_x = 3;
|
|
|
|
|
|
jelenlegi_y = 4;
|
2022-12-06 11:36:20 +01:00
|
|
|
|
ap.akciopont = ap.akciopont - tavolsag;
|
2022-11-12 12:18:08 +01:00
|
|
|
|
Debug.Log(ap.akciopont);
|
2022-11-11 13:42:40 +01:00
|
|
|
|
threefourcount++;
|
2022-11-22 14:45:32 +01:00
|
|
|
|
if (korhazlepes1.activeSelf == true) {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
korhazlepes2.SetActive(true);
|
2022-11-12 12:18:08 +01:00
|
|
|
|
moveCounter++;
|
|
|
|
|
|
korhazlepes2.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
korhazlepes1.SetActive(true);
|
2022-11-12 12:18:08 +01:00
|
|
|
|
moveCounter++;
|
|
|
|
|
|
korhazlepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-11 13:42:40 +01:00
|
|
|
|
}
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
Debug.Log("Maximum k<>tszer l<>phetsz egy mez?re");
|
|
|
|
|
|
}
|
2022-11-22 14:45:32 +01:00
|
|
|
|
} else {
|
2022-11-11 13:42:40 +01:00
|
|
|
|
Debug.Log("Nincs el<65>g akci<63>pontod vagy nem 1 mez?n bel<65>l akarsz l<>pni");
|
2022-11-02 17:24:55 +01:00
|
|
|
|
}
|
2022-11-02 11:15:11 +01:00
|
|
|
|
}
|
2022-11-11 13:42:40 +01:00
|
|
|
|
|
2022-11-02 11:15:11 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2022-11-02 17:24:55 +01:00
|
|
|
|
}
|