Platform spawning and reactive sprites

For questions about using Classic.

Post » Fri Jul 03, 2009 11:08 am

Hello all. First post. :oops:

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

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

Fig 2


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
[url:s3htwjwm]http://www.scirra.com/phpBB3/viewtopic.php?f=3&t=2248[/url:s3htwjwm]
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. :D Loving the creations forum. There are some bloody talented people on here. [u:s3htwjwm]And I don't know if it's relevant but I'm using 0.98.9[/u:s3htwjwm]
B
1
G
3
Posts: 7
Reputation: 839

Post » Fri Jul 03, 2009 11:45 am

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. :lol:
B
1
G
3
Posts: 7
Reputation: 839

Post » Fri Jul 03, 2009 12:58 pm

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. :lol:



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?
B
1
G
3
Posts: 7
Reputation: 839

Post » Fri Jul 03, 2009 1:11 pm

Try this:
heroSprite overlaps bullet
> heroSprite set Y to bullet.Y-12
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Fri Jul 03, 2009 1:14 pm

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
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Fri Jul 03, 2009 1:30 pm

[quote="newt":qkco93hj]Try this:
heroSprite overlaps bullet
> heroSprite set Y to bullet.Y-12[/quote:qkco93hj]

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.
B
1
G
3
Posts: 7
Reputation: 839

Post » Fri Jul 03, 2009 1:33 pm

[quote="lucid":seqqytwf]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[/quote:seqqytwf]
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.
B
1
G
3
Posts: 7
Reputation: 839

Post » Fri Jul 03, 2009 1:51 pm

You don't need physics

[url:2l5fliwg]http://files.getdropbox.com/u/666516/test2.cap[/url:2l5fliwg]

Edit:
I just changed it for framerate, hopefully that will keep people from crawling up my assets for not using timedelta.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Fri Jul 03, 2009 2:04 pm

[quote="newt":37klsg4v]You don't need physics

[url:37klsg4v]http://files.getdropbox.com/u/666516/test2.cap[/url:37klsg4v][/quote:37klsg4v]

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.
B
1
G
3
Posts: 7
Reputation: 839

Post » Fri Jul 03, 2009 2:18 pm

Check the dummy sprite its attached to. You can change the dummy's size, and image point for that stuff.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest