1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
DanielleElmas [232]
2 years ago
5

I just started game development using unity, I’m trying to control my sphere moving on a flat surface using the W,A,S,D keys, if

anyone knows the code for that using C# ,please help.
Computers and Technology
1 answer:
stepan [7]2 years ago
8 0

Answer:

Assembly c# code

Explanation:

First you must create the sphere.

Second you must declare the velocity variable.

Third we make the movement process with IF sentence

We can choose the arrows or the letters, W, A, S, D keys.

W = up

A = left

S = down

D = right

In this example only you must create the figure and make the relation with the variables.

I attached the c# code.

Download txt
You might be interested in
a cryptarithm is a mathematical puzzle where the goal is to find the correspondence between letters and digits such that the giv
Leokris [45]

Using the knowledge in computational language in C++ it is possible to write a code that  cryptarithm is a mathematical puzzle where the goal is to find the correspondence between letters and digits

<h3>Writting the code:</h3>

<em>#include <bits/stdc++.h></em>

<em>using namespace std;</em>

<em>// chracter to digit mapping, and the inverse</em>

<em>// (if you want better performance: use array instead of unordered_map)</em>

<em>unordered_map<char, int> c2i;</em>

<em>unordered_map<int, char> i2c;</em>

<em>int ans = 0;</em>

<em>// limit: length of result</em>

<em>int limit = 0;</em>

<em>// digit: index of digit in a word, widx: index of a word in word list, sum: summation of all word[digit]  </em>

<em>bool helper(vector<string>& words, string& result, int digit, int widx, int sum) { </em>

<em>    if (digit == limit) {</em>

<em>        ans += (sum == 0);</em>

<em>        return sum == 0;</em>

<em>    }</em>

<em>    // if summation at digit position complete, validate it with result[digit].</em>

<em>    if (widx == words.size()) {</em>

<em>        if (c2i.count(result[digit]) == 0 && i2c.count(sum%10) == 0) {</em>

<em>            if (sum%10 == 0 && digit+1 == limit) // Avoid leading zero in result</em>

<em>                return false;</em>

<em>            c2i[result[digit]] = sum % 10;</em>

<em>            i2c[sum%10] = result[digit];</em>

<em>            bool tmp = helper(words, result, digit+1, 0, sum/10);</em>

<em>            c2i.erase(result[digit]);</em>

<em>            i2c.erase(sum%10);</em>

<em>            ans += tmp;</em>

<em>            return tmp;</em>

<em>        } else if (c2i.count(result[digit]) && c2i[result[digit]] == sum % 10){</em>

<em>            if (digit + 1 == limit && 0 == c2i[result[digit]]) {</em>

<em>                return false;</em>

<em>            }</em>

<em>            return helper(words, result, digit+1, 0, sum/10);</em>

<em>        } else {</em>

<em>            return false;</em>

<em>        }</em>

<em>    }</em>

<em>    // if word[widx] length less than digit, ignore and go to next word</em>

<em>    if (digit >= words[widx].length()) {</em>

<em>        return helper(words, result, digit, widx+1, sum);</em>

<em>    }</em>

<em>    // if word[widx][digit] already mapped to a value</em>

<em>    if (c2i.count(words[widx][digit])) {</em>

<em>        if (digit+1 == words[widx].length() && words[widx].length() > 1 && c2i[words[widx][digit]] == 0) </em>

<em>            return false;</em>

<em>        return helper(words, result, digit, widx+1, sum+c2i[words[widx][digit]]);</em>

<em>    }</em>

<em>    // if word[widx][digit] not mapped to a value yet</em>

<em>    for (int i = 0; i < 10; i++) {</em>

<em>        if (digit+1 == words[widx].length() && i == 0 && words[widx].length() > 1) continue;</em>

<em>        if (i2c.count(i)) continue;</em>

<em>        c2i[words[widx][digit]] = i;</em>

<em>        i2c[i] = words[widx][digit];</em>

<em>        bool tmp = helper(words, result, digit, widx+1, sum+i);</em>

<em>        c2i.erase(words[widx][digit]);</em>

<em>        i2c.erase(i);</em>

<em>    }</em>

<em>    return false;</em>

<em>}</em>

<em>void isSolvable(vector<string>& words, string result) {</em>

<em>    limit = result.length();</em>

<em>    for (auto &w: words) </em>

<em>        if (w.length() > limit) </em>

<em>            return;</em>

<em>    for (auto&w:words) </em>

<em>        reverse(w.begin(), w.end());</em>

<em>    reverse(result.begin(), result.end());</em>

<em>    int aa = helper(words, result, 0, 0, 0);</em>

<em>}</em>

<em />

<em>int main()</em>

<em>{</em>

<em>    ans = 0;</em>

<em>    vector<string> words={"GREEN" , "BLUE"} ;</em>

<em>    string result = "BLACK";</em>

<em>    isSolvable(words, result);</em>

<em>    cout << ans << "\n";</em>

<em>    return 0;</em>

<em>}</em>

See more about C++ code at brainly.com/question/19705654

#SPJ1

3 0
1 year ago
Create a program that has at least three classes. The class with main. A class that defines a Name (first name, middle name, and
Bond [772]

Answer:

See attached file for complete detailed code.

Explanation:

See attached file.

Download txt
3 0
3 years ago
1. Assume that word is a variable of type String that has been assigned a value . Assume furthermore that this value always cont
s2008m [1.1K]

Answer:

1.word = "George slew the dragon"

startIndex = word.find('dr')

endIndex = startIndex + 4

drWord = word[startIndex:endIndex]

2. sentence = "Broccoli is delicious."

sentence_list = sentence.split(" ")

firstWord = sentence_list[0]

Explanation:

The above snippet is written in Python 3.

1. word is initialized to a sentence.

Then we find the the occurence of 'dr' in the sentence which is assign to startIndex

We then add 4 to the startIndex and assign it to endIndex. 4 is added because we need a length of 4

We then use string slicing method to create a substring from the startIndex to endIndex which is assigned to drWord.

2. A string is assigned to sentence. Then we split the sentence using sentence.split(" "). We split based on the spacing. The inbuilt function of split returns a list. The first element in the list is assigned to firstWord. List uses zero based index counting. So. firstWord = sentence_list[0] is use to get first element.

4 0
3 years ago
When the primary key of one relation is placed in a second relation to represent a relationship, the attribute in the second rel
s2008m [1.1K]
It is called a foreign key
6 0
3 years ago
A ___________ is similar to an intranet in that it uses internet technologies, but is developed for users outside the organizati
Vanyuwa [196]
The blank is extranet
I hope this helped!
6 0
2 years ago
Other questions:
  • A simple way to think of the Excel application is as a giant ______.
    5·2 answers
  • You told your sister about creating bullet points with Word 2013. She calls you and says that she created a list of six bullet p
    11·1 answer
  • Motorcycles have two or three wheels, a seat for the rider and at least a ____ horse-powered engine.
    15·1 answer
  • In Load/Store Architecture, memory is only referenced by load and store instructions.
    15·1 answer
  • Describe the best way to deal with a difficult co-worker?
    13·2 answers
  • Who ever likes Pokemon an wants to help me please comment and I will Give the room for My Assignment
    9·1 answer
  • A new attack involves hacking into medical records and then offering these records for sale on the black market. A medical recor
    14·1 answer
  • Create an online order form for a car rental store and include the following items: input text box to enter the number of days i
    14·1 answer
  • 4.(L.5.1.A) Select the sentence that includes an interjection,
    12·1 answer
  • Active directory and 389 directory server are both compatible with which directory access protocol?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!