How do I compare these variables for a Fishy clone?

Get help using Construct 2

Post » Tue Oct 20, 2015 4:33 pm

I'm playing around, trying to make a clone of Fishy (http://fishy-flash-game.com/)

I'm sure I am looking at this the wrong way. I have a couple of issues going on here.
First of all I find that i have trouble setting the size of my sprites. I want them to maintain the same width/height ratio and I would preferably do that in pixels. Though this is not my biggest problem.

The real problem here is that I somehow cannot compare the size of my enemy instance to the current size of the player. Any help would be greatly appreciated!

In an ideal world, my code would look something like this:

Code: Select all
System every x seconds
> Instance var Enemysize = random(4,128)
> Enemy set size [width = EnemySize, height = EnemySize]

Global number PlayerSize = 16

Player on collission with Enemy
if PlayerSize  >= Enemysize
> destroy enemy
else
> destroy player


here is my capx
https://www.dropbox.com/s/gxhjqt9vcws3r ... .capx?dl=0
B
4
Posts: 6
Reputation: 217

Post » Tue Oct 20, 2015 4:50 pm

try this

dl.dropboxusercontent.com/u/14855413/fishy.capx

(copy and paste the link)
B
13
S
5
G
1
Posts: 116
Reputation: 1,805

Post » Tue Oct 20, 2015 4:58 pm

So I guess you would like something like:

Enemy on created
> Enemy set Instance var Enemysize = random(4,128)
> Enemy set size [width = EnemySize, height = EnemySize]

Player on collission with Enemy
if PlayerSize >= Enemy.Enemysize
> destroy enemy
else
> destroy player
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Oct 20, 2015 7:56 pm

Thank you both for your answers, worked like a charm!
B
4
Posts: 6
Reputation: 217


Return to How do I....?

Who is online

Users browsing this forum: Lancifer and 6 guests