How do I move my player without losing other sprites ?

Get help using Construct 2

Post » Thu Dec 29, 2016 12:01 am

Hi my name is Jazz813 and I have some troubleshots about my little project. First of all let's start from the beginning of my problem, I want to create a Game & Watch like game, I can move the player but in 5 differrent Layouts and here comes also my problem, here a picture from my game so maybe everyone can make a better image of the problem.
Image
So my problem is that when I move my player from left or right the birdscrap will disapear when the next frame jumps to the next Layout what's logical, I also tried to work with more Layer in one Layout because I think that if everything plays in one Layout it should work, but also there I encouted problems and it's when I tip it in the event sheet that the Player will move when I press the left or right button from the keyboard for example, it work for one frame but maybe I don't know the option to do it so , but I can't say the programm that if I press the left button anew the player move to the left agian and the last picture disapear...
Could anyone help me on this problem ?

Thanks very much
Jazz813
B
6
S
1
Posts: 8
Reputation: 366

Post » Thu Dec 29, 2016 12:10 am

Let me try to help.

I don't think I understand it correctly, but for this game style, I think you could do something like this:
positionNum, that can be 0, 1, 2, 3 or 4 (the number of images you have).

positionNum = 2;

Every tick
- Set frame = positionNum;
- sprite.set x = 300+(positionNum*1.2);

if you press left, subtract 1 from positionNum (if it is higher or equal zero), same logic for right
B
33
S
5
G
1
Posts: 163
Reputation: 2,698

Post » Thu Dec 29, 2016 12:17 am

@Scofano's suggestion will work.

@Jazz813, you'll need to ether share your CAPX so we know what you're doing, or better define it.
You'll need specific positions for each placement of the sprite, which I'm sure you know by now. If you're going to make a layout for each frame of the game, you'd need to create a layout for each possibility in-game, which is incredibly complicated, and a total waste of time.

Also, if English isn't your native language, please include your native language, so we might be able to be of more help.
ImageImage
B
49
S
15
G
2
Posts: 270
Reputation: 6,649

Post » Thu Dec 29, 2016 1:33 am

Ah ok yeah my native language is Luxembourgish but I can also speak German because no translater translate Luxembourgish correctly. :cry: So I write in German if I could.

Ok, nun gut mein Problem ist halt dass wenn ich es nur in einem Layout erstelle das zukünftige Spiel, dann habe ich das Problem Construct 2 zu sagen dass bei jedem Klick auf die Tastatur zum Beispiel nach links die Figur einmal nach Links bewegt und die jeweilige andere Figur verschwindet.
Und da Sie mir empfohlen habt auf einem Layout das Spiel zu erstellen hat sich das mit dem anderen also mit dem fallendem Mövenmist soweit erledigt, aber habe dennoch ein Problem und zwar mit dem fallendem Mövenmist, ich habe es zwar schon herausbekommen durch Physics, den Mövenmist zum fallen zu bringen doch ein gleichmässiges flüssiges Fallen ist nicht mein Ziel sondern so halt gestöckelterweise wie halt die echten Spiele von Game & Watch.

Kann mir jemand da helfen ?
Habe nämlich schon viele Youtube Channels nach Tipps und Tricks gesucht doch die Tips die ich bisjetzt so fand sind für flüssigere Spiele so wie Super Meatboy zum Beispiel.
B
6
S
1
Posts: 8
Reputation: 366

Post » Fri Feb 03, 2017 10:39 pm

Scofano wrote:Let me try to help.

I don't think I understand it correctly, but for this game style, I think you could do something like this:
positionNum, that can be 0, 1, 2, 3 or 4 (the number of images you have).

positionNum = 2;

Every tick
- Set frame = positionNum;
- sprite.set x = 300+(positionNum*1.2);

if you press left, subtract 1 from positionNum (if it is higher or equal zero), same logic for right


Ok it comes a little late but thanks for the tip but I have an other problem now or I'm just to dumb to see the solution right, I already found out with your tip that I need just one sprite with all the animation in it to animate the character, but I can't figure it out after I say to Construct 2 that he should turn the player one step to the left every time when I click to the left button, but maybe you could help me better when I show you my problem I dealing with.
Imagebilder uploaden

Thanks very much if you could help me to clearify on that problem.
B
6
S
1
Posts: 8
Reputation: 366

Post » Fri Feb 17, 2017 9:01 pm

Dude, if you want the easy way, think about it like this:

1---2---3---4
:) :( :o :mrgreen:

The whole sprite is this long
<----------------->

and you check collisions using collision points. Why do you need to really move it around?

Make a variable positionNum and subtract 1 when you press left and add 1 when you press right (since it doesnt get <1 and neither >4) and player.setframe = positionNum


If positionNum =1 it will look like this
:)
<------------------> (this is the width of your sprite, with blank space, just use collision points to make it collidable where you want, each frame) and I think your problem is solved with 3 or 4 lines of code.
Last edited by Scofano on Fri Feb 17, 2017 9:03 pm, edited 1 time in total.
B
33
S
5
G
1
Posts: 163
Reputation: 2,698

Post » Tue Feb 21, 2017 8:45 pm

Ok thanks very much for your advise.
B
6
S
1
Posts: 8
Reputation: 366

Post » Tue Feb 21, 2017 9:54 pm

Not exactly sure what your player is doing but looks like you need a Wait in between changing your animation or you will never see the first animation in event 1.

Rumble set Y = 712
Wait 0.3 seconds
Rumble set animation frame 2
Banned User
B
28
S
7
G
58
Posts: 1,229
Reputation: 34,825

Post » Wed Feb 22, 2017 5:27 pm

Ok thanks for the advise.
B
6
S
1
Posts: 8
Reputation: 366


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 27 guests