Cannon halfmoon powermeter HELP

kajutokajuto Member Posts: 314
edited June 2012 in Miscellaneous
Hi there everyone!! recently i made my game a cannon for a shooter game, but i made the power meter like in the tutorial, but the power meter is a usual one, a vertical rectangle that the power going up or down. I want to make the power meter like a shape of the moon and the power keep inside that actor when i press the cannon to fire, i post the code here..Help

CANNON CODE : 1) https://www.dropbox.com/sh/pv2oj6v3jlumoqs/GOWU6__0OX
startTime = real, startY = real, loading: boolean
rule : when touch is pressed
-change att- self.loading to true

-change at- self.startTime to self.Time

-constrain att- game.Power to min(2,self.time-self.startTime)

-rotate to position- position : max(game.mouse.positionX,self.positionX) & max(game.mouse.positionY, self.PositionY & speed -150 y relative to scene.
-change att- game.totalshotcam to game.totalshotcam+1
after for 0.1seconds i press a control camera

rule: when mouse button is up
att self.Loading to true
-change att- gamedotindex to 1
-timer: for 4 s respawn actor
- att.self self. loading to false
-att game.how.many loading < 3
- spawn ball actor

Group:
-accelerate: direction 90 degree, relative to scene , acceleration: 150
-change att: self.Start to self.Positino Y
-contrain att: selfPosition Y selft.Start

POWER:

Group of behavior
-constrain att: self.Size.Height to 158*game.Power
-constrain att: self.PositionY to self.SizeHeight/2

photo of the concept (sorry i didn't have my wacom) =-(

i appreciatted it

Best Answer

  • tatiangtatiang Posts: 11,949
    edited June 2012 Accepted Answer
    You need to upload your images to a file server such as DropBox, ImageShack, etc. and then post the URL to the uploaded file.

    If you want to embed the image, use <*img src="url"> without the *. I have noticed that if you use DropBox, you have to share the images from the Public folder rather than from some other folder in your account. Not sure why.

Answers

  • kajutokajuto Member Posts: 314
    Oh ok.. But either way I wrote the code just in case :-), can u help me?
  • kajutokajuto Member Posts: 314
    i already put it in the Public Folder =-)
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    edited June 2012
    Make an image of an upside-down half circle. (Like a smile.) Place it at the bottom of the scene of the cannon template. Then put the following behaviors into it.

    image
  • kajutokajuto Member Posts: 314
    thanks for reply RThurman, but i want the inside power, to feel the same shape of the half circle..if u know what i mean
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    So my solution is to cover the arc with a rectangle (or another arc if you like) and then move that cover actor. Ideally, you would move the arc using a trig function but I'm not that smart ;) so here's my demo: https://www.dropbox.com/s/n1mblr02aleh9fn/arc meter.zip
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    And since my solution isn't all that great, you might get some ideas from the attached Be The Spark file.
  • kajutokajuto Member Posts: 314
    That okay tatiang.! I would try it and thanks as always
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    thanks for reply RThurman, but i want the inside power, to feel the same shape of the half circle..if u know what i mean
    You could at least have tried it before dismissing it out of hand. All you need to do is add two simple behaviors to a single actor!
    http://www.mediafire.com/download.php?fbhgcy72mtlvk83
  • kajutokajuto Member Posts: 314
    I already tried it RThurman ;-( it didn't workout
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited June 2012
    Try his project file because it's a really clean solution. Nice work @RThurman. I didn't understand it until I saw the file.
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    @kajuto -- if you did try it then please accept my apologies for getting all snotty. But I guarantee you it does work and it is what you want.

    @tatiang -- thanks! The hard part was drawing the arc. I have absolutely no graphic design skills. (It took 30 minutes to figure out how to cut a circle in half in illustrator!)
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    @RThurman lol! I have no skills either. It took me about 10 minutes in Illustrator to give up and let you solve it instead. ;)
  • kajutokajuto Member Posts: 314
    All right I will download and try it at night cause I'm working now :-( . Thanks both of u for helping me all this time :-)
  • kajutokajuto Member Posts: 314
    Thanks guys.! it worked , i just have to make a little modification, but its cool!! anything u need let me know =-)
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    @kajuto -- You are welcome. Glad it only requires a little modification to suit your needs.
Sign In or Register to comment.