Here's what I have so far
The missile obviously needs work as sometimes it over shoots the centre and isn't set up for asteroid explosions yet
I tried using a difference algorithm to determine whether the missile had made it to centre lol
at the moment I use an invisible black sprite which seems to do the trick but problems with the way
I use the offsets rotation and sprite movement means it still can overshoot the mark
Difference Algorithm I first tried
function Difference(num1 as integer,num2 as integer)
if num1>num2
diff=num1-num2
elseif num2>num1
diff=num2-num1
else
diff=0
endif
endfunction diff
The Missile and Block in centre
Global Missile as Missile
MissileImg = LoadImage ("Missile.png")
Missile.SpriteID = CreateSprite(MissileImg)
SetSpritePosition (Missile.SpriteID,24,30)
SetSpriteAnimation(Missile.SpriteID,24,30,6)
SetSpriteVisible(Missile.SpriteID,0)
//PlaySprite(Missile,10,1)
Missile.State=0
Global Block as integer
Block = createSprite(0)
setSpriteSize(Block,8,8)
setSpritePosition(Block,508,380)
setSpriteColor(Block,0,0,0,0)
.
.
Stuff.
.
.
.
Select Missile.State
Case 0
SetSpritePosition (Missile.SpriteID,x+462,y+334)
pointSprite(Missile.SpriteID,512,384)
SetSpriteVisible(Missile.SpriteID,1)
PlaySprite(Missile.SpriteID,10,1)
Missile.x=x+512:Missile.y=y+384:Missile.ox=x:Missile.oy=y
Missile.State=1
endcase
Case 1
Missile.State=moveMissile(Missile.SpriteID,5)
endcase
Case 2
Missile.State=0
//Missile.x=GetSpriteOffsetX(Missile.SpriteID)
//Missile.y=GetSpriteOffsetX(Missile.SpriteID)
endcase
endSelect
I'm not sure what I was thinking with 3 states so much tidy up to do
but in the missile move function for collision it does the following. ATM (virtual resolution is setup as 1024 by 768)
If GetSpriteCollision(Missile.SpriteID,Block)or Missile.y<0 or Missile.y>768 or Missile.x<0 or Missile.y>1024
state=2
endif
I also need sounds, il see what I can create
But Haliop_New this is whats working atm
[video=youtube]https://youtu.be/FKy18MgVeYo[/video]
I am planning to have a timer countdown before you start playing and after each death so you have a chance to get ready
and it will warp you towards the centre at the end of each level just like gyrus
Lots to do as you can see
fubar