Jump to content


avidichard

Member Since 12 Jan 2004
Offline Last Active May 12 2013 05:34 PM

Topics I've Started

Tile Based Platform Engine

04 April 2013 - 11:27 PM

Editable version: GM 8.1 only

Included EXE for demonstration purposes.

 

Link (GM website): http://sandbox.yoyog...lateform-engine

 

This engine will show you how to create a platform game using tiles instead of objects.  You will also be able to control what can be seen and not easily as you can see in the images below.  This engine includes solid land, jump through land, death traps and decoration (foreground and background).  NOTE: Precise collision checking with tiles is not possible yet so certain land strips (like mushroom) borders will let Mario stand in mid air.  If you find a solution for that, do not hesitate to post it here or let me know.  Tiles are squares for now so, you need to live with that :).

 

Pros:

- You do not need to place invisible ground objects over tiles.  In other words, this engine cuts your work in half.

- No need for extra objects for markers or death traps, interact directly with tiles.

- I've seperated important actions in scripts for easier management and integration.

- Faster than collision checking with objects.

 

Cons:

- No precise collision checking.

 

1 - All tiles visible and 3 objects (Mario, Goomba and Mushroom)

2013-03-28_07_27_32-.png

 

2 - Solid land tiles have been hidden using only one line of code that is built-in the GML language.

2013-03-28_07_31_50-.png

 

3 - All tiles are hidden.  Al that is left are visible objects.

2013-03-28_07_32_13-.png

 


Tile Based Plateform Engine (Say Goodbye To Objs)

28 March 2013 - 10:06 PM

  • Title: Tile Layer Plateform
  • Description: Tile based plateform engine (Say goodbye to objects)
  • GM Version: :GM81
  • Registered: insert yes if it requires Pro, otherwise, no
  • File Type: .zip (exe and gm81 file included)
  • File Size: 5M
  • File Link (GM website): http://sandbox.yoyog...lateform-engine
  • Tags: tile,based,platform,engine,tutorial,layered,layers,tiles,objects,object
  • Summary
    A simple engine that will make you save time and make you have fun creating a plateform game.  This is just the basics but everything is in, landing, jump through plateforms, ennemies, items, markers, foreground and background tiles and death tiles.  Say goodbye to objects, land and death objects are no more required.  Basically, with ONE object only (the character) and ONE background configured as a tileset, you can create a full plateform game (boring yes but playable).  The only down side is that there is no precise collision checking available for tiles so you will notice in my demo that the character can stand in empty spaces on the tips of the mushroom plateforms, but this is just for demo purposes.  Using tiles, you can now control full portions of scenery that is visible or not.  For a better understanding of this, see the screenshots below.
     
    2013-03-28_07_27_32-.png
     
    2013-03-28_07_31_50-.png
     
    2013-03-28_07_32_13-.png

Facing directions not good at all

19 January 2013 - 12:12 AM

What I'm trying to do:  I'm trying to find out if an object is facing another object OR if it's not directly facing it, I want to know the difference in degrees.

What I use: direction, point_direction, lengthdir_x, lengthdir_y, point_distance

The code I have for now:
dirpt=point_direction(ocharacter.x,ocharacter.y,x,y)
dirlen=point_distance(x,y,ocharacter.x,ocharacter.y)
cx=lengthdir_x(dirlen,ocharacter.direction)
cy=lengthdir_y(dirlen,ocharacter.direction)
diro=point_direction(ocharacter.x,ocharacter.y,cx,cy)
dirdiff=diro-dirpt

Now if I have my object STRAIT UP and I put my character STRAIT DOWN, my character's direction is 90 which is OK, that's what I want.  BUT, when I use point_direction(ocharacter.x,ocharacter.y,x,y) I get something near 30????  What the heck???

Now I've done a few tests and decide to turn arround my object and no matter in which direction my character is, my values never really go above 30.  AND if I decide to go further, my number just keeps going up until I bust 360.  So my direction depends on my distance which is rediculous????  No matter how big a triangle is, if it has a 30 degree angle, it will always have a 30 degree angle.  Why is GM giving me ridiculous numbers like this, what am I doing wrong.

Now here is where this code comes into place.  Since I get totally different number from direction and point_direction, I decided to compare tomatoes with tomatoes SO, I took my point_direction from my character TO my object then, I calculated the X and Y values with lengthdir of the same distance between my object and the character but in the direction my character was ACTUALLY facing BUT again then, my numbers are totally insane.

Common, what is this and what am I doing wrong AND PLEASE!!!! PLEASE!!!!  no dectorad or cos or sin, I want to build this code without using those complexe calculations, I want to understand my code, I don't want an equation here.

Thanks in advanced!

Emit particles in irregular shaped regions

29 December 2012 - 08:54 AM

I think, this topic best describes this: http://gmc.yoyogames...howtopic=563887

Basically, I would have a sprite.  All it's transparent region would not have any particles created inside, only the colored regions.  So an emitter could actualy be an object and it's regions would be the sprite's region.  I think GM could move forward and permit that AND, since we're in the subject, permit creating particles on only certain colored regions.

2D 3D problem that I can't really explain

22 December 2012 - 03:52 PM

OK, I have done a 3D tutorial for noobs but I encounter the same problem everytime and have absolutley NO idea on how to solve the problem. Here's my code for my 3D camera:

Create Event:
//Set variables
z_from=512
x_from=room_width/2
y_from=room_height/2

z_to=0
x_to=room_width/2
y_to=room_height/2

z=512
x=room_width/23
y=room_width/2

x_up=0
y_up=-1
z_up=0

mx=0
my=0
mz=0

mouse_sensivity=1

//Start 3D engine
d3d_start()

Step event:
mx=window_mouse_get_x()-(window_get_width()/2)
my=window_mouse_get_y()-(window_get_height()/2)
x_from-=mx/mouse_sensivity
y_from-=my/mouse_sensivity
window_mouse_set(window_get_width()/2,window_get_height()/2)

And Finally, in the draw event:
d3d_set_projection(x_from,y_from,z_from,x_to,y_to,z_to,x_up,y_up,z_up)

Here is the result I get when I run the game. WHY????
Posted Image

I am not supposed to see the 2D code in background, only the one drawn in perspective but as you see, everything is mixed together. How can I only my 3D stuff and not the rest?