Alice Community  

Go Back   Alice Community > Alice 3 > How Do I?

Reply
 
Thread Tools Display Modes
Typecasting?
Old
Simpae
Junior Member
 
Status: Offline
Posts: 2
Join Date: Jul 2013
Default Typecasting? - 07-03-2013, 09:48 AM

Hi,

I was wondering if there is any kind of typecasting inside of Alice?
I came across the need to use setOpacity on an object returned by the e.getModels() function of the collision event listener.

Maybe I am missing something here, but all I could achieve was to iterate over the models using the SMovableTurnable type (which allowed me to transform the objects but not anything else).

g
simon
   
Reply With Quote
Typecasting
Old
djslater107
Administrator
 
Status: Offline
Posts: 190
Join Date: Jan 2007
Default Typecasting - 07-04-2013, 09:43 AM

There is no typecasting form within Alice at this time...

Of course, if you will import your world into Netbeans, you will then have full access to Java, and be able to cast there...

All the best,


Don Slater
Alice Team
Carnegie Mellon University
   
Reply With Quote
Assure
Old
clk4suport
Junior Member
 
Status: Offline
Posts: 12
Join Date: Nov 2013
Location: new delhi
Default Assure - 12-18-2013, 01:08 AM

Hi there,

Sorry , but there is no typecasting in alice at present time.

Thank You
   
Reply With Quote
Old
yossiy
Member
 
Status: Offline
Posts: 19
Join Date: Apr 2012
Location: Tel Aviv, Israel
Default 11-08-2022, 02:27 PM

Hi,
Has there been any change on this issue in the past 9 years?
I'm trying to build a game in which one object (wolf) chases a few targets. The "CollisionStarted" event returns as parameters the objects that collided, but they are SThing, and I would like to cast them down to "Coyote" so I can get the item that was hit to do something.
The only option I found was to to run comparison between the parameter and each one of the targets. There must a be a better way than that, right?
   
Reply With Quote
'isColliding' function
Old
mlam
Administrator
 
Status: Offline
Posts: 6
Join Date: Oct 2021
Default 'isColliding' function - 11-08-2022, 11:51 PM

the isColliding function lets you iterate through an array of any type.

For each coyote in <array> ... if isColliding == true, then coyote Do Something
   
Reply With Quote
Reply

Tags
collision, type, typecasting

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.