"depth" in a stack

Creating Games? Developing something for fun?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Samuele
Posts: 267
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

"depth" in a stack

Post by Samuele » Mon Jan 17, 2022 1:55 pm

Hi, is there a way to make a stack (game) that goes 'deep' or 3D, for example:
Webp.net-resizeimage.png
3D Game
Webp.net-resizeimage.png (149.76 KiB) Viewed 2164 times
Thanks!
Samuele.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 7171
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: "depth" in a stack

Post by richmond62 » Mon Jan 17, 2022 3:34 pm

Sort of.

Basically you have to work out how to scale images so they get smaller the higher up the card they are.
-
Go Away.jpg
Attachments
GO AWAY.livecode.zip
Stack.
(210.95 KiB) Downloaded 39 times

Samuele
Posts: 267
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

Re: "depth" in a stack

Post by Samuele » Mon Jan 17, 2022 6:04 pm

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!
Samuele.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 7171
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: "depth" in a stack

Post by richmond62 » Tue Jan 18, 2022 8:58 am

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.
Last edited by richmond62 on Thu Jan 20, 2022 9:24 am, edited 1 time in total.

Samuele
Posts: 267
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

Re: "depth" in a stack

Post by Samuele » Tue Jan 18, 2022 11:56 am

oh, yes sorry i didn't see the 2 buttons thanks!
Samuele.

Samuele
Posts: 267
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

Re: "depth" in a stack

Post by Samuele » Tue Jan 18, 2022 11:59 am

and a 3D image is possible?
Samuele.

stam
Posts: 1180
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: "depth" in a stack

Post by stam » Tue Jan 18, 2022 1:15 pm

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...

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 7171
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: "depth" in a stack

Post by richmond62 » Thu Jan 20, 2022 9:28 am

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. :D

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 7171
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: "depth" in a stack

Post by richmond62 » Thu Jan 20, 2022 12:32 pm

Stupid things one does in the lunch break:
-
FreeD.jpg
Attachments
Free D.livecode.zip
Here's my stack.
(232.91 KiB) Downloaded 38 times

faber3d
Posts: 3
Joined: Sat Nov 16, 2013 6:51 am

Re: "depth" in a stack

Post by faber3d » Wed Feb 23, 2022 5:44 am

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.
Attachments
comojugarB.png

Samuele
Posts: 267
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

Re: "depth" in a stack

Post by Samuele » Tue Mar 01, 2022 11:45 am

Thank You!
Samuele.

Post Reply

Return to “Games”