Zarxrax
Veteran
I could probably put in a slight delay after the timer is stopped in order to prevent accidentally restarting it.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
I did try holding down two buttons in stackmat fashion, but after that you can still stop it with one button. Am I missing something?
Ah so you are saying you dont want it to stop unless you press both sides... hmmm, I hadn't considered that.
Yes, that's how a stackmat works. If implemented you should have an option to choose one button or stackmat mode.
Hmm, well I'm wondering if it's really worth it. I assume the most important thing here is keeping both hands off the cube when the timer *starts*, as once it's finished I don't think it would make any difference in your time whether you stop the timer with one hand or both hands (am I wrong?). Trying to slap both ends of a ds at the same time to stop it should actually be much harder to accomplish than slapping a stackmat, and would probably harm your times, I would think. (if you tend to miss or something)
As it is, you *can* slap both ends to stop it, it will just stop as soon as the first press is recognized. Is this that unacceptable? If it is I can try to change it this weekend.
void loadMap(void)
{
FILE *lvlset;
//brick br[144];
int p = 0;
int num = 2;
int x = 5;
int y = 5;
int rowCount = 0;
char nameline[17];
char temp = 'n';
char grid[145];
lvlset = fopen("Diamonds.txt","r");
PA_LoadSpritePal(0, 1, (void*)block_lb_Pal);
//PA_CreateSprite(0, 10, (void*)block_Sprite, OBJ_SIZE_32X32, 1, 1, 50, 50); // Added this back just to see what a block shoudl look like
if(lvlset==NULL)
while(1);
else
{
//PA_OutputText(1,1,1,"file open"); //testing line
//PA_WaitFor(Pad.Newpress.Start); //testing line
if(prev == LEVEL)
{
lvlset += counter;
while(temp != '/')
{
temp = fgetc(lvlset);
nameline[p] = temp;
p++;
counter++;
}
nameline[p-1] = '\0'; //to terminate your string - I had a mistake here, should be p-1 not p or p+1...
PA_OutputText(1,0,0,"%s",nameline); //testing line
//PA_WaitFor(Pad.Newpress.Start); //testing line
p = 0;
prev = NAME;
}
//here you could start parsing the grid. I noticed that there was an extra / after the first grid line below Simpleton, so you'll want to remove that.
//Also there are spaces at the end of each line so that can pose a problem if you kept using fgetc to pick up each grid item
//okay, so the level grid could be char grid[145] or something like that (1 larger than 12x12) or... possibly you could have an
// integer array instead and if a certain character were met in the file the array would be filled with a particular number. Each number would have to
//refer to some character and you'd end up needing another key of some kind if you went that way...
//anyway, there are options from here forward so let me know if you need any more help!
if(prev == NAME)
{
lvlset += counter;
while(temp != '/')
{
temp = fgetc(lvlset);
grid[p] = temp;
p++;
counter++;
}
grid[p-1] = '\0';
p = 0;
while(p != 145)
{
if(grid[p] == '~')
{
PA_CreateSprite(0, num, (void*)block_Sprite, OBJ_SIZE_32X32, 1, 1, x, y);
num++;
}
x += 20;
rowCount++;
if(rowCount == 12)
{
x = 5;
y += 12;
}
p++;
}
p = 0;
prev = LEVEL;
}
fclose(lvlset);
}
}
DO WHAT THE **** YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar
14 rue de Plaisance, 75014 Paris, France
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE **** YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE **** YOU WANT TO.
I see what you are saying. Especially since you can't "throw" the cube down because it would hit the top screen.![]()