Game Development Community

Novice scripting advice needed for layers and camera

by Jamie Uhrmacher · in Torque Game Builder · 01/24/2008 (5:12 pm) · 2 replies

In a previous post I posed a question about scripting the camera and its zoom settings.
The folks in these forums were nice enough to help me achieve the results I was seeking.
However, things did not go entirely as expected.

I'm scripting a simple game where the player eats objects (a la the Fish Demo). When they eat a specific number of enemies, the player grows in size. I thought this could be accomplished by zooming the camera out. The problem is that the camera zooms out from everything - the gui, the player, everything.

My question - is there a way to designate objects that will remain at the same scale when the camera zooms out? Can I group objects together on layers and then zoom out from that layer? Or shrink that layer to create the same effect. while keeping the gui layer the same size?

I'm reading the reference material on scene graphs and objects, but I'm not finding the answers I seek.

Thanks in advance!

#1
01/24/2008 (7:23 pm)
Can you just change the size of the player object, instead of trying to do it with the camera?
#2
02/21/2008 (12:17 am)
I think I'll echo what Dan has said, can't you just alter the size of the player sprite using setWidth() and setHeight? You can keep a dynamic scale value on each object as well, and alter this based on the number of 'things' eaten. :)