Agartala236
05.07.2020 07:39

те кто знает язык C++ найдите ошибку в коде. using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Chacter : MonoBehaviour

{

public int lives = 3;

public float speed = 4.0f;

public float jumpforce = 1.0f;

public Rigidbody2D PlayerRigidbody;

public Animator charAnimator;

public SpriteRenderer sprite;

bool OnGround;

private void Awake()

{

PlayerRigidbody = GetComponentInChildren();

charAnimator = GetComponentInChildren();

sprite = GetComponentInChildren();

}

void Start()

{

}

void Move()

{

Vector3 tempvector = Vector3.right * Input.GetAxis("Horizontal");

transform.position = Vector3.MoveTowards(transform.position, transform.position + tempvector, speed * Time.deltaTime);

if (tempvector.x 1;

Debug.Log(colliders.Length);

}

private void FixedUpdate()

{

CheckGround();

}

void Update()

{

if (Input.GetButton("Horizontal"))

{

Move();

}

if (OnGround && Input.GetButton("Jump"))

{

jump();

}

}

}

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
Dfhlp
03.04.2021 06:05

#include <iostream>

#include <cmath>

using namespace std;

signed main() {

   ios_base::sync_with_stdio(0);

   cin.tie(0);

   cout.tie(0);

   int n;

   cin >> n;

   int ans = 0;

   int a[n],b[n];

   for(int i = 0; i < n; i++)

       cin >> a[i];

   for(int i = 0; i < n; i++)

       cin >> b[i];

   for(int i = 0; i < n; i++)

       if(a[i] > b[i])

           ans++;

   cout << ans;    

}

P.S что было сложно или непонятно, задача ну очень простая, на реализацию

0,0(0 оценок)
Ответ:
zhigalkinden
03.04.2021 06:05

#include <iostream>

#include <cmath>

using namespace std;

signed main() {

   ios_base::sync_with_stdio(0);

   cin.tie(0);

   cout.tie(0);

   int n;

   cin >> n;

   int ans = 0;

   int a[n],b[n];

   for(int i = 0; i < n; i++)

       cin >> a[i];

   for(int i = 0; i < n; i++)

       cin >> b[i];

   for(int i = 0; i < n; i++)

       if(a[i] > b[i])

           ans++;

   cout << ans;    

}

P.S что было сложно или непонятно, задача ну очень простая, на реализацию

0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота