My examples

0 favourites
  • Weishaupt, I think i do.

    The player might be able to somehow trick your score variable into something its not. So by comparing it to a anticheat variable then they cannot really change it. <-- Its just like building another wall to defend :).

    But im pretty sure if a user is smart enough to somehow cheat your score variable. then surely they can cheat the antischeat one <img src="smileys/smiley5.gif" border="0" align="middle" />

  • great examples thanks for sharing.

  • Did a little tweaking on Ize's gesture capx (:

    gestureMod.capx

  • How to run this hiscore example. First I have exported it to html5 from Construct2. Then I dropped created files to my server with those php files from example, and when i press left or right arrow nothing is displaying, only white board.

    I have win7 64bit and using firefox 9.01 if that helps

  • >

    > Anti Cheat Protection

    > Simple Anti Cheat protection

    > http://dl.dropbox.com/u/45711709/anticheat.capx

    >

    This one, I do not understand <img src="smileys/smiley5.gif" border="0" align="middle">

    The idea is that he's keeping the score in two variables instead of one. If somebody uses a cheating tool and modifies the score in one, the game would detect that it's now different from the other one and take some action.

    To be honest though that is rather pointless- if you take the time to develop a cheat then fixing two variables will not be more work than just fixing a single one.

  • OK i got this working, but where and how do i have to put my variables for user:

    I want this:

    When level is finished -> display text field where user could enter their name -> and when hitting enter the hiscore board is displayed with actual score and name of that user.

    Now i've got only this and don't know how to replace NEWENTRY and 1337 for variables:

    "post.php?name=NEWENTRY&score=1337"

    "readscores.php?num_scores=10"

  • you should add a Text box on your layout where the player will enter his name, and on click on the validation button, you will send an Ajax request that will look like :

    -> Ajax: Request "http://yourURL/post.php?name="&Textbox.text&"&score="&score (tag "sendScore")
  • Thanks Yann, with your fantastic help I was able to get it right, but now I have another question.

    I want to do this hiscore thing with spritefont plugin, but scores are displayed inline(player1,30,player2,50...and so on) with that plugin and i don't have to say that it looks bad.

    How to make them display in block like in normal font.

  • haha inline, inblock, you talk like a css guy.

    Well, I'm not sure how your datas are returned by your php script but you should either return them with "\n" at the end of each line, or with a special character.

    For example if you use "|" you can do

    +Ajax: On "hiscore" completed
      +for "" from 0 to tokencount(Ajax.LastData,"|")
        -> spritefont: append text tokenat(Ajax.LastData,loopindex,"|")
        -> spritefont: append text newline
  • Yes I know that inline and block was in css, and i thought that it describes the situation quite well:D

    I must doing something wrong. When i put your code in event sheet everything is good, but no results in game, hiscores still displays in one line and not in a block. This spritefont is a plugin i have found in this forum. It's a sprite, so i think i can't append text to it :(

    Anyway here are my screenshots, I hope they are allowed here.

    First is this Spritefont object events(they are not mine, they were in example of usage)

    second are the request to php

    and the third is your Ajax condition, on my events:

    I checked the post.php file, and it has this "\n" at the end

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You are obviously not using the spritefont plugin

  • hey Yann thanks for cleaning up the gesture.capx a bit :)

  • Ize, Whilst your here <img src="smileys/smiley2.gif" border="0" align="middle" /> What do i need to add to the PHP to get the rank of the player? I know it orders them but if i wanted to display the rank? <img src="smileys/smiley1.gif" border="0" align="middle" />

    thanks.

  • to be honest i never got that far :)

    you'd have to write your own function to sort the array either in php or in c2

  • ahhh ok i'll have a look online <img src="smileys/smiley1.gif" border="0" align="middle" />

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)