The position y of an object is changed for no apparent reason

every time the player wins he launches a series of instructions to make the chest show up in the middle of the screen, but when I run it it doesn't come out in the middle, position x works fine but position y does not work, until and tried Put any number and it goes to the same place, until I tried to execute the position block after everything happened and there if it works well, I noticed and there is no block in the project that changes the position y of that object

please help

Your png files have dimensions (H x W) which all have a 'y' value. If the 'object' is an image, this is logical it will have a different position when compared to a different image.

Set y to half the screen height minus half the height of your object.

ie y = (screen height / 2) - (object height / 2)

you are not understanding me i know to center an object

the problem is that no matter what position y I put, it will always move in the same position y

I do not compare it with anything, I put my images by percentages of the screen

compared to the dimensions of another image it might replace. When you do not show images showing what happens versus what you expect to happen and provide incomplete code showing what you are doing, how do you expect specific advice when the people here cannot run your code? :cry:

  1. I do not want to share my code, besides I gave characteristics of what happens, there is not even a block in the code that changes the position y of the object other than that
  2. I'm not talking about size or center

Don't you have to do the same you did for Ancho (width)?

Y=(play.alto / 2 ) - (R.alto /2)

If not, then I don't understand your question. Explain simply where do you want the chest to show up and where is actually showing up right now.

si deberia, pero si lo hago es lo mismo, osea no se porque no importa lo que ponga va estar a la misma altura

llevo todo el dia con el mismo tema

y nesecito la respuesta

ignore the operation that makes the position y

pls i really need help

how can anyone help if you refrain from showing us what you are doing?
probably this can help

Taifun

the "win" procedure executes what I said

If you are asking for help, I recommend you to make it as easy for others to be able to help you ...
You probably will get more feedback then...

which means in your case post a screenshot of your relevant blocks...

To download the aia file, upload it to App Inventor, open it, do some bug hunting for you, etc... this takes time, and most people will not do that...
Thank you.

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

sorry, it's hard to explain if you don't have the code, up there I put the .aia

I'm running your game. How do I make the chest to show up? I've been watching the game but it never shows up.

kill enemies