deleting a bullet

BlitzPlus Forums/BlitzPlus Programming/deleting a bullet

B_Paulie(Posted 2006) [#1]
hi guys, it seems like im posting too much :).
any way, im working on a game, and i need to delete a bullet when it hits the botton of the screen, but it says "can't delete non newtype". help!(again)


WolRon(Posted 2006) [#2]
This compiles:
Type a
End Type

b.a=New a
Delete b
and this generates the error "Can't delete non-Newtype":
Type a
End Type

;b.a=New a
Delete b

Therefore, your problem is attempting to delete an instance of a Type that you haven't created or have already deleted.

Make sure you haven't made any typos either.


B_Paulie(Posted 2006) [#3]
ok, there are no errors in the code, but delete each enemybullet works. why?


WolRon(Posted 2006) [#4]
delete each enemybullet works. why?
Think about it for a second...
If you tell it to delete each bullet, and there are no bullets, then there's nothing to delete, therefore, no error.