Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Points scoring system

Author
Message
kirtn14
12
Years of Service
User Offline
Joined: 8th Sep 2011
Location:
Posted: 29th Jan 2012 20:00
Ive made most of my app and no I want to add a scoring system so when ever one sprite hits another it adds to your score, points based scoring system or time based which ever one anyone knows

kirtnicholls
Talairina
18
Years of Service
User Offline
Joined: 9th Jan 2006
Location: United Kingdom
Posted: 29th Jan 2012 20:08
Are you asking for us to create the code for you or just for ideas on the type of scoring you could do? You'd need to give us some context for a scoring system. For example what's the aim of the game? You mention sprite's colliding, so you could easily have for each collision check you do, add a number to a scoring variable and display it on screen.

Lots of different ways to do it really.
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 29th Jan 2012 20:13
score = score + 1

3d point in space
14
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 30th Jan 2012 17:07
I think he wants a hi score and stuff, by the looks of it. try and keep your scores in a array, Then when a player gets a new high score sort the array out. An easy way of doing this is to have something like this.

this is c++ code.


agk:eleteText(3);
string first="a";
string second="a";
string third="a";
string fourth="a";
agk::CreateText(4,"High Score");
agk::SetTextSize(4,60);
agk::SetTextPosition(4,100,0);

//firstcharpos=0;
//seccharpos=0;
//thirdcharpos=0;
//fourthcharpos=0;
//agk::AddVirtualButton(
if(agk::GetVirtualButtonExists(1)==0)
{
agk::AddVirtualButton(1,200,175,50);
agk::AddVirtualButton(2,250,175,50);
agk::AddVirtualButton(3,300,175,50);
agk::AddVirtualButton(4,350,175,50);
agk::AddVirtualButton(5,200,300,50);

agk::AddVirtualButton(6,250,300,50);
agk::AddVirtualButton(7,300,300,50);
agk::AddVirtualButton(8,350,300,50);
}
for(int x=0; x<=8;x++)
{
switch(x)
{
case 1:
{
if(agk::GetVirtualButtonPressed(1)==1)
{
firstcharpos--;
if(firstcharpos<1)
{
firstcharpos=26;
}
}
break;
}
case 2:
{
if(agk::GetVirtualButtonPressed(2)==1)
{
seccharpos--;
if(seccharpos<1)
{
seccharpos=26;
}
}
break;
}
case 3:
{
if(agk::GetVirtualButtonPressed(3)==1)
{
thirdcharpos--;
if(thirdcharpos<1)
{
thirdcharpos=26;
}
}
break;
}
case 4:
{
if(agk::GetVirtualButtonPressed(4)==1)
{
fourthcharpos--;
if(fourthcharpos<1)
{
fourthcharpos=26;
}

}
break;
}
case 5:
{
if(agk::GetVirtualButtonPressed(5)==1)
{

firstcharpos++;
if(firstcharpos>26)
{
firstcharpos=1;
}
}
break;
}
case 6:
{
if(agk::GetVirtualButtonPressed(6)==1)
{
seccharpos++;
if(seccharpos>26)
{
seccharpos=1;
}
}
break;
}
case 7:
{
if(agk::GetVirtualButtonPressed(7)==1)
{
thirdcharpos++;
if(thirdcharpos>26)
{
thirdcharpos=1;
}
}
break;
}
case 8:
{
if(agk::GetVirtualButtonPressed(8)==1)
{
fourthcharpos++;
if(fourthcharpos>26)
{
fourthcharpos=1;
}
}
break;
}

}
}

first=first[0]+firstcharpos-1;
second=second[0]+seccharpos-1;
third=third[0]+thirdcharpos-1;
fourth=fourth[0]+fourthcharpos-1;

tempstr=first+second+third+fourth;
agk::CreateText(3,tempstr.c_str());
agk::SetTextPosition(3,200,225);
agk::SetTextSize(3,60);

return tempstr;

[\code]
this is what it looks like * are buttons and a is a char that changes as you press the upper button or lower button.

* * * *
a a a a
* * * *

basically this makes the user input his initials. Don't need this if you have game center.

Go through yourself at a wall.
Talairina
18
Years of Service
User Offline
Joined: 9th Jan 2006
Location: United Kingdom
Posted: 31st Jan 2012 00:46
3d can you edit that post please and wrap the code within the code tags. That would be ['code] ['/code] without the '. It seems like you've tried to but the first code tag is either mistyped, missing or broken. Thanks.

Login to post a reply

Server time is: 2024-05-06 02:19:51
Your offset time is: 2024-05-06 02:19:51