A visual feature I'm trying to implement into a game I'm building involves and object flying up to a position in the view and disappearing. To kind of simulate the 1up action that happens on the old snes game Donkey Kong Country. Well I have it coded to move the object towards the point when the player collides with it but I ran into a snag... move_towards_point will not work in a room that uses physics. I've tried using step towards point, it works perfectly but if there are too many solid objects in the way it stops... the step towards avoid event prevents that problem but then I would have a weird 1up flying around the room trying to find a way around objects blocking its path.
In short here is what is going on in simple terms, not to confuse people:
Room Physics is ON.
Player touches 1up.
1up is programmed to fly up toward view_xview[0]+32; view_yview[0]+32 using the move_towards_point action.
nothing happens to 1up when I test.
If I substitute step towards point for move towards point it works until there is solid row of blocks in the room blocking the target location.
If I substitute step towards point avoid for step towards point it works but it looks odd since it has to move around any and all solid blocks.
I want the 1up to move to the point I specify regardless if there is anything in the way. (meaning right on through all objects in the way!)
So how can I achieve what I'm wanting?
- Game Maker Community
- → Viewing Profile: Topics: Parnell_Games
Parnell_Games
Member Since 10 Feb 2009Offline Last Active May 14 2013 04:06 AM
Community Stats
- Group GMC Member
- Active Posts 67
- Profile Views 2070
- Member Title GMC Member
- Age 26 years old
- Birthday February 17, 1987
-
Gender
Male
-
Location
None of your business.
-
Version
GM:Studio
1
none
Latest Visitors
Topics I've Started
move_towards_point dilema
28 September 2012 - 02:39 AM
Game Maker Physics.
13 September 2012 - 11:08 PM
I've got my player object to "fall" using the physics base settings with the room and object properties.
I can detect a collision with another block.
I can't figure out, however, how to get the player object to hit the block and stop moving using the physics system.
To be through here is the starting stats:
Player Object: Physics Checked Collision Group set to 0 (Not changing so don't bother telling me to as I've read it makes things bad) Collision Type: Box Edited to surround sprite Density set to 1 Restitution set to 1 Linear Damping set to 0.3 Angular Damping set to 1 Sensor On (In Creation Code: friction set to 0.5) "another block" aka object1 Physics Checked Collision Group set to 0 (Not changing so don't bother telling me to as I've read it makes things bad) Collision Type: Box Edited to surround sprite Density set to 0 Restitution set to 0 Linear Damping set to 1 Angular Damping set to 1 Sensor On Room Values: Physics World On xGravity set to 0 yGravity set to 10 Pixel to Meter Ratio 1:32 (1 div 32)
Step Event for Player Object:
if(physics_test_overlap(phy_position_x,phy_position_y,phy_angular_velocity,object1)) //This does detect a collision when the two objects meet.
{
//don't know what to put here to make the player object stop falling!
}Note: Yes I've tried changing the damping value but it does nothing to help.
Edit I'm turning this into a help topic not a rant topic... as I experiment with the physics system and try to get it to make a simple platormer I'll update my findings in this thread, of course I'll post the actual project info in the appropriate forum for wip when I get things figured out how to properly use this system. The Struckout words can be ignored.
Need help Getting the direction of a joystick...
19 June 2012 - 03:40 AM
Ok before anyone gets confused I'm trying to use the C button Axis on the GameCube Controller I have plugged in via adapter to control objects directional movement based on the joystick_zpos value.
Through testing I can confirm that the Angle of the C button Axis is the joystick_zpos value.
Getting the appropriate data is the problem. The resting state, when I'm not touching it, bounces between 0 and 0.06 not on its own but after each release.
And the the values for when I press up, down, left, or right are not consistent either.
Example scenario:
Load Test game...
Test game shows value of joystick_zpos via object0's draw event... I have not touched the C button Axis.
zpos vaue = 0.05 (sometimes 0.04, 0.05, or 0.06)
I moved C button Axis into up position.
zpos value = 0.16 (sometimes 0.10 or 0.12)
I release the Axis...
zpos value = (a value between 0.04 and 0.06)
How can I use the joystick_zpos function correctly if the values are not consistent?
Before anyone asks, the GameCube controller is functioning correctly and has been calibrated in Windows, the z position value is consistent there.
Update: Resolved! But I'm still having difficulties, see next post!
Through testing I can confirm that the Angle of the C button Axis is the joystick_zpos value.
Getting the appropriate data is the problem. The resting state, when I'm not touching it, bounces between 0 and 0.06 not on its own but after each release.
And the the values for when I press up, down, left, or right are not consistent either.
Example scenario:
Load Test game...
Test game shows value of joystick_zpos via object0's draw event... I have not touched the C button Axis.
zpos vaue = 0.05 (sometimes 0.04, 0.05, or 0.06)
I moved C button Axis into up position.
zpos value = 0.16 (sometimes 0.10 or 0.12)
I release the Axis...
zpos value = (a value between 0.04 and 0.06)
How can I use the joystick_zpos function correctly if the values are not consistent?
Before anyone asks, the GameCube controller is functioning correctly and has been calibrated in Windows, the z position value is consistent there.
Update: Resolved! But I'm still having difficulties, see next post!
Some Dialog boxes not openning at all.
24 February 2012 - 01:57 AM
Ok I recently updated to 8.1.141 via the auto updates.
Now I can't save sprites to a file via the Save Sprite button or the file menu in the sprite editor.
And I File > Save As does nothing from the main program window!
My "relevant" Specs:
Windows 7 Pro 64 bit
6 GB Ram
1 GB Video Memory
What I've tried to fix this (and failed):
Reboot System.
Restarted Game Maker.
Tried using the functions mentioned on a new unsaved file.
Anyone else having this issue? Did anyone get this fixed?
Now I can't save sprites to a file via the Save Sprite button or the file menu in the sprite editor.
And I File > Save As does nothing from the main program window!
My "relevant" Specs:
Windows 7 Pro 64 bit
6 GB Ram
1 GB Video Memory
What I've tried to fix this (and failed):
Reboot System.
Restarted Game Maker.
Tried using the functions mentioned on a new unsaved file.
Anyone else having this issue? Did anyone get this fixed?
Proposed Idea: Double Clicking a script
19 November 2011 - 04:57 AM
Ok the idea came to me while working on a project.
In the project I have over 10 scripts each are called in objects using plain text code not drag and drop, well the execute code is drag and drop but that is not important.
I'm constantly finding times where I need to go from my execute code window to the script but in order to do that I have to:
Save my code by clicking the check mark.
Go locate the script I want to look at.
Double click to open.
Do or look at what I need to do or look at.
Close it.
Re-open the execute code window.
My idea is:
Code the execute code window to allow a user to double click on the script.
Doing so will pop open the script and allow you to look at or edit it.
Lock the script window like execute code window does so nothing: objects, other, scripts, etc. can't be accessed to save memory, and return the user to the previous execute code window when closing and or saying changes to the script.
Feel free to add any other ideas, questions or comment concerning this subject as this is just a rough idea.
In the project I have over 10 scripts each are called in objects using plain text code not drag and drop, well the execute code is drag and drop but that is not important.
I'm constantly finding times where I need to go from my execute code window to the script but in order to do that I have to:
Save my code by clicking the check mark.
Go locate the script I want to look at.
Double click to open.
Do or look at what I need to do or look at.
Close it.
Re-open the execute code window.
My idea is:
Code the execute code window to allow a user to double click on the script.
Doing so will pop open the script and allow you to look at or edit it.
Lock the script window like execute code window does so nothing: objects, other, scripts, etc. can't be accessed to save memory, and return the user to the previous execute code window when closing and or saying changes to the script.
Feel free to add any other ideas, questions or comment concerning this subject as this is just a rough idea.
- Game Maker Community
- → Viewing Profile: Topics: Parnell_Games
- Privacy Policy
- GMC Rules and Forum Rules ·



Find content