drawing the towers range not working?

For questions about using Classic.

Post » Wed Jul 13, 2011 12:31 am

I recently downloaded Construct v0.99.

this is what i did to draw range

(Mouse) = sprite
(Towers) = family
('Active') = private variable
(Canvas) = canvas


1.(Mouse) overlapped (Towers)
(Towers) Value ('Active') Equal to 1    
- System: Start Loop "DrawRangeHover" 360 times
-(Canvas) : clear to transparent
2.Else
-(Canvas) : clear to transparent


then this i put to canvas event on action

On loop ("DrawRangeHover")
(Mouse) overlap (Towers)
-X1:Towers.X+cos(LoopIndex("DrawRangeHover"))*Towers[Turret>.Range
-X2:Towers.Y+sin(LoopIndex("DrawRangeHover"))*Towers[Turret>.Range
-X3:Towers.X+cos(LoopIndex("DrawRangeHover")+1)*Towers[Turret>.Range
-X4:Towers.Y+sin(LoopIndex("DrawRangeHover")+1)*Towers[Turret>.Range


Then i did "DrawRangeHover"

I made another range just to check if mouse is over towers, then it shows its range


17. Is global variable 'Mode' Equal to 1
    Towers: Value 'Active' equal to 1
     -System: Start Loop "DrawRangePick" 360 Times

then this i put to canvas event on action

On Loop "DrawRangePick"
Tower Value 'Active = 0'
-X1: TowerBuilder.X+cos(LoopIndex("DrawRangePick"))*Towers[Turret>.Range
-Y1: TowerBuilder.Y+sin(LoopIndex("DrawRangePick"))*Towers[Turret>.Range
-X2: TowerBuilder.X+cos(LoopIndex("DrawRangePick")+1)*Towers[Turret>.Range
-Y2: TowerBuilder.Y+sin(LoopIndex("DrawRangePick")+1)*Towers[Turret>.Range


After I put this, when i run the game. When i builted a tower, it didn't work. When my tower was builted already and my mouse hovers it, it shows range. When the tower isn't build yer and i clicked one from the icons, it doesn't draw the range and left it blank.

Anyone help me, thanks.blackstr2011-07-13 00:36:55
B
14
S
2
G
1
Posts: 46
Reputation: 1,144

Post » Wed Jul 13, 2011 8:31 am

I might be missing something, but is there a reason you can't just draw a circle at the tower, with it's size set to the tower's range, set to be visible upon mousing over the tower in order to display the range?
B
9
S
2
G
3
Posts: 75
Reputation: 1,964

Post » Thu Jul 14, 2011 4:39 am

well, when i builted a new tower, the circle is not drawn. after the tower was placed it draws a circle
B
14
S
2
G
1
Posts: 46
Reputation: 1,144


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 8 guests