The values you will need to reset in a game restart function will vary based upon the game you are playing. There are a number of ways you can do this. What I do is call the restart function from within my main do-loop (repeat - until actually). It goes something like this:
if player.status = 2 : // dying
if player.lives > 0
dec player.lives
ReGen()
else
GameOver = true
endif
endif
In this example I have previously defined the variable, true, as a constant, which is equal to one. ReGen() is the function that restarts the game.
The ReGen() function in a game I am working on it looks like this:
function ReGen()
// make sure all explosions are done before setting up a new wave
repeat
NumExp = MoveExp()
ScrollBackdrop()
MoveMissiles()
if player.status = true
mx = mousex() : if mx > (ScrWid - 48) then mx = ScrWid - 48
if mx < 15 then mx = 15
sprite player.SprNum,mx,ScrHgt - 80,player.image
if player.HasClone > false
sprite player.HasClone,mx + 44,my,WhiteShip
endif
endif
sync
until NumExp = false
AllInPlace = false
SetupBaddies(1)
for k = 1 to TotalShots
if pshot(k,2) = true
hide sprite pshot(k,1)
pshot(k,2) = false
endif
next k
DPExtraShips()
GotEmAll = false : BaddiesDestroyed = false
MasterNumHits = NumHits : MasterNumShots = NumShots
NumHits = false : NumShots = false
endfunction
Please bear in mind that this is just an example to you. Your restart function will likely look very different; it simply is there to give you some of the things that could be included in a game restart function.
Personally, I typically stay away from deleting sprites and creating them all over again. Maybe it is just me, but invariably I am going to delete a sprite that will cause the game to error and I'll spend a lot of time trying to figure out where the problem is.
Variables are integers by default and it is not necessary to declare them as such (unless you want to). You may want to write a function that calls other functions, to initialize particular things. For example, you could have a function to set the player's initial values, another one to setup the background screen, another to reset the items within the game, etc., etc. Example:
function Init()
InitPlayer()
InitEnemies()
SetupWorld()
endfunction
When you have multiple sprites / objects etc., it is better to write a function that can install them initially and re-install them later during a restart. In the above example, the SetupBaddies(1) function will initialize all of the enemies, but will not create new sprites. If I was to call SetupBaddies(0), the function will create the sprites for them (this is called when the game is started). This way, the same function can be used to do slightly different things so you don't have multiple sets of code.
Anyway, I hope this is helpful.