Ariane Soft PPL2 Pocket Programming DataMite
  #1  
Old 10-15-2009, 04:18 PM
Mike Halliday's Avatar
Mike Halliday Mike Halliday is offline
Senior Member
 
Join Date: Sep 2007
Location: Warrington, United Kingdom
Posts: 821
Send a message via Skype™ to Mike Halliday
Angry 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?

Mike.
__________________
Past editor of 'Voice of the PPL' the BI-Monthly Disk Magazine for the PPL by the PeoPLe!

Still developing products using PPL! - Although not as many as I used to!


If you enjoy my PPL applications and want to see many more, or I have helped you in any way; click here to buy me a beer;
Reply With Quote
  #2  
Old 10-15-2009, 05:25 PM
kornalius kornalius is offline
Administrator
 
Join Date: Apr 2006
Posts: 551
Default

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.
__________________
Regards,
Alain Deschenes
ArianeSoft Inc.
http://www.arianesoft.ca
Reply With Quote
  #3  
Old 10-15-2009, 06:10 PM
Mike Halliday's Avatar
Mike Halliday Mike Halliday is offline
Senior Member
 
Join Date: Sep 2007
Location: Warrington, United Kingdom
Posts: 821
Send a message via Skype™ to Mike Halliday
Default

Quote:
Originally Posted by kornalius View Post
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.
__________________
Past editor of 'Voice of the PPL' the BI-Monthly Disk Magazine for the PPL by the PeoPLe!

Still developing products using PPL! - Although not as many as I used to!


If you enjoy my PPL applications and want to see many more, or I have helped you in any way; click here to buy me a beer;
Reply With Quote
  #4  
Old 10-15-2009, 06:43 PM
kornalius kornalius is offline
Administrator
 
Join Date: Apr 2006
Posts: 551
Default

Post it here if it's not too big, I will have a look at it.
__________________
Regards,
Alain Deschenes
ArianeSoft Inc.
http://www.arianesoft.ca
Reply With Quote
  #5  
Old 10-16-2009, 07:49 AM
Mike Halliday's Avatar
Mike Halliday Mike Halliday is offline
Senior Member
 
Join Date: Sep 2007
Location: Warrington, United Kingdom
Posts: 821
Send a message via Skype™ to Mike Halliday
Talking Going APE? - not any more

Quote:
Originally Posted by kornalius View Post
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.
__________________
Past editor of 'Voice of the PPL' the BI-Monthly Disk Magazine for the PPL by the PeoPLe!

Still developing products using PPL! - Although not as many as I used to!


If you enjoy my PPL applications and want to see many more, or I have helped you in any way; click here to buy me a beer;
Reply With Quote
  #6  
Old 10-16-2009, 01:37 PM
kornalius kornalius is offline
Administrator
 
Join Date: Apr 2006
Posts: 551
Default

Good one. I would never do something like that! Yeah right!
__________________
Regards,
Alain Deschenes
ArianeSoft Inc.
http://www.arianesoft.ca
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:10 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright (c) ArianeSoft Inc.
Copyright © 2009 www.ppl-lang.com - All rights reserved
Web Design by BR Web Consulting Ltd