Change font size
It is currently Thu Apr 26, 2018 2:25 am

Forum rules


{L_IMAGE}



Post a new topicPost a reply Page 1 of 1   [ 6 posts ]
Author Message
 Post subject: pacman game
PostPosted: Thu Dec 11, 2008 2:26 am 

Joined: Thu Dec 11, 2008 2:20 am
Posts: 5
I created an open source pacman game on GD parcel 2 (177.119.21), it's a good reference for listener scrtips, and collision detection.

have fun playing and scripting ^^,


kef


Top
 Profile  
 
 Post subject: Re: pacman game
PostPosted: Sat Dec 13, 2008 1:35 am 
OSG Elite
User avatar

Joined: Sat Jun 14, 2008 12:28 am
Posts: 384
Location: Australia
Hi, I love opensource too :)

The sign says "copy as much as you want, and use however you like."
Although the script available at your location is neither copyable nor modable.

If you offer this script as reference and as your contribution to the opensource community then I salute you,
however there seems to be some difference between what you advertise and what you actually offer.
Did I miss the open and modifiable script? Where is it available?


Last edited by Cam Chevalier on Sat Dec 13, 2008 8:41 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: pacman game
PostPosted: Sat Dec 13, 2008 4:30 am 
OSG Elite
User avatar

Joined: Thu Jul 31, 2008 2:48 am
Posts: 394
I can appreciate the effort and the intent.
Wouldn't be so harsh or condemning at this point in time, permissions have yet to be stablized or standardized for that matter.
Perhaps a PM to the OP to drop the script or fragments of the script into the scripting Topic is a plea that will be welcomed more easily.
/me shrugs


Top
 Profile  
 
 Post subject: Re: pacman game
PostPosted: Sat Dec 13, 2008 8:37 am 
OSG Elite
User avatar

Joined: Sat Jun 14, 2008 12:28 am
Posts: 384
Location: Australia
Quite right,
I certainly meant no condemnation, I respect anyone who can create something that works.
You can see my intent was to salute Kefcom for offering his work for reference.

If it is a permissions bug, then my remark is void, or misdirected, and yes perhaps a bit hasty in which case I apologize.
no offense intended.

If I misunderstood the offer then I also apologize, and withdraw my remark.

In any case as the creator, you Kefcom have the right to choose how and if you share your work, and if you are sharing this one I would happily have a copy because you have done a nice job.


Top
 Profile  
 
 Post subject: Re: pacman game
PostPosted: Sun Dec 14, 2008 11:20 am 

Joined: Thu Dec 11, 2008 2:20 am
Posts: 5
I will look at it immediatly, it is supposed to be copy/mod/trans


Top
 Profile  
 
 Post subject: Re: pacman game
PostPosted: Sun Dec 14, 2008 11:31 am 

Joined: Thu Dec 11, 2008 2:20 am
Posts: 5
It is supposed to be copy/mod/trans, but looking at it from an alt test account it seems like you are right, therefor I will post the entire script in this topic:

Game Server:
{L_CODE}:
// open pacman game server script by kefcom belgium (kefcom@hotmail.com)

string currentplayer;
integer score;
integer maxscore;
integer timesplayed;
integer timecounter;
string playername1;
string playername2;
string playername3;
string playername4;
string playername5;
integer playerscore1;
integer playerscore2;
integer playerscore3;
integer playerscore4;
integer playerscore5;
integer maxtime;

default
{
    state_entry()
    {
 
  //////////////////////////////////////////////////////////////////////////////////////
        maxscore = 137; //change this value to the number of balls you have on the field
        maxtime = 500;
/////////////////////////////////////////////////////////////////////////////////////
 
        playername1 = "nobody";
        playername2 = "nobody";
        playername3 = "nobody";
        playername4 = "nobody";
        playername5 = "nobody";
        playerscore1 = 300;
        playerscore2 = 300;
        playerscore3 = 300;
        playerscore4 = 300;
        playerscore5 = 300;
        timesplayed = 0;
        score = 0;
        llSetText("Game Server", <1,1,1>,1.0);
        llListen(1966, "","","");
    }
   
    listen( integer channel, string name, key id, string msg)
    {
        if(msg=="STOP")
        {
            llSetTimerEvent(0);
            llSay(0, "Game stopped!");
            timecounter = 0;
            score = 0;
            currentplayer = "nobody";
            llSetText("Game Server, click for stats", <1,1,1>,1.0);
        }
        if(msg=="START")
        {
            score = 0;
            llSetText("Score: " + (string) score, <1,1,1>, 1.0);
            currentplayer = name;
            timecounter = 0;
            timesplayed = timesplayed + 1;
            llSetTimerEvent(1);
        }
        if(msg=="POINTS!")
        {
            score = score + 1;
            llSetText("Score: " + (string) score, <1,1,1>, 1.0);
            if(score >= maxscore)
            {
                //GAME OVER!
                llShout(0, "Game over");
                llSetTimerEvent(0);
                llShout(0, "You needed " + (string) timecounter + " Seconds to complete the game!");
                llSetText("Game Server, Click me for stats", <1,1,1>, 1.0);
               
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// CALCULATE PLACE IN TOP 5 ////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////
               
if(timecounter < playerscore5)
{
    if(timecounter < playerscore4)
    {
        if(timecounter < playerscore3)
        {
            if(timecounter < playerscore2)
            {
                if(timecounter < playerscore1)
                {
                    //first place
                    playerscore5 = playerscore4;
                    playerscore4 = playerscore3;
                    playerscore3 = playerscore2;
                    playerscore2 = playerscore1;
                    playerscore1 = timecounter;
                   
                    playername5 = playername4;
                    playername4 = playername3;
                    playername3 = playername2;
                    playername2 = playername1;
                    playername1 = currentplayer;
               
                    llSay(0, "You are in first place on the scoreboard!");
                }else{
                    //second place
                    playerscore5 = playerscore4;
                    playerscore4 = playerscore3;
                    playerscore3 = playerscore2;
                    playerscore2 = timecounter;
                   
                    playername5 = playername4;
                    playername4 = playername3;
                    playername3 = playername2;
                    playername2 = currentplayer;
               
                    llSay(0, "You are in second place on the scoreboard!");                                  }
            }else{
                    //third place
                    playerscore5 = playerscore4;
                    playerscore4 = playerscore3;
                    playerscore3 = timecounter;
                   
                    playername5 = playername4;
                    playername4 = playername3;
                    playername3 = currentplayer;
               
                    llSay(0, "You are in third place on the scoreboard!");                 
            }
        }else{
                    //fourth place
                    playerscore5 = playerscore4;
                    playerscore4 = timecounter;
                   
                    playername5 = playername4;
                    playername4 = currentplayer;
               
                    llSay(0, "You are in fourth place on the scoreboard!");                 
        }
    }else{
                    //fifth place
                    playerscore5 = timecounter;
                   
                    playername5 = currentplayer;
               
                    llSay(0, "You are in fifth place on the scoreboard!");                 
    }
}else{
    llSay(0, "You were not fast enough to get on the scoreboard");
}
               
               
               
               
               
               
            }
        }
    }
   
    touch_start(integer numdetected)
    {
        //TYPE SCORE LIST!!!
        llSay(0, "SCORE LIST:");
        llSay(0, "1. " + playername1 + " - " + (string) playerscore1 + " seconds.");
        llSay(0, "2. " + playername2 + " - " + (string) playerscore2 + " seconds.");
        llSay(0, "3. " + playername3 + " - " + (string) playerscore3 + " seconds.");
        llSay(0, "4. " + playername4 + " - " + (string) playerscore4 + " seconds.");
        llSay(0, "5. " + playername5 + " - " + (string) playerscore5 + " seconds.");
        llSay(0, "Game has been played " + (string) timesplayed + " times since reset");
    }
   
    timer()
    {
        timecounter = timecounter + 1;
        if(timecounter >= maxtime)
        {
            llShout(1966, "STOP");
            llSay (0, "Game over due to timeout...");
            llSetTimerEvent(0);
            llSetText("Game Server, Touch for stats", <1,1,1>, 1.0);
        }
    }
   
}


Yellow balls:
{L_CODE}:
// open pac-man script by kefcom belgium (kefcom@hotmail.com)

string currentplayer;

default
{
    state_entry()
    {
        llListen(1966, "","","");
    }
   
    collision(integer num_detected)
    {
        if(llKey2Name(llDetectedKey(0)) == currentplayer)
        {
            if(llGetColor(0) != <1.0,0.0,0.0>)
            {
                //food has not been eaten yet
                llShout(1966, "POINTS!");
                llSetColor(<99,00,00>, ALL_SIDES);
            }else{
                // is allready eaten
            }
        }
    }
   
    listen( integer channel, string name, key id, string msg)
    {
        if(msg=="STOP")
        {
            currentplayer = "nobody";
            llSetColor(<99,00,00>, ALL_SIDES);
        }
        if(msg=="START")
        {
            currentplayer = name;
            llSetColor(<1,1,0>, ALL_SIDES);
        }   
    }


}


Start button:
{L_CODE}:
// open pacman game by kefcom belgium (kefcom@hotmail.com)

default
{
    state_entry()
    {
        llSetText("Klick me to play", <1,1,1>,1.0);
    }
    touch_start(integer num_detected)
    {
        llDialog(llDetectedKey(0), "Press Start to play", ["START", "STOP"],1966);
    }
}


Have fun with it!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 6 posts ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
610nm Style by Daniel St. Jules of Gamexe.net