Jump to content


Data-Fi

Member Since 31 Jul 2010
Offline Last Active Today, 05:58 AM

Topics I've Started

Object Magically Changes Coordinates

03 April 2013 - 05:00 AM

I have an object "test" that SHOULD never change it's position, but looking at it in the debuger the position changes as the player moves around. The player never references this "test" object. "test" has this code inside of it:
 

Step:

dist = point_distance(player.x, player.y, x, y)
ang = abs(((((player.direction - point_direction(player.x, player.y, x, y)) mod 360) + 540) mod 360) - 180)
xdraw = sin(ang)*dist
ydraw = cos(ang)*dist      <-----removing fixes problem
image_xscale = 1/(1 + ydraw/100)
image_yscale = image_xscale
depth = ydraw

I tried replacing the mod code I'd never used before, but no luck :(

If I remove the cos() line it stops the problem. I also noticed that if i don't initialize the ydraw/xdraw variables in the create the step event will not initialize them. 
(also i changed ang to radians since this version because: cos(x) Returns the cosine of x (x in radians). and still nothing)  

heres a GMK (used in gm8)

https://www.dropbox....atesproblem.gmk

I have a feeling it's just one of those syntax things, but i thought I've never run into anything like this before so I put it in advanced gml.

Thanks in advanced GMC!


Plexus

14 March 2013 - 03:08 AM

I completed work on a short two week expirmental project for a game competition at Gamejolt called Plexus.
The competition's theme was "Chaos". Plexus is a top-down bullet-hell with data-moshing-esque graphics.
The enemies come in randomized waves. The soundtrack consists of 13 loops that switch randomly with the enemy-waves.
Play it here:
http://gamejolt.com/...e/plexus/12873/



Have Fun!

Binary Boy: an orientation flipping platformer

14 February 2013 - 05:59 PM

Binary Boy a short game that consists of five distinct colorful levels with original graphics, music, and sound.The mechanics are very simple and literally straightforward. Binary Boy walks on a line, and must pass hordes of enemies as well as boss battles by flipping up and down. The game is short and can be played in one sitting, my highscore is around six and a half minutes.
Give it a try, it's really fun I promise!
sincerely
Jared aka data-fidelity

Thanks GMC!


Play Online:

Download for Windows (fullscreen, highscores, full sounds):

Do you want to host this game on your site? Just PM me because I think that's great!

Reviews of Binary Boy:
i-luv-games
erraticgamer
rawketlawncher

Checking nearest left and right of same object

29 August 2011 - 11:38 PM

hello,
I'm trying to create a view system using markers in my game, in this example there are horizontal view markers(horviewmark)
which should make the view fallow the character's x coordinates and snap the view to a line between the markers. My real problem
lies in trying to return the id's of the nearest marker to the left and right. If I were to use the two nearest objects using instance_nth_nearest()
it would sometimes refer to two markers to one side, if the markers aren't perfectly placed. I am new to the 'do' statement, and all my efforts
in writing script have lead to glitches and crashes. My most recent attempt, much simpler than older ones, looks like this:
do
{if instance_nearest(pixeler.x, pixeler.y, horviewmark).x > pixeler.x && instance_nearest(pixeler.x, pixeler.y, horviewmark).x > instance_nth_nearest(pixeler.x, pixeler.y, horviewmark, viewskip).x or instance_nearest(pixeler.x, pixeler.y, horviewmark).x < pixeler.x && instance_nearest(pixeler.x, pixeler.y, horviewmark).x < instance_nth_nearest(pixeler.x, pixeler.y, horviewmark, viewskip).x
{view_yview = instance_nearest(pixeler.x, pixeler.y, horviewmark).y - (instance_nearest(pixeler.x, pixeler.y, horviewmark).y - instance_nth_nearest(pixeler.x, pixeler.y, horviewmark, viewskip).y)*(point_distance(pixeler.x, 0, instance_nearest(pixeler.x, pixeler.y, horviewmark).x, 0)/point_distance(pixeler.x, 0, instance_nth_nearest(pixeler.x, pixeler.y, horviewmark, viewskip).x, 0)/2) - view_hview/2}
else
{viewskip = viewskip + 1}}
until instance_nearest(pixeler.x, pixeler.y, horviewmark).x > pixeler.x && instance_nearest(pixeler.x, pixeler.y, horviewmark).x > instance_nth_nearest(pixeler.x, pixeler.y, horviewmark, viewskip).x or instance_nearest(pixeler.x, pixeler.y, horviewmark).x < pixeler.x && instance_nearest(pixeler.x, pixeler.y, horviewmark).x < instance_nth_nearest(pixeler.x, pixeler.y, horviewmark, viewskip).x
view_xview = pixeler.x - view_wview/2

pixeler is the name of the player
I know these are loooong lines it basically uses the variable viewskip to keep testing the next nearest viewmarker's x until it is greater or lesser than the nearest viewmarker depending on if pixeler(player)'s x is greater or lesser than the nearest. this crashes on me apparently
when the nearest marker shifts to another. I just scratched my other script today and wrote this one, so I assume the glitch in this code is pretty easy to see, but I think I have the wrong idea entirely of how to check the nearest left and right object.

thanks for the help in advance!

execute_file()

27 July 2011 - 03:09 AM

So I am making a level editor, and whenever you create an instance in the editor it writes the code to create it at that point in a .gml file, i've tried .txt files too. So that works just fine, so the file looks like, instance_create(119, 339, 13);instance_create(134,132,13) and so forth all on one line. I am trying to use execute_file() in the creation event for the object that controls the creation and writes the file. I think my problem is about the arguments. I just want to execute the entire file. I don't think I understand how to use arguments to make it create these objects.

help please!

I live in the woods right now and only have internet at my friends house, so if I don't get a reply in a half hour I'll be back online sometime tomorrow.

thanks