Mastermind V2 (1 Viewer)

GannTrader

Portal Member
January 31, 2007
29
0
Home Country
Sweden Sweden
Hi

This is a beta of version 2 of Mastermind.
I publish this to get some feedback before i move on with the AI.
New in this version will be that you will be able to compete against the computer.
NOTE: This betaversion doesnt contain any AI for the computer the computer just randomly pick 4 colors.


There are 4 gametypes available.

Standard:
This is the old Mastermind were you try to find a hidden code that the computer has generated.

Same:
In this mode you and the computer are looking for the same code. The one who findes the code first win.

Different:
In this mode you try to find a hidden code that the computer has generated and the computer tries to find a code that you are thinking of. The one who findes the code first win.

Computer:
In this mode the computer tries to find a code that you are thinking of.


I will probably not write the AI until after the summer. I have written it before but in another language, Amigabasic if someone remember that, but just for level amateur.

If you are running the latest stable version of MP autosave wount work. If running one of the latest SVN releases it should work.

Becourse of a bug in SelectButton the arrows may be missplaced. If running a SVN release i have made a quickfix for this.
NOTE: THIS IS NOT A BUGFIX JUST A QUICKFIX.
The code is borrowed from another part of SelectButtoncode.

Add the code below last in the function SetPosition and rebuild:
// Position right arrow
int x1 = 8;
int x2 = 16;
GUIGraphicsContext.ScaleHorizontal(ref x1);
GUIGraphicsContext.ScaleHorizontal(ref x2);
int dwX = (dwPosX + _width - x1) - x2;

int y1 = 16;
GUIGraphicsContext.ScaleVertical(ref y1);
int dwY = dwPosY + (_height - y1) / 2;
_imageRight.SetPosition(dwX, dwY);
_imageRightFocus.SetPosition(dwX, dwY);

// Position left arrow
dwX = dwPosX + x1;
_imageLeft.SetPosition(dwX, dwY);
_imageLeftFocus.SetPosition(dwX, dwY);


Download Mastermind V2


/GannTrader
 

Psycho Reptile

Retired Team Member
  • Premium Supporter
  • April 19, 2006
    1,316
    787
    Cambridge, England
    Home Country
    United Kingdom United Kingdom
    Hi GannTrader, would it be possible for you to make the board/s user positionable using skin files? Oh, and could you recompile the plugin with the fix you mentioned?
    Thanks...
     

    GannTrader

    Portal Member
    January 31, 2007
    29
    0
    Home Country
    Sweden Sweden
    Hi

    How to make users position the boards using skinfiles i dont know.
    I do now how to change the position dynamicly, using a button for positioning.
    It depends how many here who want that.

    The fix is not part of the plugincode. It part of the hole MPcode so i cant do that.
    If you want to use the fix you will have to compile MP yourself using the latest SVN release.

    /GannTrader
     

    kroko

    Portal Pro
    February 4, 2007
    428
    420
    55
    Itzehoe
    Home Country
    Germany Germany
    Hi GannTrader,

    look into my source from hexxagon. I used a invisible image in the skin. From there I draw my field dynamic. So somebody can change the x and y (startpoint)

    This is very easy and should be OK for most users.

    OnPageLoad()
    ..

    // get position from the start button
    int StartX = GetControl(198).XPosition;
    int StartY = GetControl(198).YPosition;
    // Disable level control
    GUIControl.HideControl(GetID, 198);

    ...

    and in the skin

    - <control>
    <description>hidden hex</description>
    <type>image</type>
    <id>198</id>
    <posX>270</posX>
    <posY>220</posY>
    <width>40</width>
    <height>60</height>
    <texture>\Hexxagon\MyHexx01.png</texture>
    </control>

    Greetz
    kroko

    :D by the way for your nice game and many ideas...
     

    GannTrader

    Portal Member
    January 31, 2007
    29
    0
    Home Country
    Sweden Sweden
    Hi Kroko

    I have maybe misunderstod this.
    I thought that Psycho Reptile wanted to move the boards during a game, at runtime.
    I now suppose that all he wants is to be able to change the x and y position for the boards in the XML-file, skinfile.
    This is possible to do yes.

    /GannTrader
     

    GannTrader

    Portal Member
    January 31, 2007
    29
    0
    Home Country
    Sweden Sweden
    Hi

    Heres v2.10 of mastermind.

    In this version the computerguesses are a bit smarter than before :)
    You can also set the position of the boards by changing in the xml-file.
    If any x- or y-position for the bords are changed from 0 then those positions are used.


    Download Mastermind V2

    /GannTrader
     

    mattroby

    Portal Pro
    June 3, 2006
    73
    5
    Florida
    Home Country
    United States of America United States of America
    v2.10

    Hi

    Heres v2.10 of mastermind.

    In this version the computerguesses are a bit smarter than before :)
    You can also set the position of the boards by changing in the xml-file.
    If any x- or y-position for the bords are changed from 0 then those positions are used.


    Download Mastermind V2

    /GannTrader

    I can't get to this file and would like to d/l it. Is this version the one I should use? Or should I grab the earlier one?

    Thanks.
     

    Users who are viewing this thread

    Top Bottom