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
Alex
4 years ago
15

How are XY coordinates utilized in construct ?

Computers and Technology
1 answer:
marshall27 [118]4 years ago
6 0

Answer:

In 2d space we can describe an object's position using 2 values that represent an object's placement on a grid, invisible or not. Typically this is referred to as a 2d coordinate; X and Y. X describes which column the object is in and Y tells what row the object is in. It is pretty much like bingo. A 2d coordinate should look something like these examples: (56,2) or (-1,3). The first number is the X position and tells us how far left or right the position is. The second number is Y and tells us an objects position up and down.

The pixel at the very top left of your screen is always pixel (0,0) - not (1,1). This is because computers always start counting at 0. They think of 0 as being the first position a number can be. This means if your screen is 640 pixels wide, your screen X position will go from 0-639. Any object on screen will have an (x,y) position. and this position can be manipulated by changing these values.

If you subtract from an objects X position it will appear to move left. If you add to it, it will seem as the object is going to the right. Adding to the Y value makes the object go down and subtracting from Y makes it go up.

Just remember: Add to X = right, Subtract from X = left, Add to Y = down, and subtract from Y = Up.

The more you handle (X,Y) coordinates the more second nature this becomes, so don't worry if it seems odd at first.

MOVING AN OBJECT USING VELOCITY

If you simply change an objects position to where you want it to be it will seem as if it is teleporting. Going from (10,10) to (100,100) is a big jump. If you want an object to seem as if it is moving from one place to another then you need to gradually change its position over time. This is an easy process.

In construct 2, a sprite object already has an X and Y position, so all you need to do is create 2 variables, each representing velocity along either the X or Y axis. I normally call them velocityX and velocityY.

Every frame of the game you then add velocity to position. It looks like this below:

notice that I am multiplying velocity by dt. dt stands for Delta Time and tells us how much time has passed since our last frame. Most games will run 60 frames per second, meaning the computer will run the code you made 60 times a second. In this case dt = 0.0166666- or 1/60. Since we want our velocity to be in pixels per second (and not per frame) we multiply velocity by dt. If our velocity was 100 then per frame it would only add 1.6666 to the position of an object. Over the course of a full second the total of the changes will equal 100.

velocity dt frames per second = velocity.

Here is a quick velocity cheat sheet; The velocity of the object is on the left, described using X and Y. The direction the object would be moving as a result is written next to it.

(0,0) - not moving.

(1,0) - moving right.

(-1,0) - moving left.

(0,1) - moving down.

(0,-1) - moving up.

(-1,-1) - moving diagonally up left.

(1,-1) - moving diagonally up right.

(-1,1) - moving diagonally down left.

(1,1) - moving diagonally down right.

Hopefully that wraps it up. Let me know if you have questions.

Introduction to rotation and angles!

You might be interested in
Why is the term RAW image file generally used to describe a variety of file formats, which are sometimes known as digital raw ca
mihalych1998 [28]

Answer:

c. because RAW files are proprietary.

Explanation:

When scanners and digital cameras are used to capture images that are uncompressed or minimally processed image file, it is known as a RAW image file.

Generally, this file type are usually very large in size because of their lossless quality and does not have any alteration and as such have not been processed; thus, cannot be printed.

The term RAW image file is generally used to describe a variety of file formats, which are sometimes known as digital raw captures because RAW files are proprietary.

8 0
3 years ago
The printing press helped spread the ideas of the Renaissance.<br> a. True <br> b. False
guajiro [1.7K]
The answer is a. True

The printing press did help spread the ideas of the Renaissance, as it could spread ideas easily, quickly, and in different languages.

6 0
4 years ago
The author of ""Cyber-psychopathy: What Goes On in a Hacker’s Head"" states that a crucial component of computer hacking lies in
slega [8]

Answer: The statement implies that the hackers psychologically manipulate the human to access the information they need.

Explanation: The author states that the hacker does not only exploits technology to get system access or to gather information. But there is another pivotal part of hacking. He refers to this part as "social engineering".

Social engineering from information security perspective means manipulate human emotions and convincing them to disclose some confidential information. Hacker often hacks or defrauds after gaining confidence and trust of a person.

Phishing is an example. It is a fraudulent technique for getting some secret information. Phisher sends an email pretending to be from some reputable organization to persuade people to divulge private information like passwords and credit card numbers, ATM card pin etc.

5 0
3 years ago
Three uses for Auto Formatting in Word 2016.
sdas [7]

Answer

  1. Auto Numbering and billeting
  2. Auto paragraphing and  indenting
  3. automatically super-scripting and sub-scripting

Explanation

Auto formatting is a software commonly found in word processor such as word 2016 and it is designed to automatically change the appearance of the text. In numbering and bulletin this helps by generating numbers automatically and it makes it easier for the user when typing for does not need to keep on going through the menu bar for numbering. Same case on paragraphing and indenting.  Auto formatting also helps in automatically generating the superscript and subscript. This helps in saving time and also producing a decent and an appealing  work or document.

3 0
3 years ago
According to peacemaking criminology, our society denying a citizen's basic rights is another dimension of
katovenus [111]

Answer:

Violence.

Explanation:

Peacemaking criminology believes that our justice system it's just using a different form of violence to deal with violence.

This movement states that we need to re-enter violent individuals into society, and sees crime as a direct result of a determinate social structure, such as extreme poverty, violent environments, racial hate, etc.

4 0
3 years ago
Read 2 more answers
Other questions:
  • With a two-dimensional array, the ____ field holds the number of rows in the array.
    6·1 answer
  • Write a program that removes all spaces from the given input. Ex: If the input is: Hello my name is John. the output is: Hellomy
    11·1 answer
  • What do space stations, artificial organs, supersonic aircraft, and "high-tech”
    10·1 answer
  • Database applications are seldom intended for use by a single user.
    15·1 answer
  • -How long does a copyright last?
    6·1 answer
  • A(n) _____ describes your core values and highest career goals. A. résumé B. objective statement C. qualifications profile D. pe
    7·2 answers
  • Write a program that creates a Date object, sets its elapsed time to 10000, 100000, 1000000, 10000000, 100000000, 1000000000, 10
    9·1 answer
  • Explain why the scenario below fails to meet the definition of a stakeholder.
    5·1 answer
  • Which phrases in the passage provide clues that trifling means "silliness” or "insignificance”? Check all that apply.
    12·1 answer
  • web browsers save website information in their _________, which helps the site load faster on future visits.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!