I was converting some code and accidentely did this:
Super class and child class was created with the same members.
Strict
import mojo
Function Main:int()
new MyGame
return 0
End Function
Class MyGame extends App
Field player:Player
Method OnCreate:Int()
player = new Player(100, 100)
return 0
End Method
Method OnLoading:Int()
return 0
End Method
Method OnUpdate:Int()
return 0
End Method
Method OnRender:Int()
Cls
DrawOval player.x, player.y, 10, 10
return 0
End Method
end class
Class Player extends Sprite
Field x#, y#
Method New(x#, y#)
self.x = x
self.y = y
End Method
End Class
Class Sprite
Field x#, y#
Method New(x#, y#)
self.x = x
self.y = y
End Method
End Class
This is fine for Java(default visibility), HTML5 and GLFW... in Flash it throws the following error:
ERROR:C:\BlitzMonkey\code\MonkeyTest\flasherror.build\flash\MonkeyGame.as(1403): col: 15 Error: A conflict exists with inherited definition MonkeyGame.as$25:bb_flasherror_Sprite.bbx in namespace private.
internal var bbx:Number=0;
^
ERROR:
C:\BlitzMonkey\code\MonkeyTest\flasherror.build\flash\MonkeyGame.as(1404): col: 15 Error: A conflict exists with inherited definition MonkeyGame.as$25:bb_flasherror_Sprite.bby in namespace private.
internal var bby:Number=0;
Easy to fix... remove the duplicate members from the child class :)
|