Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Space Triangle (WIP)

Author
Message
Spooter
16
Years of Service
User Offline
Joined: 27th May 2008
Location:
Posted: 4th Jun 2008 20:35
I decided to create my own thread for my game so that I can post how I'm doing and to get help.(Mostly just help). I had my game help posts split into like 4 threads. So I just made one single one to make it easier on me.

/*================================================*\
| Lead Programmer/Owner===============Anti-Triangle Cult=====|
\*================================================*/
Spooter
16
Years of Service
User Offline
Joined: 27th May 2008
Location:
Posted: 4th Jun 2008 20:39 Edited at: 6th Jun 2008 00:39
Things I have done:

Ammo System: Done
projectile: Done (This only shoots straight up)
Array for multiple projectiles: Done


Things I need to get done:

Ship rotation instead of strafing: Done
Making the projectile work with rotating ship: No idea
Creating one entire map that you can move across: Not Started

/*================================================*\
| Lead Programmer/Owner===============Anti-Triangle Cult=====|
\*================================================*/
Spooter
16
Years of Service
User Offline
Joined: 27th May 2008
Location:
Posted: 4th Jun 2008 20:41
I have a questions about a good way to go about making it so that when my ship rotates it will shoot a projectile out of the direction of its point(Its a triangle ship). I'm assuming I will have to draw a line using DarkGDK instead of a sprite, or rotate the sprite so that it is the same rotation as the ship. If anyone has any information please post.

Thanks

/*================================================*\
| Lead Programmer/Owner===============Anti-Triangle Cult=====|
\*================================================*/
Spooter
16
Years of Service
User Offline
Joined: 27th May 2008
Location:
Posted: 4th Jun 2008 20:46
Rotation Question:

How do I make it so that it rotates it 10 degrees, it seems like its setting the rotation to 10 degrees. Is their a way to make it so that when I press the Left Arrow it rotates 10 more degrees to the left. This is the code I'm Using:


/*================================================*\
| Lead Programmer/Owner===============Anti-Triangle Cult=====|
\*================================================*/
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 4th Jun 2008 20:50 Edited at: 4th Jun 2008 20:51
Umm...

dir = 1; //turn right
dir = -1; // turn left

dbSetSpriteAngle(Ship, dbSpriteAngle(Ship) + (10 * dir));

I think that's it. That's how I'd do it, anyway.

If you can do any models for FW, reply to the FleetWars thread.

Click here!
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 4th Jun 2008 20:52
For the projectile, you should position the projectile sprite at the ship's position, then

dbSetSpriteAngle(projectile, dbSpriteAngle(Ship));
dbMoveSprite(projectile, offset);
// then you can start moving it in its own direction, using dbMoveSprite();

If you can do any models for FW, reply to the FleetWars thread.

Click here!
Spooter
16
Years of Service
User Offline
Joined: 27th May 2008
Location:
Posted: 4th Jun 2008 20:54 Edited at: 6th Jun 2008 00:41
dbSetSpriteAngle is not a function.

This looks like the only thing that can be used to rotate.


/*================================================*\
| Lead Programmer/Owner===============Anti-Triangle Cult=====|
\*================================================*/
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 4th Jun 2008 20:56
If you'd like it to follow the mouse, I think you should use this:



I'm really not too sure about how to use tangents, so please, tell me if that works.

If you can do any models for FW, reply to the FleetWars thread.

Click here!
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 4th Jun 2008 20:57
Oh, okay, just replace everywhere I said dbSetSpriteAngle with dbRotateSprite. They do the same thing... or would, if the first existed.

If you can do any models for FW, reply to the FleetWars thread.

Click here!
Spooter
16
Years of Service
User Offline
Joined: 27th May 2008
Location:
Posted: 4th Jun 2008 20:58
I got it with this code:



My variable is this:


/*================================================*\
| Lead Programmer/Owner===============Anti-Triangle Cult=====|
\*================================================*/
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 4th Jun 2008 21:01
Why not shorten it with

ShipRotation+=10;

?

If you can do any models for FW, reply to the FleetWars thread.

Click here!
Spooter
16
Years of Service
User Offline
Joined: 27th May 2008
Location:
Posted: 4th Jun 2008 21:05
Quote: "
Why not shorten it with

ShipRotation+=10;
"


Personal Preference

/*================================================*\
| Lead Programmer/Owner===============Anti-Triangle Cult=====|
\*================================================*/
Spooter
16
Years of Service
User Offline
Joined: 27th May 2008
Location:
Posted: 4th Jun 2008 21:06
Now I need the ship to move in the direction that it is facing? Got any suggestions?

/*================================================*\
| Lead Programmer/Owner===============Anti-Triangle Cult=====|
\*================================================*/
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 4th Jun 2008 21:07 Edited at: 4th Jun 2008 21:07
dbMoveSprite(Ship, speed);

Not smart for inertia based space games, but I guess its okay for this?

If you can do any models for FW, reply to the FleetWars thread.

Click here!
Spooter
16
Years of Service
User Offline
Joined: 27th May 2008
Location:
Posted: 4th Jun 2008 21:09
This is weird. It moves towards the right direction but instead of adding distance. It just moves the ship forward until i hit the speed, then it jumps back to original location.

/*================================================*\
| Lead Programmer/Owner===============Anti-Triangle Cult=====|
\*================================================*/
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 4th Jun 2008 21:17 Edited at: 4th Jun 2008 21:19
That is weird...

Here's some thing I was playing around with a week or two ago:



Please ignore my newbiness. It was my first project with DarkGDK.

If you can do any models for FW, reply to the FleetWars thread.

Click here!
Spooter
16
Years of Service
User Offline
Joined: 27th May 2008
Location:
Posted: 4th Jun 2008 22:05
Ok, I am going to lan party with my friends tonight so I won't have any updates posted after this. Although I love your code for the rotation and I think I can make it work with my project in like 20 minutes when I get time.

Also one thing.

I know the dbMoveSprite Says that the second int is Velocity(speed), but i think that they actually coded it so that that was the max distance it can move. Whatever I change the number to, that is how many pixels I can move.

/*================================================*\
| Lead Programmer/Owner===============Anti-Triangle Cult=====|
\*================================================*/
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 4th Jun 2008 22:38
Working as designed, I think. Does it move each time dbSync is called?

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Spooter
16
Years of Service
User Offline
Joined: 27th May 2008
Location:
Posted: 5th Jun 2008 19:53 Edited at: 5th Jun 2008 20:12
Quote: "Does it move each time dbSync is called?"




I actually don't know. I'm not using dbSync(); with it anymore. I took it out of this particular code, because I tried it and it makes the screen flicker. Here is the code. I don't know how to explain it. It takes the ship, and moves it up. BUT! It will only move it as far as the int velocity is. Then it just stops and stays in the new position.

Code:


/*================================================*\
| Lead Programmer/Owner===============Anti-Triangle Cult=====|
\*================================================*/
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 5th Jun 2008 21:54
I really don't know. I can remember playing with the code I gave you, it worked great.

If you can do any models for FW, reply to the FleetWars thread.

Click here!
Spooter
16
Years of Service
User Offline
Joined: 27th May 2008
Location:
Posted: 6th Jun 2008 20:11 Edited at: 6th Jun 2008 20:38
(FIXED: dbMoveSprite problem)

I figured out the problem. My if statement was greater than instead of less than.

(FIXED: Rotation Problem)

Quote: "OK now the rotation is messed up. Instead of rotating the sprite on its own separate axis. It rotates it around the whole screens axis. If anyone has any information please post."


I made it so each time it rotates or moves, it updates the SHIPLOCATION variables to what the new position is.



(New Problem)

Now the ship will only move when it is facing either up or left(I'm assuming this has to do with coordinates 0). otherwise it will just stop.

/*================================================*\
| Lead Programmer/Owner===============Anti-Triangle Cult=====|
\*================================================*/
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 6th Jun 2008 22:35
That's odd... I never had problems like that. Maybe its starting with your coding style?

If you can do any models for FW, reply to the FleetWars thread.

Click here!

Login to post a reply

Server time is: 2024-11-17 17:35:53
Your offset time is: 2024-11-17 17:35:53