Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Basic4ppc Wishlist
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Basic4ppc Wishlist Missing any feature?

Sprite attributes (properties)

Reply
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 06-29-2009, 01:59 PM
enonod's Avatar
Basic4ppc Veteran
 
Join Date: Oct 2007
Location: U.K.
Posts: 324
Default

The first suspect should always be the author and I failed to keep suspicion on me. I don't think I really thought this would be different from Delphi.
So one must always have an interim (or effectively a temp) to overcome this.

I appreciate your help and thanks for the snippet.

[Edit]Interestingly the information on the two labels switches around for the second of the two interupts.
__________________
You never stop learning until you die.
Sometimes I think I am dead.
Sometimes others think I am dead!
Homesite: http://www.don-simmonds.co.uk for Libyan Mural

Device:Viewsonic VPad7, Android 2.2.2

Last edited by enonod : 06-29-2009 at 02:03 PM.
Reply With Quote
  #12 (permalink)  
Old 06-29-2009, 02:11 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by enonod View Post
So one must always have an interim (or effectively a temp) to overcome this.
Sort of! Because there is no typing in Basic4ppc everything internally is a string.

Basic4ppc can cope with assignments of types between library objects

Spr1.Value = gw.Sprite1 ' assign a Sprite reference type

but internally variables and values are untyped so you can't cascade properties and methods as internally there is no reconition of types.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #13 (permalink)  
Old 06-29-2009, 02:41 PM
enonod's Avatar
Basic4ppc Veteran
 
Join Date: Oct 2007
Location: U.K.
Posts: 324
Default

Thank you agraham, useful to know.
__________________
You never stop learning until you die.
Sometimes I think I am dead.
Sometimes others think I am dead!
Homesite: http://www.don-simmonds.co.uk for Libyan Mural

Device:Viewsonic VPad7, Android 2.2.2
Reply With Quote
  #14 (permalink)  
Old 06-29-2009, 03:43 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

This version 1.22 of the Sprite library has the additional changes listed below.

Each Sprite has a boolean IsCollider property that defaults to True which determines whether a Sprite can collide with another Sprite or not. All Sprites will always collide with the boundary, I'll probably put an option for this in the next release.

GameWindow now draws itself properly as a Windows Control in response to Paint events. Previously it didn't which could lead to flashing and even not appearing under certain circumstances.

Each collision now hopefully only raises the collision event once. This change also increases performance as previously each collision possibility was checked twice, once for each Sprite. As each possibility is now only checked once this approximately halves the time taken for the collision checking.

Various invisible bits of internal tidying up that should not be visible.
Attached Files
File Type: zip Sprite1.22.zip (7.2 KB, 11 views)
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #15 (permalink)  
Old 06-29-2009, 04:02 PM
Junior Member
 
Join Date: Jul 2007
Location: Oakville, Ontario, Canada
Posts: 45
Default

AGraham as you are updating the sprite library and putting in the option to turn off collisions another feature would be to add a z-order to sprites so smaller or higher priority ones could be positioned over less important or static sprites.
Reply With Quote
  #16 (permalink)  
Old 06-29-2009, 05:43 PM
enonod's Avatar
Basic4ppc Veteran
 
Join Date: Oct 2007
Location: U.K.
Posts: 324
Default

Thank you so much for your time and effort agraham, it is very much appreciated.
__________________
You never stop learning until you die.
Sometimes I think I am dead.
Sometimes others think I am dead!
Homesite: http://www.don-simmonds.co.uk for Libyan Mural

Device:Viewsonic VPad7, Android 2.2.2
Reply With Quote
  #17 (permalink)  
Old 06-30-2009, 09:55 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

This is probably the last iteration as I can't think of anything else to add - can you?

Version 1.23 has the following changes.

Each Sprite has an IsVisible property, default True. This is complementary to the IsActive property. An inactive Sprite is not drawn, does not move and does not take part in collisions. An active invisible Sprite acts normally except that it is not drawn.

Each Sprite has an IsContained property. If True the Sprite will collide with the game window boundary, if false it won't.

GameWindow now has SpriteOnScreen(index) and SpriteOnScreenID(id) methods that return True if the specified Sprite is positioned in the game window or False if it is not. This refers to the Sprites' position, not its' visibility.

GameWindow now has a SpriteReplace(Sprite, index) method.

More internal tidying up that should not be visible.

Quote:
Originally Posted by RichardW View Post
add a z-order to sprites
To efficiently provide an explicit z-order for individual sprites is difficult as the code needs to have high performance as it is run many times per second. However there is already an implicit z-order as sprites added later are always drawn after earlier sprites. To keep a Sprites' place in the drawing order you could use the new SpriteReplace method.
Attached Files
File Type: zip Sprite1.23.zip (7.4 KB, 14 views)
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.

Last edited by agraham : 06-30-2009 at 09:58 AM.
Reply With Quote
  #18 (permalink)  
Old 06-30-2009, 01:25 PM
enonod's Avatar
Basic4ppc Veteran
 
Join Date: Oct 2007
Location: U.K.
Posts: 324
Default

I think this is great, and I can't think of anything else that could enhance the use of sprites, (oh, except the obvious help update eventually).
Thank you again very much for making the system so much more useful.

The above statement is not binding for all time.
__________________
You never stop learning until you die.
Sometimes I think I am dead.
Sometimes others think I am dead!
Homesite: http://www.don-simmonds.co.uk for Libyan Mural

Device:Viewsonic VPad7, Android 2.2.2
Reply With Quote
  #19 (permalink)  
Old 06-30-2009, 07:39 PM
Junior Member
 
Join Date: Jul 2007
Location: Oakville, Ontario, Canada
Posts: 45
Default unhandled exception

I have uploaded a program which will trigger an exception when running the compiled (optimized) code. To cause the error simply mouse click on the egyptian delta province. This just cycles thru a series of coloured images but as compiled it will "Continue" only after displaying an annoying error message.

I have another interesting issue. I position a province sprite on the map and then drop on a city sprite on top of it. If I click the city I get 2 mouse collision events; first the underlying province and then for the city itself. This seems strange as I would expect the city first, then the province. I can get around this by using images but just curious over this behaviour.

The flashing is truly gone. I was going mad trying to figure what in my map scrolling was causing that. Thanks for fixing it.
Reply With Quote
  #20 (permalink)  
Old 06-30-2009, 08:20 PM
enonod's Avatar
Basic4ppc Veteran
 
Join Date: Oct 2007
Location: U.K.
Posts: 324
Default

There seems to be a download problem, the file has some ID on the front and registers as corrupt.
4171d1246351689-sprite-attributes-properties-sprite1.23.zip
__________________
You never stop learning until you die.
Sometimes I think I am dead.
Sometimes others think I am dead!
Homesite: http://www.don-simmonds.co.uk for Libyan Mural

Device:Viewsonic VPad7, Android 2.2.2
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Properties module - useful module for working with properties / ini files Erel Code Samples & Tips 2 10-13-2011 10:02 PM
Assembly properties Pachuquin Questions (Windows Mobile) 1 05-05-2009 06:42 PM
Compiled Properties Zenerdiode Basic4ppc Wishlist 2 03-06-2009 08:08 PM
Evaluate properties Offbeatmammal Basic4ppc Wishlist 0 06-02-2008 07:23 AM
More properties for panels RandomCoder Basic4ppc Wishlist 0 07-12-2007 09:48 PM


All times are GMT. The time now is 03:49 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0