Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   Works-In-Progress (http://www.alice.org/community/forumdisplay.php?f=14)
-   -   Helping hand needed... (http://www.alice.org/community/showthread.php?t=11442)

Pawn Nub 02-26-2016 03:18 PM

Helping hand needed...
 
1 Attachment(s)
Hey guys, I'm pretty new to Alice, but I managed to figure a couple things out pretty quickly.

Unfortunately, this game I've been working on is just not going my way today.

The game is pretty simple in logic, where you are in a complex with multiple rooms, and you try to move to the red box on the minimap in order to win without getting caught by the bogeyman.

However, I just can't seem to work out a portion of the game where after you click a door, it moves the minimap ENDLESSLY.

It keeps looping on and on... and even if it doesn't loop, I've also seen another problem where the variables for your location in the game will reset every time you go back to that method.

The program is still majorly unfinished, and I haven't added any code for the controls of the bogeyman as well... as this problem drained all my motivation.

I'm sorry if my description is a little vague, but I would loveeeeee to get some feedback on this.

Thanks.

RavenOfCode 02-27-2016 07:30 AM

I'm not really sure I understand what your problem is? Do you want it to move the minimap endlessly? Were do you want the minimap to be?

sfunk 02-27-2016 01:01 PM

Mini Map Help
 
1 Attachment(s)
Check out the world I created to try to help give you an idea of how to make your mini map simpler.

Hope it helps,
Seth

Pawn Nub 02-29-2016 03:02 PM

RavenOfCode,

I wanted the game to move the triangle to where your location on the minimap would be after you click a door. I don't want it to finish the "For" loop, but rather I wanted to immediately stop checking every increment on the "For" loop and wait for further instructions once a certain condition has been achieved.

So "For" loops work by looping a certain amount of times right? Such as "For all numbers 1-10" then it will go over every number to loop a total of 10 times.

But say I wanted the loop to stop at 6 because a certain command is at that number instead of going through all 10, how would I do that? I can't make it so that it stops looping once I hit a certain variable in the "For" loop.

So basically, I made an array of every location possible for the minimap, and once a door is clicked, then the "Minimap controls" method will then use the statement "If (variable) 'where you are' = (item from array) 'item_from_Where you could be" to skip every increment of the "For" loop until the 'item_from_Where you could be" matches your actual location which is recorded in the variable 'where you are'.

Then it supposedly should move the triangle to the corresponding square from 'item_from_Where you could be'

But the "For" loop will keep running. So lets say that I do hit condition 6 out of 10 on my example previously, what my problem is is that it will continue to check condition 7, 8, 9, and 10.

I just want to stop the "For" loop once the triangle moves once basically.

I'm sorry that this is a wall of text... but I'm kinda new at trying to explain this.

chickentree 03-02-2016 09:13 PM

Quick Comments
 
Short answer:

1) Remember the first unprinted rule of programming: The darn thing does exactly what you tell it to!

2) In Minimap Movement there is nothing to stop the "for all ..., one ... at a tiime" the loop when a match is found. So if you select Forward, and start at 15, the index changes to 16 and, since 16 matches the next entry it increases to 17 and so the MiniMap continues to update until the last element is reached.
3) I have found using 3D text as and mouse clicks together can be problematic. Sometimes the event is not fired at all and other times it only works if you click on the ink.
4) Make sure the camera is pointing where you want it before moving it. Remember it might not be where you originally set it.
5) Other things to look at:
Use opacity and isShowing for an object at the same time in not recommended. If you are not using transparency (opacity between 0 and 1) then stick with isShowing.
The position of the current object should be stored in a world variable otherwise you minimap method will always start at 15 regardless of the previous position of the triangle.

Finally I would recommend writing several "helper" functions to do things like:[LIST=1][*]Set and clear isShowing for your controls so that it is easier to turn them on and off without missing controls.[*]Functions to select the index of the next location. This involves using Mod() and if statements to keep the triangle within the allowed range.[/LIST]


All times are GMT -5. The time now is 12:03 PM.

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