Jump to content


xxlebox

Member Since 07 Feb 2007
Offline Last Active Mar 02 2008 09:50 PM

Posts I've Made

In Topic: Nos On A Spaceship.

29 February 2008 - 04:07 PM

I fixed it already. Thanks a lot again guys. Maybe you could test it when it's done! :(

In Topic: Nos On A Spaceship.

29 February 2008 - 01:23 PM

for the bullet i think this will work
creation event

motion_set(object0.gotodir,5)

<{POST_SNAPBACK}>


Hmm, I already got it like this:

image_index=object0.gotodir/5
image_speed=0

Note that the direction it was flying in was already working, only the image needed to turn. I though of using gotodir, but then noticed that you can't use a variable from one object in another. However, your object0.gotodir fixed that, so thanks!  :(

In Topic: Nos On A Spaceship.

29 February 2008 - 10:11 AM

By the way, here's the code on the ship:

Information about object: object0

Sprite: sprite1
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent: <no parent>
Mask: <same as sprite>

Create Event:
set variable gotodir to 0
execute code:

image_index=gotodir/5
image_speed=0
set variable maxspeed to 3
set variable canshoot to 1

Alarm Event for alarm 0:
set variable canshoot to 1

Step Event:
if speed is larger than maxspeed
      set variable speed to maxspeed

Keyboard Event for <Ctrl> Key:
if canshoot is equal to 1
      create instance of object object1 at position (object0.x,object0.y) with speed 6 in direction gotodir
      set variable canshoot to 0
      set Alarm 0 to 10

Keyboard Event for <Space> Key:
set variable maxspeed relative to 0.5

Keyboard Event for <Left> Key:
execute code:

gotodir+=5
image_index=gotodir/5

Keyboard Event for <Up> Key:
execute code:

motion_add(gotodir,0.05)

Keyboard Event for <Right> Key:
execute code:

gotodir-=5
image_index=gotodir/5

Keyboard Event for <Down> Key:
execute code:

motion_add(gotodir,-0.05)

Other Event: Outside Room:
wrap in both directions when an instance moves outside the room

Key Release Event for <Space> Key:
set variable maxspeed to 3

I thought of using the code:

image_index=gotodir
image_speed=0

On the bullet/lasers, but it says it doesn't know gotodir. Any way to fix that? Or wont this work in any case?  ::lmao::

In Topic: Nos On A Spaceship.

29 February 2008 - 10:00 AM

Thanks on the booster bit, only thing left to do now is to find out how I can make it de-accelerate when you release the key, instead of it going back to it's normal speed at once.

On the shooting bit: Yes, I've Unregistered 7.0. My ship can turn in 72 different directions, so it looks smooth. My bullets fly out in exactly the same direction as the direction my ship is pointing at. Thing is: The bullets stay horizontal like this: ---, AND they dont come out of the point of the ship, like this:

(Blue line is the bullet, yellow arrow is the direction it's flying in).

Posted Image

So, the problem is. In case I'm flying horizontal like the second image, the bullet comes out fine, and flies in the right direction, and is in the right direction.
But, in case I'm flying in any other direction, it does not seem to be coming out of the ship, and it looks horizontal (as in the picture), but it does fly in the right direction. What do I do about that?

Edit: Sorry for my crappy english, and therefore crappy explanation.  ::lmao::

In Topic: Asteroids Like Game.

26 February 2008 - 02:22 PM

No:

if speed­ ­> (your maximum speed)
set speed to (your maximum speed)

<{POST_SNAPBACK}>


Ohh, I didn't expect "speed" to work as a valid variable, so I was wondering on what I'd use for that then, but it turns out to work, thanks. :)