Alice Community  

Go Back   Alice Community > Alice 2 > Works-In-Progress

Reply
 
Thread Tools Display Modes
Target Practice - Need help
Old
Cooldude101
Guest
 
Status:
Posts: n/a
Default Target Practice - Need help - 01-02-2011, 11:45 PM

i thought i made it correctly but when i click a target it always says error so if someone can show me the problem ill be greatfull i think it would be something small but i cant see it
Attached Files
File Type: a2w game.a2w (535.7 KB, 8 views)
   
Reply With Quote
Old
David B
Senior Member
 
David B's Avatar
 
Status: Offline
Posts: 1,145
Join Date: Dec 2010
Location: N/A
Default 01-03-2011, 05:44 AM

I'll check it out either later today, or sometime at the end of the week.
   
Reply With Quote
Old
arty-fishL
Senior Member
 
arty-fishL's Avatar
 
Status: Offline
Posts: 1,878
Join Date: Mar 2008
Location: In the corner of your eye
Lightbulb 01-04-2011, 03:31 PM

ah, look at the events from "when mouse is clicked on help1" downwards. In the event > do together > If/else > loop you have a bit that increments score by one, but as of "when mouse is clicked on help1" downwards it is set to increment None by one for some reason. Alice hates null pointers, so you have to go through each of these replacing None with score.

Just to say, instead of having lots of "when mouse is clicked on" events you could just have had "when mouse is clicked on object under mouse cursor" and had a method with an object parameter set to that. Then used that parameter for each of the things repeated in the events. But dont go changing that all now as the code will just get too messed up.


█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█
█░░▓░░░░░░░▓░░░░░░░░░░░▓▓░░▓░░░░░░▓░░░▓░░░░█
█░▓░▓░▓▓▓░▓▓▓░▓░▓░░░░░░▓▒▒░░▒░░▓▓░▓▓▓░▓▒░░░█
█░▓▓▓▒▓▒▒▒░▓▒▒▓▓▓▒▓▓▓░▓▓▓░░▓░░░▓▒▒▓▒▓▒▓▒░░░█
█░▓▒▓▒▓▒░░░▓▓░░▒▓▒░▒▒▒░▓▒▒░▓▓░▓▓▒░▓▒▓▒▓▒░░░█
█░▓▒▓▒░▒░░░░▒▒▓▓▓▒░░░░▓▓▒░░░▒▒░▒▒░░▒░▒▓▓▓░░█
█░░▒░▒░░░░░░░░░▒▒▒░░░░░▒▒░░░░░░░░░░░░░░▒▒▒░█
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█

I have mostly moved on from Alice, but may still respond to messages if important [¬º-°]¬
   
Reply With Quote
Old
Cooldude101
Guest
 
Status:
Posts: n/a
Default 01-05-2011, 01:58 AM

Thanks so much and if i set it to under mouse which i originally planned then couldnt the person click on the ground and get points because the grounds an object
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 01-05-2011, 04:25 PM

Quote:
Originally Posted by Cooldude101 View Post
Thanks so much and if i set it to under mouse which i originally planned then couldnt the person click on the ground and get points because the grounds an object
Well I didn't look at the program, but guessing by your concern I think you could either make a code to say "if(object under mouse cursor) is not (ground), then give points", this way any object pressed other than the ground would give the points. Also if you just want a certain list of targets to get points when touched, you could create a world variable object list and assign all of the targets to that, and then say "For all together, if(object under mouse cursor) = (item_from_targetsList).


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


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.