ArianeSoft Forums

ArianeSoft Forums (http://forums.arianesoft.ca//index.php)
-   Support (http://forums.arianesoft.ca//forumdisplay.php?f=19)
-   -   Going APE? (http://forums.arianesoft.ca//showthread.php?t=1865)

Mike Halliday 10-15-2009 04:18 PM

Going APE?
 
I am playing with the APE functionality for one of my games but have hit a snag.

Loading in the APEDemo.PPL this works fine, so I have tried to duplicate the code in my game as best I can but for some reasone I cant get the sprites to stop when they hit the border of the screen

I do all the APE init stuff;

/* Uses the APE functions library for gravity, inertia and speed */
ape_init(1 / 4);
// massless force applied to Y access only
ape_addmasslessforce(0, 0.3);
cg$ = group_new(true);
ape_addgroup(cg$);
ape_borders(cg$, 0.5, 5);

ax$ = Random(8) * 52 ; // Random position across the screen
ay$ = 150;

I load my sprite and set the APE particle;

a$ = loadsprite(AppPath$ + "a.bmp", -1, 1, 0, NULL);

// Create new particle for the APE Engine
sp$ = spriteparticle_new(a$, ax$, ay$, 52, 52, 0, false, 0.01, 0, 0);
group_addparticle(cg$, sp$);
particle_addmasslessforce(SpriteParticle(a$), 0, 3.5)

Have set ape_paint; after render sprites;

Have set ape_step; in WM_TIMER;

When run, my sprite starts at 150 pixels down, then moves on its own down the screen; however, it does not stop when it reaches the screen edges.

I have lines (A box) drawn around the screen, but even removing these from the code still does not stop the sprite when it reaches the bottom of the screen.

The code is almost exactly like the APEDEMO file, except my sprite is not mouse controlled!

What am I doing wrong? :mad:

Mike.

kornalius 10-15-2009 05:25 PM

ape_borders() creates 4 rectangle particles at each screen edge. Could it be that your device is VGA? It uses the width and height specified in gapi_init. I don't know what could cause this.

Mike Halliday 10-15-2009 06:10 PM

Quote:

Originally Posted by kornalius (Post 12079)
ape_borders() creates 4 rectangle particles at each screen edge. Could it be that your device is VGA? It uses the width and height specified in gapi_init. I don't know what could cause this.

Thanks for the quick reply Alain.

Alas, I am running it on the PC at the moment, no device present yet. It's in 480x640 portrait mode and as far as I can see should work. The APEDemo.ppl file has been changed to run in 480x640 yet this still works fine. (Balls bounce off the walls and floor as before)

I am possibly missing something simple in my code (Either its in the wrong place or missing completely) - I will have another look and let you know if I fix it.

Mike.

kornalius 10-15-2009 06:43 PM

Post it here if it's not too big, I will have a look at it.

Mike Halliday 10-16-2009 07:49 AM

Going APE? - not any more
 
Quote:

Originally Posted by kornalius (Post 12084)
Post it here if it's not too big, I will have a look at it.

Alain,

I did send you the code last night, but there is no point in you looking at it. I have solved the problem myself.

Like a complete novice, I had the Ape initialisation code before the GAPI initialisation. rofl.

Once I realised what I had done and moved it to after the GAPI init, it works as it should.

A new day brought new brain functions - hee hee

Mike.:D

kornalius 10-16-2009 01:37 PM

:) Good one. I would never do something like that! ;) Yeah right!


All times are GMT. The time now is 09:31 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) ArianeSoft Inc.