View Full Version : need rockets :)
Lionheart008
02-03-2009, 14:32
hi all:)
I am looking for a simple script (example) or help for making rockets :) have a space ship, a little scene with player status and would like to destroy upcoming hurdles or meteors to destroy by laser weapons... and not only with laser lines (colored)... I have had a short look at the grandios robot duel script, but it's just confusing me... yet... to heavy to understand for me at this moment ;)
anybody can help??? I am testing a new little game for me... to realize it as soon as I can grap the knowledge...
rockets... emitter... texture
bye, Lionheart, best regards from raining germany:D
Petr Schreiber
02-03-2009, 15:32
Frank,
I know you played with example where asteroids were destroyed by rocket, so you are ready for this part.
Regarding shooting rockets - simply add new entity on place of gun (TBGL_EntityGetPos/TBGL_EntityTrackPos), use TBGL_EntitySyncAxes to make it rotated the same as rocket is.
Keep track of currently active rockets and push them each frame.
It cannot be simplier :)
Petr
Lionheart008
03-03-2009, 21:12
hi petr, hi all:)
question, encore une fois;)
I would like to handle with the 'PlayerX, PlayerY' function my space shipe (%eEntity)... but how can I say that this ship should shot or making particles around it ???
mean such things:
' Controls test
if tbgl_GetWindowKeyState( hWnd, %VK_UP) then
PlayerY = PlayerY + 3/FrameRate
If PlayerY > 2.6 Then PlayerY = 2.6
elseif tbgl_GetWindowKeyState( hWnd, %VK_DOWN) then
PlayerY = PlayerY - 3/FrameRate
If PlayerY < -2.6 Then PlayerY = -2.6
end if
TBGL_EntityCreateDlSlot(%My_World, %esolart, 0, %lsolart)
TBGL_Entitysetpos(%My_World, %esolart, -2.4,0.41,4.5)
my next step will be to create rockets... :)
bye, best regards, Lionheart, working step by step on a big example :D
Petr Schreiber
03-03-2009, 21:20
Frank,
you can use PlayerX, PlayerY and simply use TBGL_EntitySetPos( %scene, %entity, PlayerX, PlayerY, 0 ) to control the rocket.
To shoot:
(pseudocode)
IF shootkeypressed THEN
' -- Retrieve ship position
' -- Create new entity at that position ( starting from offset %eRockets for example )
END IF
...
' -- Animating rocket movement
SUB ProcessRockets()
...
FOR i = %eRockets TO %eRockets + numberOfRockets
TBGL_EntityPush(%scene, i, 0, 0, 10/FrameRate)
NEXT
...
END SUB
Petr
Lionheart008
04-03-2009, 19:47
hi petr, thank you for help! :)
hi all:)
...it will takes some days, weeks, if this little game is ready... there aren't any meteors yet, I have programmed everything new with entity system;) started by zero... not so easy... the next thing I will make is a good particle system (have built a first version!, collision detection I will have to study more... and so on... uff :roll: exciting stuff! :D
the rockets I will create the next days...
what may be the best way to create a energy shield for my space ship or/and enemies???
If laser will hit the energy shield how can I simulate or create such a energy sphere?
some enemies should upcome and meteors or other hurdles they will catch the good ones:) the player can destroy hurdles, meteors or space ships... there are some enemies and only one or two good heroes :lol:
more will come... a little screenshot I add here for fun... I will take the script easy to handle and the little game will be also easy to play... my dream, must laugh :)
good evening, Lionheart
ps: problem nearly solved...;) have found an existing, old tbgl example for my problem... more will come...
Lionheart008
09-03-2009, 15:37
hi all:)
sorry, haven't time enough to develop further on my project at the moment, but have found a good way to make something with emitter I will use it for rocket power (propulsion) ;) the rockets I will build for my space ships may looks like this one... and
...the way to my lovely rockets will go through particles...
I have made this two exercise for it... and have learnt to handle with simple emitter effects:)
more will come, have a nice week, I am very stressed by my good devil mr. dentist! :D
ciao, Lionhead, all work in progress;) I hope I am healthy after my artificial teeth op :)
ps: bounding boxes are best fitted for collision detection and energy shields ;), but this heavy chapter is for another month :)
Michael Hartlef
09-03-2009, 17:06
Good luck with the operation.
Lionheart008
11-03-2009, 12:20
thank you michael :)
hi all:)
the teeth op was very good, better as I have thought and without fear, cause my female mrs. dentist has worked very softly with my mouth ;) I am glad to have the op behind me...
little question: where can I find the win32api.inc??? I need it... for my project ....
#INCLUDE "win32api.inc"
possible I have it on my win xp machine???
best regards, Lionheart
have all a nice day and more will come about my current project... I am learning a lot by doing some experiments with emitter and collisions.... :D after that I plan to make a ship with playerX,playerY entity modus :) makes a lot of fun...
see you, lionheart
@michael hartlef: good luck for your projects around tbgl...
ps: sorry, but how can I use open gl 3d libraries? If I have found some interesting libraries for a game or project, how can I implement these stuff for my little game???
Petr Schreiber
11-03-2009, 16:21
Hi Frank,
I am happy to hear (read!) your operation ended with error flag set to false.
Win32api.inc is PowerBASIC header file with binding to Windows API:
http://www.powerbasic.com/support/downloads/files/win32api.zip
It is made for PBers, not sure if it works with TB.
I am not sure by what you mean OpenGL 3D libraries? If you need raw OpenGL, go for thinbasic_gl*.inc headers, otherwise you need to write header ( using DECLARE ... ) on your own or create wrapper module via ThinBasic SDK.
Petr
Lionheart008
21-03-2009, 05:22
hi all, hi petr:)
have changed my last particle try example and add a rotation of camera... and have taken a box for the emitter list and not the old sphere ;) ... have learnt some more about it... makes fun :) the rocket problem to follow an object and explode after a certain time I have to solve for me alone with entity system... ;)
thanks for the infos about win32api.inc, but I don't need it and I agree with you to use the thinbasic_gl*.inc headers I have noticed in some tbgl example of the bonus packs... :)
good night or good morning, best regards to my bed, Lionhead :D
ps: special effects and/or particle examples are best fitted for screensaver ... must laugh...
Lionheart008
28-03-2009, 12:48
hi petr, hi all:)
perhaps somebody can tell me how to handle with laser weapons with entity modus ;)
I have some error messages because of the laserindex...
'TBGL_ENTITYSETPOS( %MY_WORLD, %eLight, Laser(LaserIndex).x, Laser(LaserIndex).y, Laser(LaserIndex).z, 250, 10, 0)
I have used the tbgl-funshoot example with lasers, but I didn't manage it... I have thought it could be done by the lightsetposition... but withouth success...
best regards, I am in a hurry today... private things happened to my girl friend, I have to care about her... :D
ciao, Lionheart
my little game example will come, no pardon... must laugh... a little but it's a big issue... uargh...
ciao, have a nice weekend to all thinbasic users :D
ps: last edit... will build laserpower with my own power, have got a good idea :D... wasn't so clear in mind this morning... have deleted the script part, sorry... ;)