Ariane Soft PPL2 Pocket Programming DataMite
Prev Previous Post   Next Post Next
  #1  
Old 10-15-2009, 04:18 PM
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.
Reply With Quote
 

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 08:29 AM.


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