Alice Community  

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

Reply
 
Thread Tools Display Modes
Helping hand needed...
Old
Pawn Nub
Junior Member
 
Status: Offline
Posts: 2
Join Date: Feb 2016
Default Helping hand needed... - 02-26-2016, 03:18 PM

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.
Attached Files
File Type: a2w Scary game.a2w (1.72 MB, 9 views)
   
Reply With Quote
Old
RavenOfCode
Senior Member
 
RavenOfCode's Avatar
 
Status: Offline
Posts: 409
Join Date: Oct 2013
Location: Northern Virginia
Default 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?


Stuff + Other Stuff + Different Other Stuff = Things :)

My best Alice game:

Clash of the Cubes (an arena fighting game):
http://www.alice.org/community/showthread.php?t=10738&highlight=game
   
Reply With Quote
Mini Map Help
Old
sfunk
Senior Member
 
sfunk's Avatar
 
Status: Offline
Posts: 1,112
Join Date: Mar 2011
Location: I don't know
Default Mini Map Help - 02-27-2016, 01:01 PM

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
Attached Files
File Type: a2w Mini_Map_Help.a2w (210.1 KB, 7 views)


If you are stuck on a project, check out the tutorials I made here at this link:

http://alice.org/community/showthread.php?p=36778#post36778

There are lots of tutorials on it so far, including some youtube videos, check it out

Or..

Go to my youtube channel to check out my alice 2.2 tutorials I have there..

http://www.youtube.com/user/sfunk1992?feature=mhsn
   
Reply With Quote
Old
Pawn Nub
Junior Member
 
Status: Offline
Posts: 2
Join Date: Feb 2016
Default 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.
   
Reply With Quote
Quick Comments
Old
chickentree
Super Moderator
 
Status: Offline
Posts: 250
Join Date: Dec 2012
Location: Frosno, Ca
Default Quick Comments - 03-02-2016, 09:13 PM

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:
  1. Set and clear isShowing for your controls so that it is easier to turn them on and off without missing controls.
  2. Functions to select the index of the next location. This involves using Mod() and if statements to keep the triangle within the allowed range.


Mark Henwood
mhenwood@ieee.org
   
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 ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.