How do I white tile game ?

Get help using Construct 2

Post » Sat May 31, 2014 10:03 am

hi
i facing problems creating tile and moving from top to bottom
i have to use array ?

at this time iam using this :

for creating black tile at random position
every 0.8 seconde create object (black tile) x=int(random(4)+1)*161-80.5 and y = 122

and for moving black tile
every tick set y to blacktile.y+5*60*dt

now but facing problem .... i dont know how to set speed ....Image

and i want to create white tile randomly but only on the place that there is no black tile ... and when touched the white that spawn red tile and game over and vise versa

thanks for help
B
45
S
16
G
8
Posts: 792
Reputation: 8,306

Post » Sat May 31, 2014 10:11 am

Hi,
do you mean "Creating moving background ?"
2D Game GUI Designer
B
12
S
4
G
3
Posts: 130
Reputation: 3,778

Post » Sat May 31, 2014 10:18 am

yes or moving object...
B
45
S
16
G
8
Posts: 792
Reputation: 8,306

Post » Sat May 31, 2014 10:28 am

Moving object is the same as moving background, but you can do both with many technics and tricks!
take a look at my tutor here and subscribe:

Moving background:
https://www.scirra.com/tutorials/1023/h ... background

to move an object, background, you need to do it by "Bullet" behavior, or by "Sin" behavior.
try and let me know .
2D Game GUI Designer
B
12
S
4
G
3
Posts: 130
Reputation: 3,778

Post » Sat May 31, 2014 4:05 pm

that not help me a lot i dont know ... :(
B
45
S
16
G
8
Posts: 792
Reputation: 8,306

Post » Wed Jun 04, 2014 12:19 pm

I created GemTap game on playstore which is same as don't tap the white tile games:
https://play.google.com/store/apps/details?id=com.mrcoparmsgmail.com.gemtap

I created 4 sprite objects as my tiles outside of the layout up top. Once lined up i setup a 4x1 array with the x-coordinates of the 4 sprites. set tile y value to a variable say y-coord

set tilespeed = 7
on every tick -> set y of tile object = tile.y + tilespeed

at a point when you need to generate the next line of tiles (I detect when my background behind the tiles y value reaches -195) call a function to generate the next line of tiles:
create tile at (array(i),y-coord) with i=0 to 3

maybe i can write up a tutorial on how i did gemtap if it would be any benefit or interest to any one
You do not have the required permissions to view the files attached to this post.
B
26
S
6
Posts: 39
Reputation: 1,574

Post » Wed Jun 04, 2014 7:12 pm

mmmm ok thanks i see your game its funny good idea
but i have some questions
what about touch tile fonction ? what u use ?

and this mini tutorial is for arcade gameplay ...

what about classic mode ? you use the same about moving tiles and you replace every tick by touching tile ? yes ?
thanks in advance
B
45
S
16
G
8
Posts: 792
Reputation: 8,306

Post » Wed Jun 04, 2014 11:23 pm

So mines pretty simple, not sure if it is the most efficient method. runs smooth on my S3.

First I setup if the Black Tile touched is the lowest Instance UID, as you can't touch any other black tile until the lowest is touched first.

Set instance vars on black tile: IsLowestUID = bool false. InstanceUID = 0

BlackTile object - Pick Instance with lowest IsLowestUID -> set IsLowestUID to True
Else
Set to IsLowestUID False

Create GameMode global var as text.
Create GameOver global var as number=0
Create ClassicMoveTiles global var as number = 0.

Then on touch blackTile:
On Touched BlackTile and BlackTile Is IsLowestUID and GameOver=0->
Subevent ->
GameMode ="Classic" -> set ClassicMoveTiles = 1

System Every Tick ->
Subevent ->
GameMode="Classic" and ClassicMoveTiles=1
-> set y to background.y + tilespeed
-> set y to blacktile.y+ tilespeed
-> set y to whitetile.y + tilespeed
Subevent again ->
Background y>=0 -> set ClassicMoveTiles = 0
-> set background y to -195.1 (this value depends on your bkground object position, have to play around)
-> call GenerateTiles function.


On touch WhiteTile and gameover =0 with trigger once -> set whitetiletapped=1 and gameover=1 (or call your gameover code)

If they didn't hit a whitetile and just missed the black tile past the screen, flash the tile they missed:
System Gameover=1 and whiteTiletapped=0 -> set y to background.y-200. set blackTile to blacktile.y-200, set whitetile to whitetile.y-200
subevent -> blacktile pick instance with lowest InstanceUID -> blacktile flash


hope that all makes sense i've quickly typed it out. pm if need any other help dude.
cheers
B
26
S
6
Posts: 39
Reputation: 1,574

Post » Thu Jun 05, 2014 3:28 am

can you send me .capx please ?
B
45
S
16
G
8
Posts: 792
Reputation: 8,306

Post » Wed Jun 11, 2014 2:45 pm

hi,
can you send me the .capx ??? please its urgent
i can pay you
B
45
S
16
G
8
Posts: 792
Reputation: 8,306

Next

Return to How do I....?

Who is online

Users browsing this forum: bluesun66 and 9 guests