mrminecrafttnt wrote:
In an example case: An cheater will try to set the Highscore in an game from 1245670 to 99999999 so he simply uses cheatengine, scans the memory for 1245670 and sets this to 99999999. Exactly this will i prevent with any methods and ideas...
Ok, thank you :)
Now it's clear enough ! but I have no idea for now.
edit:
I have found this so far...
Code: Select all
#include "fbgfx.bi"
#macro _ExitforOnEscapeKeyPressed
if inkey()=chr(27) then exit for
#endMacro
type SCREENTEST extends OBJECT
'global variable container
'storing screen parameter
declare static sub TestScreen()
static as integer scrW
static as integer scrH
end type 'SCREENTEST <- OBJECT
dim as integer SCREENTEST.scrW => -1
dim as integer SCREENTEST.scrH => -1
sub SCREENTEST.TestScreen()
screenInfo (SCREENTEST.scrW, SCREENTEST.scrH)
end sub 'SCREENTEST.TestScreen()
type INTERACTIONTEST extends SCREENTEST
'global variable container
'storing mouse/keyboard interaction
declare static function TestMouse() as long
declare static function TestKeyboard() as long
static as long gmX
static as long gmY
static as long gmBtn
static as long scanCode
end type 'INTERACTIONTEST <- SCREENTEST <- OBJECT
dim as long INTERACTIONTEST.gmX => -1
dim as long INTERACTIONTEST.gmY => -1
dim as long INTERACTIONTEST.gmBtn => -1
dim as long INTERACTIONTEST.scanCode => -1
function INTERACTIONTEST.TestMouse() as long
return getMouse ( INTERACTIONTEST.gmX, _
INTERACTIONTEST.gmY, _
, _
INTERACTIONTEST.gmBtn )
end function 'LNG:=INTERACTIONTEST.TestMouse()
function INTERACTIONTEST.TestKeyboard() as long
dim as long scanCodeResult => -1
if multiKey(fb.SC_BACKSPACE) then
scanCodeResult = fb.SC_BACKSPACE
elseif multiKey(fb.SC_SPACE) then
scanCodeResult = fb.SC_SPACE
elseif multiKey(fb.SC_LEFT) andAlso multiKey(fb.SC_UP) then
scanCodeResult = fb.SC_LEFT + fb.SC_UP
elseif multiKey(fb.SC_LEFT) andAlso multiKey(fb.SC_DOWN) then
scanCodeResult = fb.SC_LEFT + fb.SC_DOWN
elseif multiKey(fb.SC_RIGHT) andAlso multiKey(fb.SC_UP) then
scanCodeResult = fb.SC_RIGHT + fb.SC_UP
elseif multiKey(fb.SC_RIGHT) andAlso multiKey(fb.SC_DOWN) then
scanCodeResult = fb.SC_RIGHT + fb.SC_DOWN
elseif multiKey(fb.SC_LEFT) then
scanCodeResult = fb.SC_LEFT
elseif multiKey(fb.SC_RIGHT) then
scanCodeResult = fb.SC_RIGHT
elseif multiKey(fb.SC_DOWN) then
scanCodeResult = fb.SC_DOWN
elseif multiKey(fb.SC_UP) then
scanCodeResult = fb.SC_UP
end if
'
while inkey<>"" : /'clear keyboard buffer'/ :wend
INTERACTIONTEST.scanCode = scanCodeResult
'
return scanCodeResult
end function 'LNG:=INTERACTIONTEST.TestMouse()
type POSXY
as single _x => 0
as single _y => 0
end type
type MOB extends OBJECT
declare static sub DrawMob()
static as POSXY position
static as integer s1
static as integer s2
end type
dim as POSXY MOB.position
dim as integer MOB.s1 => any
dim as integer MOB.s2 => any
type PLAYER extends OBJECT
declare static sub DrawPlayer()
declare static sub TestPlayerAgainstMob()
static as POSXY position
static as integer score
end type
sub PLAYER.DrawPlayer()
'
end sub
sub Mob.DrawMob()
circle (MOB.position._x - PLAYER.position._x, MOB.position._y - PLAYER.position._y), 80 , rgb(255,0,0), , , , f
end sub
sub PLAYER.TestPlayerAgainstMob()
if PLAYER.score>(MOB.s1 + MOB.s2) then PLAYER.score = -9999
if point(SCREENTEST.scrW\2, SCREENTEST.scrH\2)=rgb(255,0,0) then
dim as integer s => 3*rnd()
MOB.s1 += s
MOB.s2 += (3 - s)
PLAYER.score = (MOB.s1 + MOB.s2)
MOB.position._x = rnd()*SCREENTEST.scrW + SCREENTEST.scrW\2
MOB.position._y = rnd()*SCREENTEST.scrH + SCREENTEST.scrH\2
end if
end sub
dim as POSXY PLAYER.position
dim as integer PLAYER.score => any
type FRAME extends OBJECT
declare static sub DrawFrame()
static as POSXY topLeftCorner
end type
dim as POSXY FRAME.topLeftCorner
sub FRAME.DrawFrame()
FRAME.topLeftCorner._x = SCREENTEST.scrW\2 - PLAYER.position._x
FRAME.topLeftCorner._y = SCREENTEST.scrH\2 - PLAYER.position._y
circle (SCREENTEST.scrW\2, SCREENTEST.scrH\2), 2, rgb(0,255,0)
line (FRAME.topLeftCorner._x, FRAME.topLeftCorner._y)-step(SCREENTEST.scrW, SCREENTEST.scrH), rgb(200,200,0), b
end sub
'-------------------------------------------------------------------------------
screenRes 800, 600, 32, 2
randomize TIMER
SCREENTEST.TestScreen()
PLAYER.position._x = SCREENTEST.scrW\2
PLAYER.position._y = SCREENTEST.scrH\2
MOB.position._x = rnd()*SCREENTEST.scrW + SCREENTEST.scrW\2
MOB.position._y = rnd()*SCREENTEST.scrH + SCREENTEST.scrH\2
screenSet 0, 1
do
SCREENTEST.TestScreen()
INTERACTIONTEST.TestMouse()
INTERACTIONTEST.TestKeyboard()
if INTERACTIONTEST.scanCode = fb.SC_UP then PLAYER.position._y -= 1
if INTERACTIONTEST.scanCode = fb.SC_UP + fb.SC_LEFT then
PLAYER.position._y -= 1
PLAYER.position._x -= 1
end if
if INTERACTIONTEST.scanCode = fb.SC_UP + fb.SC_RIGHT then
PLAYER.position._y -= 1
PLAYER.position._x += 1
end if
if INTERACTIONTEST.scanCode = fb.SC_DOWN then PLAYER.position._y += 1
if INTERACTIONTEST.scanCode = fb.SC_DOWN + fb.SC_LEFT then
PLAYER.position._y += 1
PLAYER.position._x -= 1
end if
if INTERACTIONTEST.scanCode = fb.SC_DOWN + fb.SC_RIGHT then
PLAYER.position._y += 1
PLAYER.position._x += 1
end if
if INTERACTIONTEST.scanCode = fb.SC_LEFT then PLAYER.position._x -= 1
if INTERACTIONTEST.scanCode = fb.SC_RIGHT then PLAYER.position._x += 1
PLAYER.TestPlayerAgainstMob()
cls
FRAME.DrawFrame()
MOB.DrawMob()
PLAYER.DrawPlayer()
draw string (12, 12), str(PLAYER.SCORE), rgb(200,200,0)
draw string (18, 28), str(MOB.s1), rgb(200,200,0)
draw string (68, 28), str(MOB.s2), rgb(200,200,0)
screenCopy 0, 1
'
sleep 15
loop until inkey()=chr(27)
getKey()
'(eof)
You store your score on many registers that you sum up only for display. So if you change the score at screen, it doesn't affect the true score stored in many. I don't know if it helps!