pmurph's Forum Posts

  • Hi, I'm working on a tower defense game(Just for fun, i'm not particularly knowledgeable or in love with the genre but it seemed like a managable task for a change) and i'm trying to make it so that when an enemy get's to my main tower(The one you are protecting) , the tower's health(An instance variable) will go down over a period of X seconds.

    Now i know how to do the whole remove X damage every X seconds thing, but i can't think of a way of testing if the enemy is within say 2 pixels of my tower.

    Another question i have is how can i easily control how many turrets my player can create? I have it so they appear when the

    left mouse is clicked but as it stands you could create a

    thousand if you like and the on screen counter just keeps going up.....

    This is pretty inconvenient as is , especially when i consider adding more than one type of turret and some kind of points system to allow you to spend points to create them in the first place.

    If anybody out there has made a tower defense game(and i'm sure some of you must have at some point or another) , i would really like your help,

    Thanks, Paul.

  • Thanks I'll give it a try, that clears things up a bit. Sorry i wasn't too concise there haha!

    Paul

  • Yeah i used the physics behaviour entirely through trial and error in getting it working. Mainly because i couldn't figure out how to use the bullet behaviour to do what i wanted.

    At the moment i would much prefer to use Bullet because i know i can set the speed i want it to go at, i just can't figure out a way of getting the ball to shoot in the direction of my mouse cursor. Also the bounce off solids part, Would i be able to toggle the objects collisions with the ball object depending on what Key I've pressed?

    I've been trying to do it all morning with Boolean's and variables but to no avail, I'm not too clued up on all of this yet! As it stands I've managed to make it collide when i want it to, then toggle it so that the object in question no longer has collisions enabled ,but it's like when i disable the collisions the first time i can't toggle it back. Which isn't what i want.

    I need it to collide when the ball is fired at it using the left mouse button, but to not collide and allow the ball to pass over whenever it is fired using the right.

    I hope I'm being clear enough, My thoughts are a little muddled trying to figure this out.

    Thanks for the swift reply.

    Paul

  • I have a game where you can launch a ball from the player to wherever the mouse is pointing(Using physics behaviour). I noticed that depending on how fast the player is moving when he launches the ball , the ball will differ in speed. I want the ball to always go at the same speed unless i otherwise specify(a powerup for example).

    I was thinking that Bullet might work this way, but does bullet support more than 8 directions? Also how would i go able making it so that when i click the left mouse button,

    the ball is shot in the direction of my mouse cursor the same way i would with the physics behaviour(Apply Physics impulse 1 towards Mouse.X , Mouse.Y)?

    If anybody sees this and has the answer, thanks!

    Paul

  • I have a feeling the answer is going to be very obvious, but i've even tried googling words like mousex and viewport left, in different combinations and the only relevant search results are this thread.

  • I still can't seem to find any Mouse events that allow me to set the mouse x or y to anything, nor can i find anything about viewport left/right/top or down. I'm fairly new to this, I'm running the unlicensed , free version of construct 2 if that's the reason? I'm fairly new to this and i just can't seem to find any of these things in the event list. Am i clicking Add event>Mouse, and then these events should be there? That's what I've been trying to no avail so far.

    Paul.

  • Thanks for the reply again pixel, I managed to fix this by going and re-doing my whole event list more coherently. It all just sort of fell into place and i have it working now.

    Paul.

  • I'm sorry , i don't follow. Is this in the events/actions list? I can only seem to find the options to set the mouse cursor to something else...

    Paul.

  • Thanks, i can't seem to get the plugin working but i'll keep trying!

    Paul.

  • Wow! You just improved the quality of my current situation ten-fold! Thank you :)

    Paul.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • hmm i was thinking maybe the "Bound to layout" Behaviour? But i can't think of a way of using this on the mouse object. Is this possible?

    Paul

  • Hi, i've noticed recently when testing my game that my mouse cursor often flies off screen and when it does, my game no longer registers any mouse input. Is there a way i can lock the mouse to the screen while the game is running in order to prevent this?

    Thanks,Paul.

  • If you can't see the image for some reason or another, here's the link : dl.dropboxusercontent.com/u/151998804/eventSheet.png

  • Hi, I'm trying to make a certain thing happen wherein the player object overlaps the 'puck(or ball)' object, the puck sticks to the player object until the player then left clicks and the puck object is fired in the direction of the players mouse pointer.

    I've included the event sheet I've came up with while tooling around with this idea to make my question slightly less of a jumbled mess.(apologies in advance, i really have tried to think of a clearer way of wording all of this)

    From said messing around, I've managed to get the puck to pin to the player object when it overlaps with it and that's all well and good(i also managed to set the position to the player x and y co-ordinates such that it would overlap the center of the player rather than stick round the edges).

    I set the physics to immovable for both player and puck to fix an error i had where it would shoot all over the screen even when the keys weren't pressed. So now I wan't to be able to click-hold to charge up a shot and then release to unpin to puck object from the player and shoot it towards the mouse cursor. I've tried setting an apply physics force to mouse.X and mouse.Y but to no avail, it just stays pinned there and i don't know how to proceed. Any help would be greatly appreciated if you can find the time,

    Thanks, one grateful newbie! <img src="https://dl.dropboxusercontent.com/u/151998804/eventSheet.png" border="0" />

  • Thank You so much.

    Although what do you mean by 'continuous' preview? I tried it but i couldn't see any difference.

    Paul