BluepointVance's Forum Posts

  • Why not just roll your own wrap code?

    I did exactly that. Set up a compare:

    ship x greater than 1024 > set ship x to 0.

    ship x less than 0 > set ship x to 1024.

    Did the same for the y coordinates....

    And I ended up with the exact same problem. Ship would hit the edge and then keep bouncing off.

    So instead I did it by building in a 5 pixel margin a little off screen like so:

    ship x greater than 1034 > set ship x to -5

    ship x less than -10 > set ship x to 1029

    Works like a charm now. Strange... Must have something to do with the sprites? The way they're drawn, they seem to read as being at less than y=0 and more than y=1024 simultaneously (or very nearly simultaneously, anyway.) So construct just keeps bouncing them back and forth to fast to register, turning the edge into a virtual wall... Does that make sense?

    Anyway, thought I mention the work-around in case anyone else ever runs into this.

    Also, thanks to Davioware -- I keep forgetting that sometimes I can just solve these problems with a few lines of code... I never think to do my own version if the behavior already exists. I always think that someone else programed the behavior the "right" way, and my version is just gonna screw it up somehow.

  • I have a problem with the wrap behavior.

    When a player's ship approaches the edge of the playfield at a shallow angle, say 15 degrees or less, and at low speed -- the ship refuses to wrap to the other side of the screen and instead just "bumps" off the edge over and over again.

    I've tried to change a bunch of settings. Even turned the collision mask OFF. Nothing worked.

    I've attached the cap file here. Hoping someone could try it out and tell me what I'm doing wrong.

    http://www.mediafire.com/file/jn7hq04u5hz9zrb/WrapProblem.cap

    P.S. Left and Right arrows to rotate. Up arrow to thrust.

  • Hey man, I've toyed with this a bit myself - got a video of my efforts here: http://vimeo.com/16387177

    I have a .cap of this here also: http://dl.dropbox.com/u/3317708/SB.zip

    I'm no expert, it's all very sticky tape and cardboard.

    Thanks so much for sharing your game cap. That really helped!

    Based on that and what Newt was saying, I think I should be looking at Turret Behavior (which, of course, never even occurred to me before!) Thanks!

  • I'm trying to make a Space Wars type game using construct. And have run into a bit of wall with the ENEMY A.I.

    <img src="http://i232.photobucket.com/albums/ee215/JDoejoe/SW-Help.jpg">

    I'm trying to figure out how to move the enemy towards the player, have the enemy fire at the player, and have the enemy avoid bullets and the Black Hole at the center of the playfield. All of this with the same 2d top-down space type movement (think: Space Wars, Asteroids, etc.) as the player uses.

    I'm getting that things like the RTS behavior seems to make the enemy move like a tank would -- i.e. Stop and turn, then move forward again... This doesn't really work for the game, which is quite "float-ie" right now, with lots of drifting and left over momentum -- and absolutely no stopping. There is also the issue of the constant gravity "pull" coming from the black hole element... The enemy a.i. needs to take that into consideration as it moves about the playfield. Trying to avoid getting too close, and then switching to an "escape" strategy if is gets caught in the gravity field.

    So, I was hoping someone could point me in the right direction to figure this out -- because I'm stumped, and I don't want to go off in the wrong direction entirely.

    Should I be looking at RTS and trying to figure out how to implement it? (I realize it's incompatible with the Physics behavior.) Is there another a.i. routine I should check out (Python plug in perhaps)? Even just help on the movement side would be great. Right now the player moves with physics and custom movement behaviors, producing a really nice "feel" for the game... How would I mimic that with the enemy?

    Any help/suggestions at all would be great. I think I need just be pointed in the right direction.

  • I'm trying to put together a rotating starfield background for my Space Wars type game.

    So, starting with the excelent dynamic starfield done by Rich here:

    http://www.scirra.com/forum/viewtopic.php?f=16&t=871&p=11910

    I made an Orbiter enabled version like so:

    http://www.mediafire.com/file/whi697qo2241scf/Rotating%20Star%20Field%20%281024%29.cap

    I'm wondering if there is a more CPU efficient way of getting this type of look -- the final version is going to be larger than this example (1920x1080 vs 1024x768.)

    Or perhaps this is efficient enough? This version here runs at 870 fps on my system.

    Would it be better just to make a few large transparent images of stars and then layer and rotate them? Or small scalable versions and just resize in Construct?

    I was also hoping to have the player's ship interact with the dust/cloud objects floating around. I thought I might be able to fake the interaction with Particles (i.e. The ship gives off matching cloud wisps as it flys through an existing cloud.) Or maybe with the fluids plug in?? Not sure how that would work. Probably much more processor intensive.

    Any thoughts, comments, suggestions would be greatly appreciated!

  • Video slots/poker?

    100% scratch built coin-op arcade game.

  • Some graphics cards can treat both monitors as just one really long one - in which case it would work fine, you'd just have to make your game span both and position your elements accordingly...

    Got it. I'll try it with the SPAN DESKTOPS setup (when I get everything dialed in!) and report back.

    may i point out that most people only have 1 monitor per pc. a lot of people won't be able to play this.

    I'm making this game for a dedicated arcade cabinet with a half-silvered mirror and specialized controls, etc... It actually makes it easier when I don't have to worry about various resolutions, CPUs, GPUs.

    I might try to make a more vanilla version for use on a regular PC (That one'll be single monitor only!)

  • Would it be possible for a Construct game to run on two monitors at once...

    (i.e. One monitor is the game, the other is a HUD or whatever)

    Essentially I'd like to take one layer and stick it on a second monitor. Perhaps if I span the desktop so my horizontal resolution is double, then double the screen width on my project..?

    Anyone tried this?

  • One last question (I hope ): Now that I'm no longer using the bullet behavior, what is the best way to set a range for the bullets? My guess would be some version of destroying it over TimeDelta? Also, should I be using TimeDelta to regulate the bullet speed (so it will run the same on different computers)?

  • use custom movement and "set speed toward position", and choose accelerate as the type. It functions the exact same way as physics. Like I said, if you want vector based movement (ie. Inertia physics, without the collisions) then use custom movement.

    Got it... I now have it working with both Physics and Custom movement. They're more or less identical (still playing with the math.)

    Is custom movement more efficient in terms of processor overhead? Is that what makes it a better choice than Physics? Just curious.

    Thanks again!

  • It's not that hard to do physics based bullets. Do you want something like this?

    http://dl.dropbox.com/u/10316081/phymachgun.cap

    Got it. I'll try it this way. Thanks!

  • Why do you want your bullets to use physics behavior specifically? Will they need to collide and bounce around physically? If not then physics behavior shouldn't be used. The only time you should use it is if you want physics based interaction between objects. Using it solely for the purpose of vector based movement/inertia is inefficient; for that you should use custom movement behavior. In general you shouldn't combine two movement behaviors unless you're manually toggling between them for a certain reason. Physics behavior hijacks the x,y, and angle of an object, so adding a bullet behavior on top will just apply angle based movement to the object after its movement has already been physically solved and applied by physics behavior. Bullet behavior is dead simple, and is equivalent to the "move at angle" action, minus the time-delta adjustment.

    The Physics behavior is how I modeled the Black Hole. By using the "Add Force Towards" action.

    I was just trying to achieve the same effect with the bullets... If you shoot them past the black hole, they CURVE towards it, and/or get sucked in entirely. That way, during the game, you can do "Trick shots" where you aim near the Black Hole and the shot will angle around it and make a complete left turn (or whatever.)

    So, is there a manual way to do "add force towards" using Bullet or Custom movement Behaviors?

    I'll attach the file I'm working on (minus bullets) so you can see the "add force towards" effects.

    http://www.mediafire.com/file/jjr27flssssxluo/How%20to%20Add%20Bullet.cap

  • I'm making a Space War type game and having a little problem with Bullet Physics.

    I want the bullets in the game to have force applied towards a center Black Hole object... I have a player ship with this behavior working perfectly using Physics Behavior (thanks Davioware!). But when I made a bullet and added both Bullet and Physics behavior to it in an attempt to do the same thing, everything went terribly wrong.

    So, I'm assuming that Bullet Behavior and Physics Behavior don't play nice together? If that is the case, what is the most efficient way to manually create bullet movement? Is there an example/faq/tutorial for this that anyone can point me at?

    Thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Try add force (1000000/distance^2) (off the top of my head), and just keep playing around with the formula. At 1000 distance the ship only gets 1 pull force. at 100 distance it gets 100 pull force. You can also use clamp(300-distance,0,300) to make your formula return 0 instead of a negative number.

    Wow.

    That's pretty perfect for off the top of your head. Works like a charm with those exact numbers!

    Thanks!!

  • To train myself in Construct, I am trying to put together a very simple Space War type game...

    I have made a Black Hole object (a box!) at the center of my test playfield using the ADD FORCE TOWARDS action. Perhaps my math is wrong, but the following:

    ->Sprite: Add force 300-distance(Sprite.X,Sprite.Y, Box.X, Box.Y) towards (Box.X, Box.Y)[/code:19jjef0x]
    
    Will actually repulse the player instead of attract them when the player is on the outskirts of the playfield... I guess because the "300-distance" equation turns up a negative number? Is there a simple way to calculate for that?
    
    Also this method produces very linear results... The force pulling the ship in should become exponentially greater as you get closer to the center of the black hole. That way you can fly around on the outskirts of the playfield with no pull towards the center at all. But if you get too close, you'll get caught in the black hole and sucked in.
    
    Is this the right way to do this kind of thing in Construct?
    
    As an alternate, I made a new version where the force is not applied  unless the player sprite overlaps another large CIRCLE sprite I've added to the center of the playfield. Adding a few of these give the desired slight pull, then much greater pull that I'm looking for -- but I can't help thinking this is the wrong way to go about this, and that there is a simple (i.e. MATH) way of handling all this.
    
    Any suggestions..? Current "Double Circle Overlap" version can be found here:
    [url]http://www.mediafire.com/file/xp3xr875059678k/Black%20Hole.cap[/url]
    
    P.S. My apologies to R0J0hound for stealing his ship sprite... I was just using it for testing. Gonna change it soon!!