checking by a pixel??? or something.....

Non-platform specific questions.

checking by a pixel??? or something.....

Postby amanuob » Sat Oct 23, 2010 7:57 am

Ummm can anybody help me XD...
I would like to know if there is a way to find out if a certain place/pixel in the screen is available or passable for a pixel character to go to.???

░░░░░░░ like this=> checks if place or directory is clear then
■░░░░░█
░░███████
██████████

░░░░░░░moves
░░░░░■ █ ___and the character only moves in his own parameter like
░░███████
██████████

▓▓▓▓▓▓▓___I was planning to make my own way of moving into rough terrain with minimum or no use of physical response.
▓▒▒▒▒▒▓
▓▒░░░▒▓
▓▒░ ■░▒▓
▓▒░░░▒▓
▓▒▒▒▒▒▓
▓▓▓▓▓▓▓

I tried to make multiple pixel Actors but it turned out to be a bit laggy, and imagine using this method with mutiple characters its a nightmare... XD

so do you think its posible????
Thanx in adavnce XD...
Questions are necessary for the development of our own knowing, without questions How would we know??? and lesser would be my posts or none...therefore I know little or none.
User avatar
amanuob
 
Posts: 33
Joined: Sat Aug 29, 2009 11:47 am
Location: In Earth
Score: 1 Give a positive score

Re: checking by a pixel??? or something.....

Postby DarkParadox » Sat Oct 23, 2010 12:04 pm

You can use collisionfree() for this exact purpose.
Here is its definition from the script reference.:
CollisionFree: Check if position (x, y) is collision free for ActorName. Return 1 if not collide, 0 otherwise.

Code: Select all
int CollisionFree(char *actorName, int x, int y)


Actor name:
  • "Event Actor": Actor that is receiving the current event.
  • "Parent Actor": Event Actor's parent, if exists.
  • "Creator Actor": Event Actor's creator, if Event Actor has been created in some "Create Actor" action.
  • "Collide Actor": Actor that collided with the event Actor.
  • Any Actor in game.


Script Editor Syntax:
Code: Select all
if (CollisionFree("Event Actor", x, y+5)) y=y+5; //On KeyDown Event script for KEY_DOWN, check if there is no collision before moving an actor down by 5 pixels.
User avatar
DarkParadox
 
Posts: 457
Joined: Mon Jan 08, 2007 11:32 pm
Location: USA, Florida.
Score: 84 Give a positive score

Re: checking by a pixel??? or something.....

Postby poopbrigade » Sat Oct 23, 2010 1:43 pm

Ahh!! XD was wondering what was that command for (סּ,סּ).....

so when I set actor name to ground?
and ground is no where to be found
my actor will move down???

..is this found in the GE tutorial??? (>,<)...

Thanx by the way XD...
PLUS++++ XD really saved my time with this code
When life gives you oranges, make orange juice. When life gives you poop, make fertilizer not poop juice.

Image
Current project __ CorPsEdEaRtH
Estimated work done __ 12%
User avatar
poopbrigade
 
Posts: 129
Joined: Thu Aug 27, 2009 12:17 pm
Location: In Earth. Being Burried XD
Score: 46 Give a positive score

Re: checking by a pixel??? or something.....

Postby DarkParadox » Sat Oct 23, 2010 2:55 pm

You set the actor name to the actor going to be colliding.
e.g. checking if the player is going to collide, actor name would be player.
User avatar
DarkParadox
 
Posts: 457
Joined: Mon Jan 08, 2007 11:32 pm
Location: USA, Florida.
Score: 84 Give a positive score

Re: checking by a pixel??? or something.....

Postby amanuob » Sun Oct 24, 2010 12:08 am

Yeah! XD thanx alotTT!!
+++ point...
Thanks by a million folds XD....
Questions are necessary for the development of our own knowing, without questions How would we know??? and lesser would be my posts or none...therefore I know little or none.
User avatar
amanuob
 
Posts: 33
Joined: Sat Aug 29, 2009 11:47 am
Location: In Earth
Score: 1 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron