Game Development Community

dev|Pro Game Development Curriculum

Coding with TGB

by Piotr Witkowski · 07/24/2010 (3:41 pm) · 6 comments

I have been toying with the idea of creating a game for iPhone for some time now. Since I currently do not own neither iPhone nor any Mac machine (I am a PC for that matter), prototyping on my old, Windows driven notebook seems to be the right idea. I am also too busy a man to start from scrach, so I decided to give a try Torque Game Builder, which should allow me a flying start (so at least I hope).

The idea for my games is very simple really - ALIEN ABDUCTION :), which will be based on very nice flash game: http://www.miniclip.com/games/ufo-joe/en/

Here is the link to my blog: http://codingwithtgb.blogspot.com/

#1
07/24/2010 (5:16 pm)
Looks interesting. Good luck with your new project. :)
#2
07/24/2010 (6:58 pm)
Excellent start. Keep at it.. and keep us updated!
#3
07/24/2010 (10:51 pm)
Good simple idea, because half the problem with iPhone game projects is that the game is to complex...and not simple enough.

But good luck! Keep us updated
#4
07/25/2010 (12:17 am)
Alien Abduction is a great game!

I'm curious... What's the difference between what you coded and using the built in collision system via in script?
function obstacle::onCollision(%srcObject, %dstObject, %srcRef, %dstRef, %time, %normal, %contacts, %points)
{
   %vel = %srcObject.getLinearVelocity();
}
#5
07/25/2010 (11:04 am)
Hi Patric,

Thanks for your feedback. It looks like onCollition method is being called after objects' velocities are zeroed. For the following code:

function player::onCollision(%srcObject, %dstObject, %srcRef, %dstRef, %time, %normal, %contacts, %points)
{
	echo("%srcObject vel = " @ %srcObject.getLinearVelocity() );   
   	echo("%dstObject vel = " @ %dstObject.getLinearVelocity() );
}

I am getting:

%srcObject vel = 0.000000 0.000000
%dstObject vel = 0.000000 0.000000
%srcObject vel = 0.000000 0.000000
%dstObject vel = 0.000000 0.000000
%srcObject vel = 0.000000 0.000000
%dstObject vel = 0.000000 0.000000
%srcObject vel = 0.000000 0.000000
%dstObject vel = 0.000000 0.000000


I also remember reading somewhere on the forum, that this was exactly the case for onCollision call.

Interestingly, when I try different collision (meaning different object and different angles) I am able to get the following:

%srcObject vel = 0.000000 0.000000
%dstObject vel = 0.000000 0.000000
%srcObject vel = -6.368989 -4.773498
%dstObject vel = 0.000000 0.000000
%srcObject vel = -5.327312 -3.992772
%dstObject vel = 0.000000 0.000000
%srcObject vel = -4.572809 -3.427278
%dstObject vel = 0.000000 0.000000
%srcObject vel = -3.839827 -2.877915
%dstObject vel = 0.000000 0.000000
%srcObject vel = -3.127752 -2.344221
%dstObject vel = 0.000000 0.000000

#6
07/26/2010 (1:04 am)
Thanks Piotr! That's a nice clean solution to the problem. I'll be following your blog.

Good luck!