GMBR
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.
Entrar

Esqueci-me da senha

Últimos assuntos
» Colisões não funcionando
por RastaMaan Hoje à(s) 19:49

» Como ajustar velocidade de cada frame da animação no game maker
por pequetux Hoje à(s) 16:45

» Preciso de ajuda
por AftonDuGrau Dom 21 Abr 2024, 20:18

» Como faz o evento drawn GUI, não se repetir?
por aminaro Sex 19 Abr 2024, 20:30

» PROBLEMAS COM FÍSICAS DE ÁGUA
por aminaro Ter 16 Abr 2024, 10:07

» Retorno da GMBR!!!
por Ralphed Sex 12 Abr 2024, 22:45

» JOGADOR PARANDO NO AR QUANDO ATACA
por aminaro Qua 10 Abr 2024, 13:51

» Problemas com texto interativo
por Kaaru72 Dom 07 Abr 2024, 11:31

» Erro escondido e indecifrável
por dev_gabize.azv Qui 04 Abr 2024, 10:11

» Mudar cor de apenas uma palavra
por Ralphed Sáb 30 Mar 2024, 00:39

» Procuro Programador de game maker
por Wou Sex 15 Mar 2024, 10:27

» Mod APK
por gamerainha Qua 13 Mar 2024, 06:30

» Aceito pedidos de sprites (Com exemplos meus)
por Sevilha Qua 28 Fev 2024, 12:17

» Inventário simples
por Isquilo_Roedor Qui 22 Fev 2024, 15:18

» Problemas na programaçnao de inimigo [jogo DOOM LIKE]
por Black Mirror Dom 11 Fev 2024, 13:34

» ANDROID MULTI TOUCH
por DiegoBr Dom 04 Fev 2024, 12:13

» Servidor de Discord do fórum?
por Lighter Sáb 27 Jan 2024, 17:18

» Save e Load Json
por Klinton Rodrigues Qui 25 Jan 2024, 11:12

» Colisão com mais de um objeto
por aminaro Seg 22 Jan 2024, 15:02

» Oi sou novo aqui
por Thiago Silveira Alexandre Sáb 20 Jan 2024, 20:55

» Como acessar conteudo comprado no marketplace
por macmilam Sex 19 Jan 2024, 07:42

» Devlogs em vídeos do Block Room
por Joton Seg 15 Jan 2024, 16:56

» Alguém aqui já ganha dinheiro com seus games?
por Joton Seg 15 Jan 2024, 16:49

» ACERVO GMBR MAGAZINE
por Joton Qui 11 Jan 2024, 19:21

» como aumentar o obj sem aumentar a colisão??
por GabrielXavier Qua 10 Jan 2024, 07:21


[RESOLVIDO]''PLAYER TRAVA NA BARRA''

3 participantes

Ir para baixo

[RESOLVIDO]''PLAYER TRAVA NA BARRA'' Empty [RESOLVIDO]''PLAYER TRAVA NA BARRA''

Mensagem por All-x Qua 04 Fev 2009, 00:40

Eai pessoal, no meu jogo tem uma barra q vai da direita para esquerda, meu player pula em cima dela tranquilo e tudo vai certo! só que quando ele colide na lateral na barra ele trava:

[RESOLVIDO]''PLAYER TRAVA NA BARRA'' Pngyt9

eu queria q quando a PLAYER batesse na lateral a BARRA voltasse para a direção inversa!

''DESDE JA OBRIGADO''

FLWS!




Projetos completos

SUPER MARIO MAZE: https://gmbr.forumeiros.com/galeria-de-projetos-completos-f6/super-mario-maze-101bugs-retirados-t1824.htm

SUPER ARKANOID X: https://gmbr.forumeiros.com/galeria-de-projetos-completos-f6/super-arkanoid-x-versao-atualizada24-01-09-t1889.htm

Projetos em desenvolvimento:

Tankpanzer: 20% Concluído
Robot 27: 20% Concluído
The war of Archer: the escape of the witch: 15% Concluído

Engines:

Engine de pause: https://gmbr.forumeiros.com/engines-f12/engine-de-pause-t2190.htm

Engine healthbar segui a tela: https://gmbr.forumeiros.com/engines-f12/engine-para-o-health-seguir-a-tela-t2036.htm

Engine healthbar para o inimigo:
https://gmbr.forumeiros.com/engines-f12/engine-health-bar-para-o-inimigo-t2035.htm



O prêmio por uma coisa bem feita é tê-la feito.


Última edição por Alex FC em Sex 06 Fev 2009, 15:45, editado 2 vez(es)
All-x
All-x

Games Ranking : Nota A

Notas recebidas : B A
Data de inscrição : 20/12/2008
Reputação : 189
Número de Mensagens : 2571
Prêmios : [RESOLVIDO]''PLAYER TRAVA NA BARRA'' Empty

Medalhas x 0 Tutoriais x 25 Moedas x 0

Ouro x 2 Prata x 1 Bronze x 1

Insignia 1 x 1 Insignia 2 x 0 Insignia 3 x 0
Plataformas :
  • Game Maker 8.0 ou 8.1
  • Game Maker Studio 1.4
  • Game Maker Studio 2.0
  • Javascript
  • C ou C++


https://redscreensoft.com

Ir para o topo Ir para baixo

[RESOLVIDO]''PLAYER TRAVA NA BARRA'' Empty Re: [RESOLVIDO]''PLAYER TRAVA NA BARRA''

Mensagem por Gusba Qua 04 Fev 2009, 01:12

coloca na barra com a colisao com o player:



Código:
vspeed *=  -1;
Gusba
Gusba

Data de inscrição : 03/08/2008
Reputação : 0
Número de Mensagens : 1156
Prêmios : [RESOLVIDO]''PLAYER TRAVA NA BARRA'' Empty

Medalhas x 0 Tutoriais x 0 Moedas x 0

Ouro x 1 Prata x 0 Bronze x 0

Insignia 1 x 0 Insignia 2 x 0 Insignia 3 x 0

http://www.ciganospictures.hd1.com.br

Ir para o topo Ir para baixo

[RESOLVIDO]''PLAYER TRAVA NA BARRA'' Empty Re: [RESOLVIDO]''PLAYER TRAVA NA BARRA''

Mensagem por All-x Qua 04 Fev 2009, 12:46

eu fiz essse codigo só q quando o player pula em cima a barra só fica indo pra esquerda!e meu player pula em cima da barra para ir de um lugar para o outro!

o problema é na lateral esquerda e direita da barra! o player sobe em cima da barra sem problemas! mas quando ele colide na lateral da barra ele trava!

flws!




Projetos completos

SUPER MARIO MAZE: https://gmbr.forumeiros.com/galeria-de-projetos-completos-f6/super-mario-maze-101bugs-retirados-t1824.htm

SUPER ARKANOID X: https://gmbr.forumeiros.com/galeria-de-projetos-completos-f6/super-arkanoid-x-versao-atualizada24-01-09-t1889.htm

Projetos em desenvolvimento:

Tankpanzer: 20% Concluído
Robot 27: 20% Concluído
The war of Archer: the escape of the witch: 15% Concluído

Engines:

Engine de pause: https://gmbr.forumeiros.com/engines-f12/engine-de-pause-t2190.htm

Engine healthbar segui a tela: https://gmbr.forumeiros.com/engines-f12/engine-para-o-health-seguir-a-tela-t2036.htm

Engine healthbar para o inimigo:
https://gmbr.forumeiros.com/engines-f12/engine-health-bar-para-o-inimigo-t2035.htm



O prêmio por uma coisa bem feita é tê-la feito.


Última edição por Alex FC em Sex 06 Fev 2009, 15:46, editado 1 vez(es)
All-x
All-x

Games Ranking : Nota A

Notas recebidas : B A
Data de inscrição : 20/12/2008
Reputação : 189
Número de Mensagens : 2571
Prêmios : [RESOLVIDO]''PLAYER TRAVA NA BARRA'' Empty

Medalhas x 0 Tutoriais x 25 Moedas x 0

Ouro x 2 Prata x 1 Bronze x 1

Insignia 1 x 1 Insignia 2 x 0 Insignia 3 x 0
Plataformas :
  • Game Maker 8.0 ou 8.1
  • Game Maker Studio 1.4
  • Game Maker Studio 2.0
  • Javascript
  • C ou C++


https://redscreensoft.com

Ir para o topo Ir para baixo

[RESOLVIDO]''PLAYER TRAVA NA BARRA'' Empty Re: [RESOLVIDO]''PLAYER TRAVA NA BARRA''

Mensagem por Gusba Qua 04 Fev 2009, 13:09

entao coloca isso na colisao:


Código:
if (y > other.y) {
      vspeed *= -1;
}

marca a origem y da barra pra 0 e se a origem y do player for maior que 0, coloca isso na colisa:

Código:
if ((y + sprite_yoffset) > other.y) {
      vspeed *= -1;
}
Gusba
Gusba

Data de inscrição : 03/08/2008
Reputação : 0
Número de Mensagens : 1156
Prêmios : [RESOLVIDO]''PLAYER TRAVA NA BARRA'' Empty

Medalhas x 0 Tutoriais x 0 Moedas x 0

Ouro x 1 Prata x 0 Bronze x 0

Insignia 1 x 0 Insignia 2 x 0 Insignia 3 x 0

http://www.ciganospictures.hd1.com.br

Ir para o topo Ir para baixo

[RESOLVIDO]''PLAYER TRAVA NA BARRA'' Empty Re: [RESOLVIDO]''PLAYER TRAVA NA BARRA''

Mensagem por All-x Qua 04 Fev 2009, 13:23

não deu certo! ai ta meu problema:

[RESOLVIDO]''PLAYER TRAVA NA BARRA'' Barrzk1

FLWS!




Projetos completos

SUPER MARIO MAZE: https://gmbr.forumeiros.com/galeria-de-projetos-completos-f6/super-mario-maze-101bugs-retirados-t1824.htm

SUPER ARKANOID X: https://gmbr.forumeiros.com/galeria-de-projetos-completos-f6/super-arkanoid-x-versao-atualizada24-01-09-t1889.htm

Projetos em desenvolvimento:

Tankpanzer: 20% Concluído
Robot 27: 20% Concluído
The war of Archer: the escape of the witch: 15% Concluído

Engines:

Engine de pause: https://gmbr.forumeiros.com/engines-f12/engine-de-pause-t2190.htm

Engine healthbar segui a tela: https://gmbr.forumeiros.com/engines-f12/engine-para-o-health-seguir-a-tela-t2036.htm

Engine healthbar para o inimigo:
https://gmbr.forumeiros.com/engines-f12/engine-health-bar-para-o-inimigo-t2035.htm



O prêmio por uma coisa bem feita é tê-la feito.


Última edição por Alex FC em Sex 06 Fev 2009, 15:46, editado 1 vez(es)
All-x
All-x

Games Ranking : Nota A

Notas recebidas : B A
Data de inscrição : 20/12/2008
Reputação : 189
Número de Mensagens : 2571
Prêmios : [RESOLVIDO]''PLAYER TRAVA NA BARRA'' Empty

Medalhas x 0 Tutoriais x 25 Moedas x 0

Ouro x 2 Prata x 1 Bronze x 1

Insignia 1 x 1 Insignia 2 x 0 Insignia 3 x 0
Plataformas :
  • Game Maker 8.0 ou 8.1
  • Game Maker Studio 1.4
  • Game Maker Studio 2.0
  • Javascript
  • C ou C++


https://redscreensoft.com

Ir para o topo Ir para baixo

[RESOLVIDO]''PLAYER TRAVA NA BARRA'' Empty Re: [RESOLVIDO]''PLAYER TRAVA NA BARRA''

Mensagem por Gusba Qua 04 Fev 2009, 13:41

cara, fiz , tenta assim:

coloca no objeto player, no evento de colisao com a plataforma:

Código:
if (y > other.y) {
      other.vspeed *= -1;
}
Gusba
Gusba

Data de inscrição : 03/08/2008
Reputação : 0
Número de Mensagens : 1156
Prêmios : [RESOLVIDO]''PLAYER TRAVA NA BARRA'' Empty

Medalhas x 0 Tutoriais x 0 Moedas x 0

Ouro x 1 Prata x 0 Bronze x 0

Insignia 1 x 0 Insignia 2 x 0 Insignia 3 x 0

http://www.ciganospictures.hd1.com.br

Ir para o topo Ir para baixo

[RESOLVIDO]''PLAYER TRAVA NA BARRA'' Empty Re: [RESOLVIDO]''PLAYER TRAVA NA BARRA''

Mensagem por All-x Qua 04 Fev 2009, 14:14

não deu certo, ainda ta travando!

FLWS!




Projetos completos

SUPER MARIO MAZE: https://gmbr.forumeiros.com/galeria-de-projetos-completos-f6/super-mario-maze-101bugs-retirados-t1824.htm

SUPER ARKANOID X: https://gmbr.forumeiros.com/galeria-de-projetos-completos-f6/super-arkanoid-x-versao-atualizada24-01-09-t1889.htm

Projetos em desenvolvimento:

Tankpanzer: 20% Concluído
Robot 27: 20% Concluído
The war of Archer: the escape of the witch: 15% Concluído

Engines:

Engine de pause: https://gmbr.forumeiros.com/engines-f12/engine-de-pause-t2190.htm

Engine healthbar segui a tela: https://gmbr.forumeiros.com/engines-f12/engine-para-o-health-seguir-a-tela-t2036.htm

Engine healthbar para o inimigo:
https://gmbr.forumeiros.com/engines-f12/engine-health-bar-para-o-inimigo-t2035.htm



O prêmio por uma coisa bem feita é tê-la feito.


Última edição por Alex FC em Sex 06 Fev 2009, 15:47, editado 1 vez(es)
All-x
All-x

Games Ranking : Nota A

Notas recebidas : B A
Data de inscrição : 20/12/2008
Reputação : 189
Número de Mensagens : 2571
Prêmios : [RESOLVIDO]''PLAYER TRAVA NA BARRA'' Empty

Medalhas x 0 Tutoriais x 25 Moedas x 0

Ouro x 2 Prata x 1 Bronze x 1

Insignia 1 x 1 Insignia 2 x 0 Insignia 3 x 0
Plataformas :
  • Game Maker 8.0 ou 8.1
  • Game Maker Studio 1.4
  • Game Maker Studio 2.0
  • Javascript
  • C ou C++


https://redscreensoft.com

Ir para o topo Ir para baixo

[RESOLVIDO]''PLAYER TRAVA NA BARRA'' Empty Re: [RESOLVIDO]''PLAYER TRAVA NA BARRA''

Mensagem por Janx Qua 04 Fev 2009, 14:21

humm.. o personagem trava quando encosta na lateral da barra? é isso?

tente assim:

No step coloque:

while place_meeting(x+2,y,barra)
{x-=1;}
while place_meeting(x-2,y,barra)
{x+=1;}

isso vai fazer o jogador, 'sair da barra' caso "entre" nela

Flw..
Janx
Janx

Data de inscrição : 24/05/2008
Reputação : 14
Número de Mensagens : 2417
Prêmios : [RESOLVIDO]''PLAYER TRAVA NA BARRA'' Empty

Medalhas x 0 Tutoriais x 0 Moedas x 0

Ouro x 0 Prata x 2 Bronze x 0

Insignia 1 x 0 Insignia 2 x 0 Insignia 3 x 0

Ir para o topo Ir para baixo

[RESOLVIDO]''PLAYER TRAVA NA BARRA'' Empty Re: [RESOLVIDO]''PLAYER TRAVA NA BARRA''

Mensagem por All-x Qua 04 Fev 2009, 14:29

não mudou nada!

ele não entra na barra só fica emprensado nela quando ele ta na direção oposta da barra!

eu quero q quando o player batesse na lateral da barra, a barra fosse para direção contraria!

FLWS!




Projetos completos

SUPER MARIO MAZE: https://gmbr.forumeiros.com/galeria-de-projetos-completos-f6/super-mario-maze-101bugs-retirados-t1824.htm

SUPER ARKANOID X: https://gmbr.forumeiros.com/galeria-de-projetos-completos-f6/super-arkanoid-x-versao-atualizada24-01-09-t1889.htm

Projetos em desenvolvimento:

Tankpanzer: 20% Concluído
Robot 27: 20% Concluído
The war of Archer: the escape of the witch: 15% Concluído

Engines:

Engine de pause: https://gmbr.forumeiros.com/engines-f12/engine-de-pause-t2190.htm

Engine healthbar segui a tela: https://gmbr.forumeiros.com/engines-f12/engine-para-o-health-seguir-a-tela-t2036.htm

Engine healthbar para o inimigo:
https://gmbr.forumeiros.com/engines-f12/engine-health-bar-para-o-inimigo-t2035.htm



O prêmio por uma coisa bem feita é tê-la feito.


Última edição por Alex FC em Sex 06 Fev 2009, 15:48, editado 1 vez(es)
All-x
All-x

Games Ranking : Nota A

Notas recebidas : B A
Data de inscrição : 20/12/2008
Reputação : 189
Número de Mensagens : 2571
Prêmios : [RESOLVIDO]''PLAYER TRAVA NA BARRA'' Empty

Medalhas x 0 Tutoriais x 25 Moedas x 0

Ouro x 2 Prata x 1 Bronze x 1

Insignia 1 x 1 Insignia 2 x 0 Insignia 3 x 0
Plataformas :
  • Game Maker 8.0 ou 8.1
  • Game Maker Studio 1.4
  • Game Maker Studio 2.0
  • Javascript
  • C ou C++


https://redscreensoft.com

Ir para o topo Ir para baixo

[RESOLVIDO]''PLAYER TRAVA NA BARRA'' Empty Re: [RESOLVIDO]''PLAYER TRAVA NA BARRA''

Mensagem por Janx Qua 04 Fev 2009, 14:46

a! se quer inverter a direçao da barra?

intao no evento de colisao da barra com o player
coloque

Código:
hspeed = -hspeed
x += hspeed
Janx
Janx

Data de inscrição : 24/05/2008
Reputação : 14
Número de Mensagens : 2417
Prêmios : [RESOLVIDO]''PLAYER TRAVA NA BARRA'' Empty

Medalhas x 0 Tutoriais x 0 Moedas x 0

Ouro x 0 Prata x 2 Bronze x 0

Insignia 1 x 0 Insignia 2 x 0 Insignia 3 x 0

Ir para o topo Ir para baixo

[RESOLVIDO]''PLAYER TRAVA NA BARRA'' Empty Re: [RESOLVIDO]''PLAYER TRAVA NA BARRA''

Mensagem por All-x Qua 04 Fev 2009, 14:53

[RESOLVIDO]''PLAYER TRAVA NA BARRA'' Barrata0

ESSA BARRA TAMBEM É USADA PARA O PLAYER IR DE UM LUGAR PARA O OUTRO!
SE EU UTILIZAR ESSE CÓDIGO , TODA VEZ Q O PLAYER PULAR EM CIMA DA BARRA ELA VAI NA DIREÇÃO CONTRARIA! E EU SÓ QUERO Q ACONTEÇA ISSO SOMENTE QUANDO COLEDIR NA LATERAL ESQUERDA E DIREITA DA BARRA!

PROBLEMA:

[RESOLVIDO]''PLAYER TRAVA NA BARRA'' Barrzk1

FLWS!




Projetos completos

SUPER MARIO MAZE: https://gmbr.forumeiros.com/galeria-de-projetos-completos-f6/super-mario-maze-101bugs-retirados-t1824.htm

SUPER ARKANOID X: https://gmbr.forumeiros.com/galeria-de-projetos-completos-f6/super-arkanoid-x-versao-atualizada24-01-09-t1889.htm

Projetos em desenvolvimento:

Tankpanzer: 20% Concluído
Robot 27: 20% Concluído
The war of Archer: the escape of the witch: 15% Concluído

Engines:

Engine de pause: https://gmbr.forumeiros.com/engines-f12/engine-de-pause-t2190.htm

Engine healthbar segui a tela: https://gmbr.forumeiros.com/engines-f12/engine-para-o-health-seguir-a-tela-t2036.htm

Engine healthbar para o inimigo:
https://gmbr.forumeiros.com/engines-f12/engine-health-bar-para-o-inimigo-t2035.htm



O prêmio por uma coisa bem feita é tê-la feito.


Última edição por Alex FC em Sex 06 Fev 2009, 15:48, editado 1 vez(es)
All-x
All-x

Games Ranking : Nota A

Notas recebidas : B A
Data de inscrição : 20/12/2008
Reputação : 189
Número de Mensagens : 2571
Prêmios : [RESOLVIDO]''PLAYER TRAVA NA BARRA'' Empty

Medalhas x 0 Tutoriais x 25 Moedas x 0

Ouro x 2 Prata x 1 Bronze x 1

Insignia 1 x 1 Insignia 2 x 0 Insignia 3 x 0
Plataformas :
  • Game Maker 8.0 ou 8.1
  • Game Maker Studio 1.4
  • Game Maker Studio 2.0
  • Javascript
  • C ou C++


https://redscreensoft.com

Ir para o topo Ir para baixo

[RESOLVIDO]''PLAYER TRAVA NA BARRA'' Empty Re: [RESOLVIDO]''PLAYER TRAVA NA BARRA''

Mensagem por Janx Qua 04 Fev 2009, 15:53

A certo, tente assim:

colisao do player com a barra:

if place_meeting(x+2,y,other) && y+(sprite_height-sprite_get_yoffset(sprite_index) ) >other.y
{other.hspeed = -hspeed;}

if place_meeting(x-2,y,other) && y+(sprite_height-sprite_get_yoffset(sprite_index) ) >other.y
{other.hspeed = -hspeed;}


Bom, acredito que assim funcione.

Flw!
Janx
Janx

Data de inscrição : 24/05/2008
Reputação : 14
Número de Mensagens : 2417
Prêmios : [RESOLVIDO]''PLAYER TRAVA NA BARRA'' Empty

Medalhas x 0 Tutoriais x 0 Moedas x 0

Ouro x 0 Prata x 2 Bronze x 0

Insignia 1 x 0 Insignia 2 x 0 Insignia 3 x 0

Ir para o topo Ir para baixo

[RESOLVIDO]''PLAYER TRAVA NA BARRA'' Empty Re: [RESOLVIDO]''PLAYER TRAVA NA BARRA''

Mensagem por All-x Qua 04 Fev 2009, 19:04

não deu certo! o player não trava na barra só q a barra fica parada!
mas descobri um jeito diferente!É assim:

No evento step da barra:

na aba control:

check empty:

x:3
y:0
Objects: All.

Relative.


depois na aba move:

reverse horizontal direction.

na aba control:

check empty:

x:-3
y:0
Objects: All.

Relative.


depois na aba move:

reverse horizontal direction.

Obrigado pela ajuda!

FLWS!




Projetos completos

SUPER MARIO MAZE: https://gmbr.forumeiros.com/galeria-de-projetos-completos-f6/super-mario-maze-101bugs-retirados-t1824.htm

SUPER ARKANOID X: https://gmbr.forumeiros.com/galeria-de-projetos-completos-f6/super-arkanoid-x-versao-atualizada24-01-09-t1889.htm

Projetos em desenvolvimento:

Tankpanzer: 20% Concluído
Robot 27: 20% Concluído
The war of Archer: the escape of the witch: 15% Concluído

Engines:

Engine de pause: https://gmbr.forumeiros.com/engines-f12/engine-de-pause-t2190.htm

Engine healthbar segui a tela: https://gmbr.forumeiros.com/engines-f12/engine-para-o-health-seguir-a-tela-t2036.htm

Engine healthbar para o inimigo:
https://gmbr.forumeiros.com/engines-f12/engine-health-bar-para-o-inimigo-t2035.htm



O prêmio por uma coisa bem feita é tê-la feito.
All-x
All-x

Games Ranking : Nota A

Notas recebidas : B A
Data de inscrição : 20/12/2008
Reputação : 189
Número de Mensagens : 2571
Prêmios : [RESOLVIDO]''PLAYER TRAVA NA BARRA'' Empty

Medalhas x 0 Tutoriais x 25 Moedas x 0

Ouro x 2 Prata x 1 Bronze x 1

Insignia 1 x 1 Insignia 2 x 0 Insignia 3 x 0
Plataformas :
  • Game Maker 8.0 ou 8.1
  • Game Maker Studio 1.4
  • Game Maker Studio 2.0
  • Javascript
  • C ou C++


https://redscreensoft.com

Ir para o topo Ir para baixo

[RESOLVIDO]''PLAYER TRAVA NA BARRA'' Empty Re: [RESOLVIDO]''PLAYER TRAVA NA BARRA''

Mensagem por Conteúdo patrocinado


Conteúdo patrocinado


Ir para o topo Ir para baixo

Ir para o topo


 
Permissões neste sub-fórum
Não podes responder a tópicos