ptrelford avatar ptrelford committed eb05a2e

Adjusted score size & position

Comments (0)

Files changed (5)

PacMan.Xaml/App.fs

                 TextBlock(
                     FontFamily=FontFamily("Courier New"),
                     Foreground=whiteBrush, 
-                    FontSize=8.0,
+                    FontSize=15.0,
                     FontWeight=FontWeights.ExtraBold,
                     Text=text
                 )
 type GameControl () as control =
     inherit UserControl(Background=SolidColorBrush Colors.Black, IsTabStop=true)
     let keys = Keys(control)
-    let width, height = 28.0 * 8.0, (32.0+4.0) * 8.0
+    let width, height = 28.0 * 8.0, (32.0+3.0) * 8.0
     let grid = Grid(Background = SolidColorBrush Colors.Black)
     let canvas = Canvas(Background = SolidColorBrush Colors.Black)
     do  canvas.Width <- width; canvas.Height <- height

PacMan.Xaml/Main.cs

             {
                 Background = new SolidColorBrush(Colors.Black),
                 Width = 28 * 8,
-                Height = (32 + 4) * 8
+                Height = (32 + 3) * 8
             };
             var clip = new RectangleGeometry
             {

PacMan.Xaml/PacMan.Silverlight.fsproj

         <SilverlightProjectProperties>
           <StartPageUrl>
           </StartPageUrl>
-          <StartAction>DynamicPage</StartAction>
+          <StartAction>OfflineApplication</StartAction>
           <AspNetDebugging>True</AspNetDebugging>
           <NativeDebugging>False</NativeDebugging>
           <SQLDebugging>False</SQLDebugging>

PacMan.Xaml/PacMan.fs

     let add item = scene.Contents.Add(item)
     let remove item = scene.Contents.Remove(item)
     let contains item = scene.Contents.Contains(item)
-    let set (element:IContent) (x,y) = element.Move(x - 16 |> float, y + 16 |> float)
+    let set (element:IContent) (x,y) = element.Move(x - 16 |> float, y + 8 |> float)
     let maze = "
 ##/------------7/------------7##
 ##|............|!............|##
         bonuses <- remainders
         removals |> List.iter (fun (_,x) -> remove x)
 
+    let p1 = createText("SCORE")
+    do  p1.Move(0.0,0.0); scene.Contents.Add(p1)
+    let s1 = createText("")
+    do  s1.Move(5.0*8.0,0.0); scene.Contents.Add(s1)
+    //let hi = createText("HIGH")
+    //do  hi.Move(15.00*8.0,0.0); scene.Contents.Add(hi)
+    //let s2 = createText(sprintf "%7d" 0)
+    //do  s2.Move(20.0*8.0,0.0); scene.Contents.Add(s2)
+
+    let updateScore () =
+        s1.SetText(sprintf "%7d" score)
+
+    do  updateScore ()
+
     let update () =
         updatePacman ()
         updateGhosts ()
         updateFlash ()
         updatePower ()
         updateBonuses ()
-
-    let p1 = createText("1UP")
-    do  p1.Move(2.0*8.0,0.0); scene.Contents.Add(p1)
-    let s1 = createText("00")
-    do  s1.Move(0.0,8.0); scene.Contents.Add(s1)
+        updateScore ()
 
     member this.Update () = 
-        s1.SetText(sprintf "%8d" score)
         update ()

PacMan.Xaml/TextContent.cs

                 new TextBlock {
                     FontFamily=new FontFamily("Courier New"),
                     Foreground=new SolidColorBrush(Colors.White), 
-                    FontSize=8.0,
+                    FontSize=15.0,
                     FontWeight=FontWeights.ExtraBold,
                     Text=text
                 };
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.