Newbie in Realbasic 4 needs help 
Author Message
 Newbie in Realbasic 4 needs help

Hello everybody,
I'm actually supposed to end my maturity work (maturity : swiss diploma), in
fact, I'm in  a big hurry.

I've got to debug some parts of my code and to write entirely a large part
of it. So I'm going to try
asking you several questions, maybe show you some part of my code, if it's
really needed.



Mon, 04 Apr 2005 06:23:20 GMT  
 Newbie in Realbasic 4 needs help



Quote:
> Hello everybody,
> I'm actually supposed to end my maturity work (maturity : swiss diploma),
in
> fact, I'm in  a big hurry.

> I've got to debug some parts of my code and to write entirely a large part
> of it. So I'm going to try
> asking you several questions, maybe show you some part of my code, if it's
> really needed.

I already thank you for your precious help.

Little description of my project :
 It will be, if one day everything works, a little 2d games, which one could
be compared ( if you use your imagination) with ping-pong.
 It is made of a main window that contains a spritesurface, that contains
himself some sprite (ball, players.....).
 Players are supposed to be controlled with the keyboard.

The questions ;-)

   --When we use a spritesurface, are the x and y properties of the sprite
relative to the spritesurface or the parent-window?
   --Is it possible to assign a double variable in a integer one ( I as
integer, D as double, D=4.5; I=D)?
   --In the collision event handler of a spritesurface, how could I know
which sprites will be called s1 and which one s2 ?



Mon, 04 Apr 2005 06:44:42 GMT  
 Newbie in Realbasic 4 needs help


Quote:
>    --When we use a spritesurface, are the x and y properties of the sprite
> relative to the spritesurface or the parent-window?

The SpriteSurface.  Of course you can change the origin by using the
Scroll method (or assigning to ScrollX and ScrollY, IIRC).

Quote:
>    --Is it possible to assign a double variable in a integer one ( I as
> integer, D as double, D=4.5; I=D)?

Certainly.  The decimal part is truncated.

Quote:
>    --In the collision event handler of a spritesurface, how could I know
> which sprites will be called s1 and which one s2 ?

You can't; it's entirely arbitrary.  What is it *really* that you need
to know?  If, for example, you have properties "paddle1 as Sprite" and
"ball as Sprite" then you can just do:

  if s1 = ball then
     // OK, s1 is the ball...

You could also use Sprite subclasses and test with IsA, but since you're
a newbie this probably isn't what you're doing.

Cheers,
- Joe

,------------------------------------------------------------------.
|    Joseph J. Strout         Check out the Mac Web Directory:     |

`------------------------------------------------------------------'



Mon, 04 Apr 2005 05:56:32 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. RealBasic and FileMaker Pro Help Needed

2. Help! Utter newbie needs help with basic code

3. Help ! Newbie need help

4. <help> newbie need help

5. Newbie to REALbasic -- want to make nslookup program

6. newbie question - what is realbasic - from a windows programmer

7. REALBasic newbie question: structs and pointers?

8. Newbie RealBasic Questions

9. RealBasic Newbie Questions

10. newbie REALbasic question (random numbers)

11. Newbie Question: Realbasic Question

12. Newbie needs some basic starting help

 

 
Powered by phpBB® Forum Software