PDA

View Full Version : Target Practice - Need help


Cooldude101
01-03-2011, 12:45 AM
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

David B
01-03-2011, 06:44 AM
I'll check it out either later today, or sometime at the end of the week.

arty-fishL
01-04-2011, 04: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.

Cooldude101
01-05-2011, 02: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

Dameria
01-05-2011, 05:25 PM
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).