Page 1 of 1
"depth" in a stack
Posted: Mon Jan 17, 2022 1:55 pm
by Samuele
Hi, is there a way to make a stack (game) that goes 'deep' or 3D, for example:
- 3D Game
- Webp.net-resizeimage.png (149.76 KiB) Viewed 7356 times
Thanks!
Re: "depth" in a stack
Posted: Mon Jan 17, 2022 3:34 pm
by richmond62
Sort of.
Basically you have to work out how to scale images so they get smaller the higher up the card they are.
-
Re: "depth" in a stack
Posted: Mon Jan 17, 2022 6:04 pm
by Samuele
allright, didn't think of that, so i need to write "for every +1 in the Yloc of the 'ball' resize it to -1", i don't think this scri'pt makes sense, how can i write it the right way?
Thanks!
Re: "depth" in a stack
Posted: Tue Jan 18, 2022 8:58 am
by richmond62
so i need to write "for every +1 in the Yloc of the 'ball' resize it to -1"
my code looks nothing like that: it is much simpler.
Re: "depth" in a stack
Posted: Tue Jan 18, 2022 11:56 am
by Samuele
oh, yes sorry i didn't see the 2 buttons thanks!
Re: "depth" in a stack
Posted: Tue Jan 18, 2022 11:59 am
by Samuele
and a 3D image is possible?
Re: "depth" in a stack
Posted: Tue Jan 18, 2022 1:15 pm
by stam
I don't think there is a 3D library for LC (pretty sure there's no official openGL implementation or similar).
And besides, managing 3D can be orders of magnitude more complex.
If it's just a simple animation needed, scaling/moving 2D objects may be a lot simpler...
Re: "depth" in a stack
Posted: Thu Jan 20, 2022 9:28 am
by richmond62
and a 3D image is possible?
Not as far as I know.
I wrote;
Sort of.
So any '3D' in LiveCode is either going to be:
1. A simple 'fake' like my example.
2. Horribly complicated Mathematics.
3. Something else rolled into LiveCode.
However, a little bit of thought should show you that using
scaling (as in my example)
and
layer changes you can do really quite well.
Re: "depth" in a stack
Posted: Thu Jan 20, 2022 12:32 pm
by richmond62
Stupid things one does in the lunch break:
-
Re: "depth" in a stack
Posted: Wed Feb 23, 2022 5:44 am
by faber3d
It is a good example... I would also recommend the use of the accelerometer in livecode, especially for a racing game, its use would be ideal.
A few years ago I developed a game using this sensor on mobile phones.
Re: "depth" in a stack
Posted: Tue Mar 01, 2022 11:45 am
by Samuele
Thank You!