Go To Preferred item

Get help using Construct 2

Post » Wed Apr 11, 2012 3:20 pm

Hello sorry, but my Construct 2 fu is weak. I played around with the basic tutorial which was very helpful, but I could use some help still. As what I'm trying to make is a puzzle game that has 2 phases.

I'm trying to create a puzzle game. The idea is that the player set's up a course with a series of objects(Blue, Red Gems). Then once hitting start. The character will move through the course on their own. The character finds the nearest item on Hor/Ver(grid 10x10) and priority. Then moves to the nearest item.

There is lot's of things I can't figure. Heres a few that really stumping me.

Start the course on a button click. I've looked at system event for/each, but I can only do them as a new event and not something that stars with a button click.

Choose priority object based on Hor/Ver, priority and distance.
I can set attributes to the objects, but I'm not sure how to search through nearby items.

Drag and Drop item spawner. The problem I seem to be having is that when I DnD I drag the spawner and leave the new Item where the spawner was :| I'm not sure how to create the item into the mouse select rather than move the spawner.

I guess that's for starters.
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Thu Apr 12, 2012 4:58 am

To start on button click, use a variable (x) initially set it to 0, when the button is clicked set it to 1.

Add an event System --> Compare variable --> x = 1
    Add the for loop as a sub event.

For choosing an item Pick nearest/farthest Sprite event may help.
B
28
S
9
G
6
Posts: 30
Reputation: 6,609

Post » Thu Apr 12, 2012 4:09 pm

Thank you. It's given some avenues to work with :) I'll post again when I get stuck :D

B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Fri Apr 13, 2012 4:44 am

Well seems like I just can't seem to figure this out. Let's see if I can relate the event sheet here

Button-Onlick > Set isRunning to 1

System-isRunning = 1
-- Hound-Direction speed == 0
---- System-ForEach GemBlue
------ Hound-Pick nearest to(GemBlue.X, GemBlue.Y)
-------- Actions
-------- Hound.Rotate 0 degrees towards GemBlue.X, GemBlue.Y
-------- Hound.set speed to 10

Hound-is overlapping GemBlue
Actions
GemBlue Destroy
Hound direction speed to 0


The idea is that the Hound will move towards one object. Once there the object is destroyed and the hound looks up a new object and moves towards it. It doesnt work :| I'm doing something wrong and I just don't understand enough of C2.

Some more assistance would be great. I did manage to handle the Spawner issue. I just create all the objects and have them overlap each other. I can put a counter to that later to let players know how many they have of what gem.
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Sat Apr 14, 2012 11:57 pm

This may be an issue of SOL. Sharing the .capx would help.
B
28
S
9
G
6
Posts: 30
Reputation: 6,609

Post » Sun Apr 15, 2012 1:02 am

http://studioryu.net/file/OmenHound.capx
http://studioryu.net/file/   if the above doesn't work.

What's SOL. Though I suspect it's more an issue of newbness :D I have a few other bits in there trying to experiment.


B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Sun Apr 15, 2012 4:45 am

Try this: http://dl.dropbox.com/u/28195143/c2_share/OmenHound_fix.capx

I have modified the On Start event to destroy the first GemBlue you have outside the layout. This would stop the hound going after it.

I have used the bullet behavior. You would not need a for loop here. The pick nearest event should be on the GemBlue.

You don't have to worry about SOL (Selected Object List) here. It is a little advanced I think. You may look into these links if you want to learn more about it.

http://www.scirra.com/forum/isolate-identical-sprites-by-variables-for-testing_topic50378_post317619.html?KW=#317619

SDK Manual Entry: http://www.scirra.com/manual/29/object-type/page-1
B
28
S
9
G
6
Posts: 30
Reputation: 6,609

Post » Mon Apr 16, 2012 1:31 am

Thank you. I'm going to look over this. Much appreciated :)
I'll read over the links too
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834


Return to How do I....?

Who is online

Users browsing this forum: makkancs, Matthew de and 30 guests