Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Squares and Guns
Old
Jeremytroid
Guest
 
Status:
Posts: n/a
Default Squares and Guns - 05-18-2010, 04:01 PM

I have two totally un-related questions.
1. My custom made person has a random sqaure in their crotch that I didn't make. How do I get rid of it? It acts like a part of the whole object and not a sub-part.
2. I want something to take more than one hit before it's defeated. How? Also, is there a way to make conditions that makes it so that the object only attacks during these conditions?

Thanks in advanced and if you could be very detailed and simple at the same time (don't know any other way to put it) that would be helpfull. I'm only 14 so sorry about all the conditions.
   
Reply With Quote
Old
jediaction
Senior Member
 
jediaction's Avatar
 
Status: Offline
Posts: 5,064
Join Date: Jul 2009
Location: Bel Air, Maryland
Default 05-18-2010, 04:50 PM

Quote:
Originally Posted by Jeremytroid View Post
I have two totally un-related questions.
1. My custom made person has a random sqaure in their crotch that I didn't make. How do I get rid of it? It acts like a part of the whole object and not a sub-part.
2. I want something to take more than one hit before it's defeated. How? Also, is there a way to make conditions that makes it so that the object only attacks during these conditions?

Thanks in advanced and if you could be very detailed and simple at the same time (don't know any other way to put it) that would be helpfull. I'm only 14 so sorry about all the conditions.
Well i have one word "variables". Just make it like in my games...wait...sorry...Storm. In there there will be a health system. You can do the same with enemies. Just make a text for the object. Make it. When its hit, do the "hit" method. Make it in the method the same method i use for counting down bullets or in my counting example.


Website: www.salokingames.com
FaceBook: www.facebook.com/SalokinGames
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 05-18-2010, 06:10 PM

Create a world variable called "Health" (or it can be for each of your objects if you want health for more than one object), and in the method where the bullet collides with the object, set the value of Health to "Health - 15" (you can find this by clicking on health when you put it in the "set value as" and then go to math - subtract - enter value "15"). Then in that same method make an if/else statement saying "if(Health <= 0), run the object.die method" (you can find the "a <= b" function in the world functions tab). You can then make the "die" method somewhere else and do whatever dying animation you want.


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
Old
jediaction
Senior Member
 
jediaction's Avatar
 
Status: Offline
Posts: 5,064
Join Date: Jul 2009
Location: Bel Air, Maryland
Default 05-18-2010, 06:42 PM

Now your tring to walk over me


Website: www.salokingames.com
FaceBook: www.facebook.com/SalokinGames
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 05-18-2010, 06:49 PM

Quote:
Originally Posted by jediaction View Post
Now your tring to walk over me
He asked a question and he wanted steps on how to do it. All you said was variables, so I wanted to show him step by step how to do the variables just in case he doesn't know exactly what variables are or how to use them. I'm just trying to help, I would have said the same thing whether you post that or not. You basically just told him to look at your Storm game when it comes out to see how you did it, I wanted to tell him how to do now, while being as simple and step-by-step as I could be.


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
Old
jediaction
Senior Member
 
jediaction's Avatar
 
Status: Offline
Posts: 5,064
Join Date: Jul 2009
Location: Bel Air, Maryland
Default 05-18-2010, 06:56 PM

But I did say how to do it


Website: www.salokingames.com
FaceBook: www.facebook.com/SalokinGames
   
Reply With Quote
Old
rich0e0rick
Senior Member
 
rich0e0rick's Avatar
 
Status: Offline
Posts: 141
Join Date: Jan 2008
Location: Sturgeon Falls
Default 05-18-2010, 11:32 PM

no jediaction, you told him to do it the way you did it....
that's not the same thing as telling him how to do it.

good explanation Dameria.


im back!!! FINNALY!!! got windows working on my mac again!!!
   
Reply With Quote
Old
jediaction
Senior Member
 
jediaction's Avatar
 
Status: Offline
Posts: 5,064
Join Date: Jul 2009
Location: Bel Air, Maryland
Default 05-19-2010, 07:46 AM

riightttt...


Website: www.salokingames.com
FaceBook: www.facebook.com/SalokinGames
   
Reply With Quote
Old
Jeremytroid
Guest
 
Status:
Posts: n/a
Default 05-19-2010, 03:27 PM

Yeah, Sorry Jedi. But any way thanks a lot to Dameria. And the rest who helped

I'm still not getting the "math" option when I'm setting up the variable or "if else". What I mean is that I'm not finding where I need to put the math for dropping health.

Last edited by Jeremytroid; 05-19-2010 at 03:46 PM.
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 05-19-2010, 05:18 PM

You have to click on where it says world.health (the variable for health) and then there should be a math option at the bottom.
Attached Images
File Type: jpg healthExample.jpg (77.7 KB, 55 views)


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
Reply

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 ©2021, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.