Jump to content


Spencer G.

Member Since 16 Oct 2007
Offline Last Active Sep 19 2015 10:16 AM

Topics I've Started

Is Their A More Effecient Way To Make A Textbox

15 March 2014 - 09:52 AM

I've been practicng my Gamemaker coding using Gamemaker 8.0, and I managed to make a working pokemon style textbox. Most of it works, but I'm sure there is a better way of doing it.

 

My questions are; for one how can I draw a sprite directly after drawn text, and my second question is; Are there better ways of doing, what I'm trying to acomplish? My goal is to have clean, minimal, and most importantly effecient code.

 

What I've got now is:

 

 

All of the following belong to textboxObj

      textboxObj is dependent on two sprites textboxSpr and textArrowSpr.

 

Create:

text[0] = "";
t = 1;
pos = 0;
stop = false;

if !variable_local_exists('maxText')
{maxText = -1;}

Step:

if t <= maxText
{
    if string_char_at(text[t],pos) = "~"
    {
        stop = true
        pos = pos - 0.5;
    }   
    
    if pos < 46 && stop = false
    {pos+=0.5;}
    if pos < 87 && stop = false
    {pos+=0.5;}
}

if t < maxText && stop = true && keyboard_check_released(ord('Z')) 
{
    pos = 0;
    t += 1;
    stop = false;
}

if (t >= maxText && stop = true && keyboard_check_released(ord('Z'))) || maxText = -1
{instance_destroy();}

Draw:

if t <= maxText
{
    if string_char_at(text[t],pos) = "~"
    {
        stop = true
        pos = pos - 0.5;
    }   
    
    if pos < 46 && stop = false
    {pos+=0.5;}
    if pos < 87 && stop = false
    {pos+=0.5;}
}

if t < maxText && stop = true && keyboard_check_released(ord('Z')) 
{
    pos = 0;
    t += 1;
    stop = false;
}

if (t >= maxText && stop = true && keyboard_check_released(ord('Z'))) || maxText = -1
{instance_destroy();}

 Creation Code:

maxText = 2;
text[1] = "This is a test line, #that can have new lines!~";
text[2] = "Look a second textbox!~";

or you can download the gmk file here

 

Also, I use the ~ to stop the line of text. It allowed me to draw the arrow sprite as soon as the text was finished. The problem I was having is the arrow wont draw next to the ending of the text everytime. Also, I want to find a way to achomplish all of this without using the ~ after each line of text.


Random Objects Falling With Path To Avoid (Solved)

14 February 2014 - 06:40 AM

I'm working on a game that has objects falling from the sky, and a player avoiding the objects. I know how to make the objects randomly generate at the top and fall down to the player, but I can't figure out for the life of me how to make a path for the player to survive in.

 

If you don't understanding what I mean by this look at this image.

7kel.png

 

I can get a similar pattern going, but the objects spawn to close to each other on the Y axis.

 

Solved: Using alarms


Animator needed

17 November 2010 - 05:06 AM

I need someone to animate this image
Posted Image
I need it to attack either by swiping his hands, biting, or your own creative design.

Isometric Style Graphic Request

18 November 2008 - 05:55 AM

I know this is a bit of a large request, but could someone please make me a isometric style swat member, moving up, down left, and right is all, holding a pistol and another holding nothing, the style like the man in my signature.

Credit will deffently be given in any way the creator likes.

Edit: the size of this needs to be W: 50 H: 100

Sprite Request: Team Fortress 2 Platform Sprites

05 November 2008 - 12:05 AM

Could someone please sprite the team in team fortress 2, in a platform prospective, and please keep the weapons separate.

The color patch and the team are below (try not to use to many colors out of the color patch.)
Posted Image

oh and don't worry about doing both red and blue teams just do one team I'll recolor if needed.


heres another great reference source
http://tomtallian.com/portfolio/tf2/