anybody want to quickly explain this
Posted:
Sat Oct 29, 2011 2:14 pm
by NightOfHorror
I merged level1 and titlescreen together as now I am going to do just a few more things to the game, and that is acceleration, music, sounds, explosions, graphics, and lastly, a way to know how damaged player and enemy are. All seemed smooth. Then I said to not have events run for player and enemy(only two actors besides there missiles) if they were out of vision, and I expected that to make me be able to be in titlescreen, and other levels and nothing would happen in level1. The problem is that when I am out of vision the enemies break through the walls that make them stay in the level1view. What is with that?
Re: anybody want to quickly explain this
Posted:
Sat Oct 29, 2011 2:46 pm
by lcl
Well it's most likely that since they don't receive any events, they don't receive collision events either. And if you're using xvelocity it just continues with the speed.
You could do:
Enemy - draw actor - script editor
- Code: Select all
xvelocity *= (xscreen > 0 && xscreen < view.width);
This code multiplies xvelocity with 1 if the enemy is on screen and with 0 if not.
This way it won't move if it's not on screen.
I hope this helps.
- lcl -
Re: anybody want to quickly explain this
Posted:
Sat Oct 29, 2011 5:05 pm
by NightOfHorror
thanks. I was just confused because I know that enemies collisions would stop, but I thought movement would stop as well.
+1
Re: anybody want to quickly explain this
Posted:
Sat Oct 29, 2011 5:24 pm
by lcl
NightOfHorror wrote:thanks. I was just confused because I know that enemies collisions would stop, but I thought movement would stop as well.
+1
Well, the movement continues because actor variables are not changed and xvelocity will remain the same it is.
Re: anybody want to quickly explain this
Posted:
Sat Oct 29, 2011 5:28 pm
by NightOfHorror
there is a few problems left. I'll let you be though since you helped me a lot already. Thanks for all you have done. When you get chance too, maybe you should listen to Snorky.
Re: anybody want to quickly explain this
Posted:
Sat Oct 29, 2011 7:40 pm
by NightOfHorror
if you want then I will rather show you because I suck at explaining and then you can tell me what's wrong.
Re: anybody want to quickly explain this
Posted:
Sat Oct 29, 2011 11:01 pm
by lcl
NightOfHorror wrote:if you want then I will rather show you because I suck at explaining and then you can tell me what's wrong.
Ok, we can do it this way
Re: anybody want to quickly explain this
Posted:
Sun Oct 30, 2011 4:51 pm
by NightOfHorror
okay, sorry for the day wait, been busy since that post.