• Welcome to Dark Bit Factory & Gravity.
 

Blitz2D, first program HELP!

Started by billy bob, July 04, 2009

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

billy bob

Sorry I can't put this code with the other code, its been a while since I last did this but I did try lots (also sorry for posting two times in a row).

Jim

If you can post up your latest attempt we can definitely help you fix it up :)
Jim
Challenge Trophies Won:

billy bob

I would like to upload my attempts but I deleted them in November.

I would give you the recentest version, but when I try it gives me an error.

Would it be OK if I uploaded it in an attachment?

Jim

Sure, you can attach a zip file to your post.  If you hit Additional Options under the post window there's an option to attach files.
Jim
Challenge Trophies Won:

billy bob

OK it is in the attachment below.

Also in the previous version there was a glitch: If you collected two or more bombs at the same time then you would get an amount of lives that were below 0. That glitch no longer occurs in the new version.

Jim

OK, I've joined up what clyde did with your stuff.  I've commented by 2 bits with ;JIM

Jim
Challenge Trophies Won:

billy bob


billy bob

I've been trying to put an image collision with the "power" image and the "smile" image, but haven't succeeded. My guess is it is something like this (but of course it isn't ???):


If ImagesCollide (img_bullet,power\x,power\y,0,img_smile,x,y,0)
mode=1
score + 50
EndIf


Help please? :)

Clyde

Can you attach your images and sound files ( any media used ) please, and if your source ( don't know what changes have been made, etc )

Tiz been a long time since doing anything with blitz; I'll see if I can assist.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.


Challenge Trophies Won:

billy bob

The attachment is above.

Clyde

All i can see are txt documents. do you have a zip or rar file with the lastest bits and pieces.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.


Challenge Trophies Won:

billy bob

All the things are in the attachment below.

Jim

Challenge Trophies Won:

Clyde

From what I've seen is that the collision is working but not as intended. I had to swerve to get it to do its thang.

ps, could an admin move this. it's quite hard to rememeber where this blitz post is. cheers
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.


Challenge Trophies Won:

billy bob

When I try it says "variable must be a type". Unless I have put it in the wrong place. ;)

But if you have got it working, could you help me please? :kewl:

Clyde

I copy and pasted the .txt doc of you source ( you know you can include .bb in zips ) and into Blitz3D. I dont know where my copy of blitz basic is at the moment ) and ran it, and it worked.

What are you using to compile with? Blitz Basic, Blitz3D, Blitz Plus?

I think you've got some local and global variable issues dude. And maybe have player as a type.

Global means that you can use the variable anywhere within your code, and the data it stored won't be lost on exitting a function. Locals are generally used in functions and will lose any values once the function has finished.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.


Challenge Trophies Won:

billy bob

#56
Quote from: Clyde on October 20, 2010What are you using to compile with? Blitz Basic, Blitz3D, Blitz Plus?
At this moment I'm using Blitz Basic (it (sort of) says in the title).

billy bob

(Sorry for posting two times in a row but I realized if I edited my last then not many people would read it until the next post comes.)
Quote from: Clyde on October 20, 2010
I copy and pasted the .txt doc of you source ( you know you can include .bb in zips ) and into Blitz3D. I don't know where my copy of blitz basic is at the moment ) and ran it, and it worked.
I misunderstood this.  ;) If you download it, it does work. But the thing is is that I want it so there is an image collision between Smile and Power. :kewl: Look at my previous post:
Quote from: billy bob on October 15, 2010
I've been trying to put an image collision with the "power" image and the "smile" image, but haven't succeeded. My guess is it is something like this (but of course it isn't ???):


If ImagesCollide (img_bullet,power\x,power\y,0,img_smile,x,y,0)
mode=1
score + 50
EndIf


Help please? :)

Rbz

Hi, if I'd understand it correctly, this is what you are looking for (attached).
Challenge Trophies Won:

billy bob

Quote from: rbz on October 21, 2010
Hi, if I'd understand it correctly, this is what you are looking for (attached).
Thanks a lot of lots! :D

I also had to alter it slightly. I changed it into

    If ImagesCollide (img_smile,x,y,0,img_power,image_x,image_y,0) Then
      image_x=Rand(0,843-ImageWidth (img_power))
      image_y=Rand(0,585-ImageHeight(img_power))
      mode=1
      score = score + 50
   End If

End If

;)