Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Type out text and push up by oliver @pixelchipcode
- // Create Event
- max_lines = 23; // Maximum number of lines to show
- line_height = 20; // Pixels between lines
- text_x = 10; // Starting X position for all text
- text_y = 30; // Starting Y position for first line
- // Variables for typing effect
- displayed_lines = []; // Lines that are fully typed and displayed
- current_line = 0; // Which line we're currently typing
- char_index = 1; // Position in current line
- type_speed = 1.25; // Characters per step
- // Function to reset everything to initial state
- function restart_sequence() {
- displayed_lines = []; // Clear displayed lines
- current_line = 0; // Back to first line
- char_index = 1; // Reset character position
- }
- // Array of all the text to display - keeping exact code formatting
- all_text = [
- "REM Quantum Transference Protocol v2.7.1",
- "MODE 7 : REM Minimal output mode for system interaction",
- "VDU 23, 1, 0;0;0;0; : REM Clear screen for initialization",
- "PRINT \"Quantum Transference System v2.7.1\"",
- "PRINT \"Secure Access Granted\"",
- "PRINT \"-------------------------------------------------\"",
- "PRINT \"Establishing baseline calibration metrics...\"",
- "REM Calibrate for quantum entanglement threshold",
- "PRINT \"Calibrating spatial coordinates and gravitational\"",
- "PRINT \"constants...\"",
- "FOR delay% = 1 TO 2000: NEXT delay% : REM Simulate calibration time",
- "PRINT \"Baseline metrics established.\"",
- "PRINT \"Gravitational constants stable.\"",
- "PRINT \"Quantum distortion: Nominal.\"",
- "PRINT \"-------------------------------------------------\"",
- "REM Input coordinates for quantum transference",
- "PRINT \"Input target spatial coordinates (X, Y, Z):\"",
- "INPUT x%, y%, z%",
- "REM Verifying validity of input coordinates",
- "IF x% < -1000 OR x% > 1000 OR y% < -1000 OR y% > 1000 OR z% < -1000 OR z% > 1000 THEN",
- "PRINT \"ERROR: Invalid spatial coordinates.\"",
- "PRINT \"Reinitializing protocol...\""
- ];
- restart_sequence();
- // Step Event
- // First, check for restart key
- if keyboard_check_pressed(ord("P")) {
- restart_sequence();
- }
- if (current_line < array_length(all_text)) {
- // Get the line we're currently typing
- var target_text = all_text[current_line];
- // Add one character at a time
- if (char_index <= string_length(target_text)) {
- char_index += type_speed;
- } else {
- // Line is complete
- array_push(displayed_lines, target_text);
- // If we're beyond max_lines, remove oldest line
- if (array_length(displayed_lines) > max_lines) {
- array_delete(displayed_lines, 0, 1);
- }
- // Move to next line
- current_line += 1;
- char_index = 1;
- }
- }
- // Draw Event
- // Draw completed lines
- for (var i = 0; i < array_length(displayed_lines); i++) {
- draw_text(text_x, text_y + (i * line_height), displayed_lines[i]);
- }
- // Draw current line being typed (if we're not done)
- if (current_line < array_length(all_text)) {
- var current_text = string_copy(all_text[current_line], 1, char_index);
- draw_text(text_x, text_y + (array_length(displayed_lines) * line_height), current_text);
- }
Advertisement
Add Comment
Please, Sign In to add comment