Game Development Community

Better Understanding %WorldLimit and %onUpdate Together

by rennie moffat · in Torque Game Builder · 10/22/2009 (7:42 pm) · 107 replies

Hi there, if some could, please tell me where I am going wrong with this, or if I am not, I sure I am though. Where I am having most trouble is where I link things, so to speak, I am not sure about my on update and even if it should exist and if it should what command should really go in there.


function Enemy::onLevelLoaded(%this)
{
  %this.owner.enableUpdateCallback();
   
  %left = getWord(%worldLimit, 1);
  %top = getWord(%worldLimit, 2);
  %right = getWord(%worldLimit, 3);
  %bottom = getWord(%worldLimit, 4);

  %this.setWorldLimit("NULL", %left, %top, %right, %bottom, true);
  
 }
 
 
function enemy::onUpdate(%this)
{
	%this.getPosition();	
}
 
 
function enemy::onWorldLimit(%this, %limitMode, %limit)
{
	
	
	%this.owner.getWorldLimit();
	
	switch$(%limit)
	{
		case "left":
		if (%this.left)
		{
			%this.owner.setLinearVelocityY(5);
		}
	        case "right":
		if (%this.right)
		{
			%this.owner.setLinearVelocityY(-5);
		}
	
	        case "top":
		if (%this.top)
		{
			%this.owner.setLinearVelocityX(5);
		}
	
	        case "bottom":
		if (%this.bottom)
		{
			%this.owner.setLinearVelocityX(-5);
		}
	

	}


Page«First 1 2 3 4 5 6 Next»
#101
10/27/2009 (6:48 pm)
@Patrick. So my question is, can you write a game with relative ease, the answer you said is no. But I guess my adjusted question is, could you write a game? I ask this as I try to gage myself for the future.


And to @TED that is fine. There I will not say anything bad. You all seem to think I have no care, I disregard stuff, maybe you think I am some rebel, not sure. All I can say is I am studying everyday and will continue too, thank you very much.
#102
10/27/2009 (7:49 pm)
Actually ren, I don't think that everybody think you have no care or that you're some sort of rebel.

People think that sometimes you don't focus enough on the problem to understand it. And the big number of posts in a pretty small time doesn't help to show you're really focusing on the problems and the advices.

Just my 2 cents...
#103
10/27/2009 (8:04 pm)
Cool, thanks dude,
im on the brink of something!




#104
10/27/2009 (8:22 pm)
Your problem is how and what you're studying, not how much time you're studying it. If you skip to the end of a math book before you fully understand the first chapter, you're going to be hopelessly confused no matter how long you study it.

Until you understand that, and accept that you need to take a different approach - i.e. "change your ways" as I said earlier - I can't help you. I'd like to help, but you're asking questions about what you're reading in the last chapter of the book. To answer you, I need to use terms and concepts from the first chapter - and you haven't yet learned those.
#105
10/27/2009 (8:31 pm)
ok, I can accept that but I still I guess am going to do a Frank Sinatra regardless. So I will do it my way, but believe me I am taking head. My only good example is of what I am going for is when someone kindly showed me how to setLinearVelocity correctly on an object onLevelLoaded, I can set linear velocities on Objects like nobodies business now. All because of one kind guy. Anyhow, thats my point, it may be very obvious to you what I am doing wrong and the fact you don't just write "Rennie you are doing this is what frustrates me.


Sometimes you got a kid on the big hill first.





#106
10/27/2009 (9:12 pm)
Quote:My only good example is of what I am going for is when someone kindly showed me how to setLinearVelocity correctly on an object onLevelLoaded, I can set linear velocities on Objects like nobodies business now.

I'll give you that, but if you studied the basics instead of doing a "Frank Sinatra", as you said, then not only would you have understood how to set that, but you wouldn't be asking to do a lot of the things you are asking, because most of the questions would be answered with the basic knowledge.

You say flat out that you want to do things your own way, and it's obvious that it's not working out. You disregard others who have been where you are and have studied the basics to get to where they are now, causing them to stop helping you. And you insist on using obscure references and terminology instead of using the terminology that is standard for coding and scripting, confusing anyone who tries to help you, as well as confusing yourself.

So, it's not that you're a rebel, but that your methods are causing you to go through ten times more hoops than you should be, and it's running people off. And the amount of attention you ask of the forums competes with others who are trying to learn. I'm not saying that you should never ask a question, but what you're doing is excessive, IMHO.
#107
10/28/2009 (3:06 am)
Ok, well I want to learn quickly and a lots,
if you read my bio it says that.






Page«First 1 2 3 4 5 6 Next»