Platform spawning and reactive sprites

This forum is currently in read-only mode.
  • Hello all. First post.

    I've been lurking heavily on here since discovering Construct about a month or so ago and have been experimenting with it, and going through the tutorials. Shooter and platform, aswell as the upload sub forum. Now, I've decided on something simple I would like to make and come up against a wall already. Such is life. Hopefully someone can point me in the right direction.

    By the medium of crudely drawn pictures, I will explain what I'm trying to do.

    Fig 1

    <img src="http://img.photobucket.com/albums/v636/pornocreeppics/scirra1.jpg">

    On the left of the screen we see our 'hero' and on the right of the screen we see our 'saviour'

    Fig 2

    <img src="http://img.photobucket.com/albums/v636/pornocreeppics/scirra2.jpg">

    Now here we go, what I would ideally like to happen, is the 'saviour' on the right can move vertically within the limits shown by the green lines. The saviour constantly spawns a platform to the position it is at. I say platform, but it could be just 1 pixel. Which then scrolls off to the left of the screen.

    The 'hero' on the left I need to be constantly running on the spot, but reacts to the incoming platforms, therefore moving up and down with it. Think, rollercoaster.

    That should give you some idea of what I would like to do to get me started. I've browsed this help sub forum and found an OLD! thread

    http://www.scirra.com/phpBB3/viewtopic.php?f=3&t=2248

    which relates to Linerider, that could be some help perhaps with further experimentation. Any other links people know of would help greatly. I don't mind reading up and don't expect someone to hand feed me the answers. Just a gentle nudge will suffice.

    Progress so far

    -Managed to get the 'saviour' moving within its limitations

    -Spawning continuous moving 'platforms' that a physics object reacts with.

    Feel free to ask questions if need, I feel I could have over-egged my post somewhat and please try and keep it as simple as possible for me at the moment. Brain is melting a little from reading some of the threads on here. Loving the creations forum. There are some bloody talented people on here. And I don't know if it's relevant but I'm using 0.98.9

  • I mocked up little .cap to show the sort of effect I meant, although for this example I used the bullet behaviour on the spawned 'platform'. From what I have read this is not the way to do it. This is purely to show in more detail what I meant by the continuously spawning platform.

    http://files.getdropbox.com/u/1464757/test1.cap

    I'm sure a couple of people here will be happy to see I downloaded dropbox too.

  • Updated .cap above. /\/\

    I managed to get a continuous streaming platform that a physics object reacts with. It was actually simpler than I thought, thanks to the Linerider thread for inspiration.

    Now, next problem is, I didn't really want it to be a physics based object. I would prefer it if the object ('hero') was just a normal bog standard sprite. Is this possible, achieving the same effect but without applying a physics behaviour?

    If I do go the physics route, could someone have a gander at my rough test and maybe mess about with the physics properties of the 'hero'. At the moment it seems very very rough when moving vertically, and quite frankly, I haven't a clue what is going to make it smoother.

    And also any suggestions on using something other than an immovable physics object to stop the 'hero' falling off the left hand side of the screen. You'll see what I mean if you give it a look.

    Thanks. Getting quite into this now. Sadly I seem to be smoking more than ever.

    Edit - Would this thread be better in the creations forum now that there is some substance, or shall I wait until I have at least some artwork done?

  • Try this:

    heroSprite overlaps bullet

    heroSprite set Y to bullet.Y-12

  • im on my cell at work so i cant take a look at your cap right now, however. if you apply "solid" or "platform.(cant remember which without looking at construct), you should be able to do the same thing with platform behavior.

    also, no, it shouldnt go into creations forum. that is for completed works. so anything without graphics, or that youre still working on isnt supposed to go there

    welcome to the active board

  • Try this:

    heroSprite overlaps bullet

    > heroSprite set Y to bullet.Y-12

    Ok, just tried that. Sadly once you start increasing the angle of the platforms then the hero object just jitters and then shoots off the left of the screen.

    http://files.getdropbox.com/u/1464757/test2.cap

    The event looks like so.

    Always>sprite overlaps sprite4>sprite set Y to sprite 4.y-12

    That is hopefully I put in the event correctly.

  • im on my cell at work so i cant take a look at your cap right now, however. if you apply "solid" or "platform.(cant remember which without looking at construct), you should be able to do the same thing with platform behavior.

    also, no, it shouldnt go into creations forum. that is for completed works. so anything without graphics, or that youre still working on isnt supposed to go there

    welcome to the active board

    What, so have the road sprite with behaviours of Bullet and check the platform or solid tick boxes?

    That's cool. I'll bed down in here until I come up with something resembling fun.

  • You don't need physics

    http://files.getdropbox.com/u/666516/test2.cap

    Edit:

    I just changed it for framerate, hopefully that will keep people from crawling up my assets for not using timedelta.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You don't need physics

    http://files.getdropbox.com/u/666516/test2.cap

    Ok, thanks. So in that .cap you just removed the physics behaviour of sprite and that's it? Just to make sure I'm not misunderstanding things. Then as soon as the road (sprite 4) hits the hero object it changes the sprite placement to that of sprite4 (bullet)

    This is pretty much what I wanted. That road isn't going to be visible at all times in the future hopefully.

    However one small issue. Go from the bottom of the screen, to the top and back down again. The sprite at the arc seems to jitter about, I guess that could be altered by changing the size of the sprite. Let me have a go quickly....ok, too small and the sprite becomes detached from the sprite4 road (i will change the names of these soon to avoid confusion). A hurdle I will no doubt leap sooner or later.

    Thanks very much for your help. I'll mess about some more and update later on.

  • Check the dummy sprite its attached to. You can change the dummy's size, and image point for that stuff.

  • Check the dummy sprite its attached to. You can change the dummy's size, and image point for that stuff.

    I altered the image point and hotspot (seperately) for the road 'platform' sprite. It then for some reason started generating the platforms at 0 degrees instead of the as per event 180. Confused.

    I've been messing about with the bullet speed and can seem to get it smoother if going below 150 speed, however this goes against what I wanted to achieve. Something fast paced is needed. I could just fake it with some screamingly fast parallax scrolling backgrounds, but no, I'll try this first.

    Also, just one more question for now. My system is not a beast, 2.5ghz and 512mb RAM, and 128mb graphics card. I just put in a shooting element and every time I click the mouse to fire, one of the spawning platform sprites do not appear, as if it were churning some mass of information. The projectile appears fine, and then the road carries on as normal afterwards. Is this just to do with multiple things going on at once? I was controlling the road with arrows and firing towards mouse x,y.

    Ho hum. I'm going to have a break for a bit. It's Friday. Surely that means I must get cider to get my creative juices flowing!?

    For a little test, this is going quite well. I've learnt more today about the events system than I have in most of my researching over the last month.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)